Skip to content

Commit 329cb4f

Browse files
committed
Using Sveltia CMS
1 parent 7ff8627 commit 329cb4f

7 files changed

Lines changed: 125 additions & 143 deletions

File tree

.hugo_build.lock

Whitespace-only changes.

config.toml

Lines changed: 0 additions & 96 deletions
This file was deleted.

config.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
baseurl: https://norwegianlanguagelearning.no
2+
contentdir: content
3+
layoutdir: layouts
4+
publishdir: public
5+
title: Norwegian Language Learning
6+
canonifyurls: false
7+
theme: github.com/halogenica/beautifulhugo
8+
DefaultContentLanguage: en
9+
metaDataFormat: yaml
10+
pygmentsUseClasses: true
11+
pygmentCodeFences: true
12+
enableRobotsTXT: true
13+
module:
14+
imports:
15+
- path: github.com/halogenica/beautifulhugo
16+
security:
17+
enableInlineShortcodes: false
18+
exec:
19+
allow:
20+
- ^dart-sass-embedded$
21+
- ^go$
22+
- ^npx$
23+
- ^postcss$
24+
- ^asciidoctor$
25+
osEnv:
26+
- (?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\w+)$
27+
funcs:
28+
getenv:
29+
- ^HUGO_
30+
- ^CI$
31+
http:
32+
methods:
33+
- (?i)GET|POST
34+
urls:
35+
- .*
36+
params:
37+
homeTitle: Norwegian Language Learning
38+
logo: avatar-icon.png
39+
favicon: favicon.png
40+
dateFormat: 2006-01-02
41+
commit: false
42+
rss: false
43+
comments: true
44+
Author:
45+
name: NLL contributors
46+
gitlab: NorwegianLanguageLearning
47+
github: nllcommunity
48+
menu:
49+
main:
50+
- name: Home
51+
url: ""
52+
weight: 1
53+
- name: Lessons
54+
url: categories/sunday-lessons/
55+
weight: 2
56+
- name: About
57+
url: page/about/
58+
weight: 3
59+
- name: More information
60+
identifier: info
61+
url: page/info/
62+
weight: 4
63+
- parent: info
64+
name: Rules
65+
url: page/rules/
66+
weight: 1
67+
- parent: info
68+
name: Channel explanations
69+
url: page/channels/
70+
weight: 2
71+
- parent: info
72+
name: Heimdallr
73+
url: page/heimdallr/
74+
weight: 3
75+

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ module github.com/NLLCommunity/nllcommunity.github.io
22

33
go 1.24.5
44

5-
require github.com/halogenica/beautifulhugo v0.0.0-20250508050025-e69e25d4ca0d // indirect
5+
require (
6+
github.com/halogenica/beautifulhugo v0.0.0-20250508050025-e69e25d4ca0d // indirect
7+
)

layouts/_shortcodes/discourse.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@
1717
{{ $opts := dict
1818
"headers" (dict "Api-Key" $token "Api-Username" "system") }}
1919

20-
{{ $data := dict }}
21-
{{ $responde := resources.GetRemote (print (.Get 0) ".json") $opts}}
22-
{{ $data = unmarshal $responde.Content }}
23-
{{ $page := .Page }}
24-
{{ with (index $data.post_stream.posts 0).cooked }}
25-
{{ . | replaceRE `(?s)\<pre data-code-wrap.*syncToDiscord:.*\/pre\>` ""
26-
| replaceRE (print `\<h[123].*?\>` $page.Title `\</h[123]\>`) ""
27-
| replaceRE `\<a\>id:customize</a\>`
28-
`<span style="text-decoration: underline dotted gray"
29-
title="A clickable item near the top of the channel list"><i>Channels &amp; Roles</i>
30-
</span>`
31-
| safeHTML }}
32-
{{ end }}
20+
{{ if ne $token nil }}
21+
{{ $data := dict }}
22+
{{ $responde := resources.GetRemote (print (.Get 0) ".json") $opts}}
23+
{{ $data = unmarshal $responde.Content }}
24+
{{ $page := .Page }}
25+
{{ with (index $data.post_stream.posts 0).cooked }}
26+
{{ . | replaceRE `(?s)\<pre data-code-wrap.*syncToDiscord:.*\/pre\>` ""
27+
| replaceRE (print `\<h[123].*?\>` $page.Title `\</h[123]\>`) ""
28+
| replaceRE `\<a\>id:customize</a\>`
29+
`<span style="text-decoration: underline dotted gray"
30+
title="A clickable item near the top of the channel list"><i>Channels &amp; Roles</i>
31+
</span>`
32+
| safeHTML }}
33+
{{ end }}
34+
{{ end }}

static/admin/config.yml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
backend:
22
name: github
3-
repo: nllcommunity/nllcommunity.github.io
4-
branch: main
5-
#site_domain: www.norwegianlanguagelearning.no
6-
open_authoring: true
7-
squash_merges: true
3+
repo: NLLCommunity/nllcommunity.github.io
84

9-
publish_mode: "editorial_workflow"
10-
media_folder: "static/images"
11-
public_folder: "/images"
5+
media_folder: /public/media
6+
public_folder: /media
127

138
collections:
14-
- name: "posts"
15-
label: "Posts"
16-
folder: "content/post"
17-
create: true
18-
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
19-
editor:
20-
preview: true
9+
- name: posts
10+
label: Posts
11+
folder: content/post
2112
fields:
22-
- {label: "Title", name: "title", widget: "string"}
23-
- {label: "Publish Date", name: "date", widget: "datetime"}
24-
- {label: "Author", name: "author", widget: "string"}
25-
- {label: "Categories", name: "categories", widget: "list", default: ["Quick Notes"]}
26-
- {label: "Body", name: "body", widget: "markdown"}
27-
- name: "pages"
28-
label: "Pages"
29-
folder: "content/page"
30-
create: true
31-
slug: "{{slug}}"
32-
fields:
33-
- {label: "Title", name: "title", widget: "string"}
34-
- {label: "Body", name: "body", widget: "markdown"}
13+
- label: "Title"
14+
name: "title"
15+
widget: "string"
16+
17+
- label: "Subtitle"
18+
name: "subtitle"
19+
widget: "string"
20+
21+
- label: "Author"
22+
name: "author"
23+
widget: "string"
24+
25+
- label: "Date"
26+
name: "date"
27+
widget: "datetime"
28+
29+
- label: "Categories"
30+
name: "categories"
31+
widget: "list"
32+
33+
- label: "Body"
34+
name: "body"
35+
widget: "richtext"

static/admin/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
65
<meta name="robots" content="noindex" />
7-
<title>Content Manager</title>
6+
<title>Sveltia CMS</title>
87
</head>
98
<body>
10-
<!-- Include the script that builds the page and powers Decap CMS -->
11-
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
9+
<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
1210
</body>
13-
</html>
11+
</html>

0 commit comments

Comments
 (0)