From d11b6ebe944b13e504608094424217b5d6b39a53 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sat, 8 Jul 2023 21:26:40 +0200 Subject: First version, whatever that means --- files/base.html | 15 +++++++++++++++ files/config.yaml | 16 ++++++++++++++++ files/first.md | 15 +++++++++++++++ files/index.html | 14 ++++++++++++++ files/index.xml | 21 +++++++++++++++++++++ files/post.html | 14 ++++++++++++++ 6 files changed, 95 insertions(+) create mode 100644 files/base.html create mode 100644 files/config.yaml create mode 100644 files/first.md create mode 100644 files/index.html create mode 100644 files/index.xml create mode 100644 files/post.html (limited to 'files') 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 @@ + + + + + + {{ block "title" . }}{{ .Config.Title }}{{ end }} + + + + +
+ {{ block "content" . }}{{ end }} +
+ + 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 @@ +title: "Title of your website" +baseurl: "https://example.com" +description: "My new shiny website" +language: "en-us" + +# Code highlighting. +# https://swapoff.org/chroma/playground/ +highlighting: "vs" + +# Minifies output HTML (including inline CSS, JS). +minify: true + +# Other generaters, in this case RSS generator. +extras: + - template: index.xml + 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 @@ +--- +title: "My first post" +url: first.html +date: 2023-06-29T14:51:39+02:00 +type: post +draft: false +--- + +This is my first post. It ain't much but it's an honest post. + +```lua +for k, v in pairs(arr) do + print(k, v[1], v[2], v[3]) +end +``` 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 @@ +{{ template "base.html" . }} + +{{ define "content" }} +
+

Posts

+ +
+{{ 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 @@ + + + {{ .Config.Title }}'s posts + {{ .Config.BaseURL }} + {{ .Config.Description }} + {{ .Config.Language }} + + {{ range $idx, $page := .Pages }} + {{ if eq $page.Type "post" }} + + {{ $page.Title }} + {{ $.Config.BaseURL }}/{{ $page.RelPermalink }} + {{ $page.Created.Format "Mon, 02 Jan 2006 15:04:05 -0700" }} + {{ $.Config.BaseURL }}/{{ $page.RelPermalink }} + {{ $page.Summary }} + {{ $page.Raw }} + + {{ end }} + {{ end }} + + 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 @@ +{{ template "base.html" . }} + +{{ define "title" }}{{ .Page.Title }}{{ end }} +{{ define "description" }}{{ .Page.Summary }}{{ end }} + +{{ define "content" }} +
+

{{ .Page.Title }}

+

{{ .Page.Created.Format "Jan 2, 2006" }}

+
+ {{ .Page.HTML }} +
+
+{{ end }} -- cgit v1.2.3