summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
Diffstat (limited to 'files')
-rw-r--r--files/base.html15
-rw-r--r--files/config.yaml16
-rw-r--r--files/first.md15
-rw-r--r--files/index.html14
-rw-r--r--files/index.xml21
-rw-r--r--files/post.html14
6 files changed, 95 insertions, 0 deletions
diff --git a/files/base.html b/files/base.html
new file mode 100644
index 0000000..d965c25
--- /dev/null
+++ b/files/base.html
@@ -0,0 +1,15 @@
1<!DOCTYPE html>
2<html lang="{{ .Config.Language }}">
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width,initial-scale=1">
6 <title>{{ block "title" . }}{{ .Config.Title }}{{ end }}</title>
7 <meta name="description" content="{{ block "description" . }}{{ .Config.Description }}{{ end }}">
8 <link rel="alternate" type="application/rss+xml" href="{{ .Config.BaseURL }}/index.xml">
9 </head>
10 <body>
11 <main>
12 {{ block "content" . }}{{ end }}
13 </main>
14 </body>
15</html>
diff --git a/files/config.yaml b/files/config.yaml
new file mode 100644
index 0000000..a89795f
--- /dev/null
+++ b/files/config.yaml
@@ -0,0 +1,16 @@
1title: "Title of your website"
2baseurl: "https://example.com"
3description: "My new shiny website"
4language: "en-us"
5
6# Code highlighting.
7# https://swapoff.org/chroma/playground/
8highlighting: "vs"
9
10# Minifies output HTML (including inline CSS, JS).
11minify: true
12
13# Other generaters, in this case RSS generator.
14extras:
15 - template: index.xml
16 url: index.xml
diff --git a/files/first.md b/files/first.md
new file mode 100644
index 0000000..9a4b97f
--- /dev/null
+++ b/files/first.md
@@ -0,0 +1,15 @@
1---
2title: "My first post"
3url: first.html
4date: 2023-06-29T14:51:39+02:00
5type: post
6draft: false
7---
8
9This is my first post. It ain't much but it's an honest post.
10
11```lua
12for k, v in pairs(arr) do
13 print(k, v[1], v[2], v[3])
14end
15```
diff --git a/files/index.html b/files/index.html
new file mode 100644
index 0000000..eeb2641
--- /dev/null
+++ b/files/index.html
@@ -0,0 +1,14 @@
1{{ template "base.html" . }}
2
3{{ define "content" }}
4<div>
5 <h2>Posts</h2>
6 <ul>
7 {{ range .Pages }}
8 {{ if eq .Type "post" }}
9 <li><a href="/{{ .RelPermalink }}">{{ .Title }}</a></li>
10 {{ end }}
11 {{ end }}
12 </ul>
13</div>
14{{ end }}
diff --git a/files/index.xml b/files/index.xml
new file mode 100644
index 0000000..830dd90
--- /dev/null
+++ b/files/index.xml
@@ -0,0 +1,21 @@
1<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
2 <channel>
3 <title>{{ .Config.Title }}'s posts</title>
4 <link>{{ .Config.BaseURL }}</link>
5 <description>{{ .Config.Description }}</description>
6 <language>{{ .Config.Language }}</language>
7
8 {{ range $idx, $page := .Pages }}
9 {{ if eq $page.Type "post" }}
10 <item>
11 <title>{{ $page.Title }}</title>
12 <link>{{ $.Config.BaseURL }}/{{ $page.RelPermalink }}</link>
13 <pubDate>{{ $page.Created.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
14 <guid>{{ $.Config.BaseURL }}/{{ $page.RelPermalink }}</guid>
15 <description>{{ $page.Summary }}</description>
16 <content:encoded>{{ $page.Raw }}</content:encoded>
17 </item>
18 {{ end }}
19 {{ end }}
20 </channel>
21</rss>
diff --git a/files/post.html b/files/post.html
new file mode 100644
index 0000000..28ffad2
--- /dev/null
+++ b/files/post.html
@@ -0,0 +1,14 @@
1{{ template "base.html" . }}
2
3{{ define "title" }}{{ .Page.Title }}{{ end }}
4{{ define "description" }}{{ .Page.Summary }}{{ end }}
5
6{{ define "content" }}
7<div>
8 <h1>{{ .Page.Title }}</h1>
9 <p>{{ .Page.Created.Format "Jan 2, 2006" }}</p>
10 <div>
11 {{ .Page.HTML }}
12 </div>
13</div>
14{{ end }}