Skip to content

Commit 9715c5b

Browse files
authored
Merge pull request #24 from zihanKuang/add-archetype
feat: Add Content Archetypes and Initial Challenge Layouts
2 parents 1d14cfa + b558ff2 commit 9715c5b

File tree

8 files changed

+92
-5
lines changed

8 files changed

+92
-5
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ use GitHub pull requests for this purpose. Consult
2222
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
2323
information on using pull requests.
2424

25-
## Community Guidelines
26-
27-
This project follows
28-
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
29-
3025
## Local Development
3126

3227
To develop this theme locally, you can link it to a Hugo site (like the [academy starter template](https://github.com/layer5io/academy-example)) using a `replace` directive in the site's `go.mod` file.
@@ -75,3 +70,4 @@ To ensure you have the latest version of the theme or to upgrade to a newer rele
7570
```
7671
7772
Your site should now be running with the updated theme.
73+

archetypes/challenge-info.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# This is the prototype template for the "Challenge Info/Rules Page"
3+
type: "chapter"
4+
title: 'About {{ replace .File.ContentBaseName `-` ` ` | title }}'
5+
description: "Rules, eligibility, and scoring criteria for this challenge."
6+
weight: 1 # Usually the first info page
7+
---
8+
9+
## Eligibility Criteria

archetypes/challenge-main.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# This is the prototype template for the "Challenge Main Description Page"
3+
type: "chapter"
4+
title: '{{ replace .File.ContentBaseName `-` ` ` | title }}'
5+
description: "Briefly describe what this challenge is about here."
6+
weight: 2 # Usually after the rules page
7+
---
8+
9+
## Objective

archetypes/chapter.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
type: "chapter"
3+
title: '{{ replace .File.ContentBaseName `-` ` ` | title }}'
4+
description: "Enter a brief description of this chapter here..."
5+
weight: 5
6+
---
7+
8+
### Start writing your chapter content here

archetypes/course.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
type: "course"
3+
title: '{{ replace .File.ContentBaseName `-` ` ` | title }}'
4+
description: "Enter a detailed introduction to the course here..."
5+
weight: 1
6+
# Banner image for the course. Must be a full path including the UUID.
7+
banner: ""
8+
---

layouts/challenges/baseof.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!doctype html>
2+
<html itemscope itemtype="http://schema.org/WebPage"
3+
{{- with .Site.Language.LanguageDirection }} dir="{{ . }}" {{- end -}}
4+
{{ with .Site.Language.Lang }} lang="{{ . }}" {{- end }} {{/**/ -}}
5+
class="no-js">
6+
<head>
7+
{{ partial "head.html" . }}
8+
</head>
9+
<body class="td-{{ .Kind }}{{ with .Page.Params.body_class }} {{ . }}{{ end }}">
10+
<div class="container-fluid td-outer">
11+
<div class="td-main" >
12+
<div class="row flex-xl-nowrap">
13+
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
14+
{{ partial "sidebar.html" . }}
15+
</aside>
16+
<aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none">
17+
{{ partial "page-meta-links.html" . }}
18+
{{ partial "toc.html" . }}
19+
{{ partial "taxonomy_terms_clouds.html" . }}
20+
</aside>
21+
<main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main">
22+
{{ partial "version-banner.html" . }}
23+
{{ if not (.Param "ui.breadcrumb_disable") -}}
24+
{{ partial "breadcrumb.html" . -}}
25+
{{ end -}}
26+
{{ block "main" . }}{{ end }}
27+
</main>
28+
</div>
29+
</div>
30+
</div>
31+
{{ partial "scripts.html" . }}
32+
</body>
33+
</html>

layouts/challenges/list.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{ define "main" }}
2+
<div class="td-content">
3+
<h1>{{ .Title }}</h1>
4+
{{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ end }}
5+
<header class="article-meta">
6+
{{ partial "taxonomy_terms_article_wrapper.html" . -}}
7+
{{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) -}}
8+
{{ partial "reading-time.html" . -}}
9+
{{ end -}}
10+
</header>
11+
{{ .Render "_td-content-after-header" -}}
12+
{{ .Content }}
13+
{{ partial "section-index.html" . -}}
14+
{{ partial "feedback.html" . -}}
15+
{{ if (.Site.Config.Services.Disqus.Shortname) -}}
16+
<br />
17+
{{- partial "disqus-comment.html" . -}}
18+
{{ end -}}
19+
{{ partial "page-meta-lastmod.html" . -}}
20+
</div>
21+
{{ end -}}

layouts/challenges/single.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{ define "main" }}
2+
{{ .Render "_td-content" }}
3+
{{ end }}

0 commit comments

Comments
 (0)