diff options
| author | Mitja Felicijan <m@mitjafelicijan.com> | 2023-07-08 21:26:40 +0200 |
|---|---|---|
| committer | Mitja Felicijan <m@mitjafelicijan.com> | 2023-07-08 21:26:40 +0200 |
| commit | d11b6ebe944b13e504608094424217b5d6b39a53 (patch) | |
| tree | 64559a80cf1c04fadf62f84f88120cdc5742e751 /files | |
| parent | 8e83285cc5b36c516880c9e321b86cb78db0d27f (diff) | |
| download | jbmafp-d11b6ebe944b13e504608094424217b5d6b39a53.tar.gz | |
First version, whatever that means
Diffstat (limited to 'files')
| -rw-r--r-- | files/base.html | 15 | ||||
| -rw-r--r-- | files/config.yaml | 16 | ||||
| -rw-r--r-- | files/first.md | 15 | ||||
| -rw-r--r-- | files/index.html | 14 | ||||
| -rw-r--r-- | files/index.xml | 21 | ||||
| -rw-r--r-- | files/post.html | 14 |
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 @@ +<!DOCTYPE html> +<html lang="{{ .Config.Language }}"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + <title>{{ block "title" . }}{{ .Config.Title }}{{ end }}</title> + <meta name="description" content="{{ block "description" . }}{{ .Config.Description }}{{ end }}"> + <link rel="alternate" type="application/rss+xml" href="{{ .Config.BaseURL }}/index.xml"> + </head> + <body> + <main> + {{ block "content" . }}{{ end }} + </main> + </body> +</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 @@ +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" }} +<div> + <h2>Posts</h2> + <ul> + {{ range .Pages }} + {{ if eq .Type "post" }} + <li><a href="/{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ end }} + {{ end }} + </ul> +</div> +{{ 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 @@ +<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"> + <channel> + <title>{{ .Config.Title }}'s posts</title> + <link>{{ .Config.BaseURL }}</link> + <description>{{ .Config.Description }}</description> + <language>{{ .Config.Language }}</language> + + {{ range $idx, $page := .Pages }} + {{ if eq $page.Type "post" }} + <item> + <title>{{ $page.Title }}</title> + <link>{{ $.Config.BaseURL }}/{{ $page.RelPermalink }}</link> + <pubDate>{{ $page.Created.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate> + <guid>{{ $.Config.BaseURL }}/{{ $page.RelPermalink }}</guid> + <description>{{ $page.Summary }}</description> + <content:encoded>{{ $page.Raw }}</content:encoded> + </item> + {{ end }} + {{ end }} + </channel> +</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 @@ +{{ template "base.html" . }} + +{{ define "title" }}{{ .Page.Title }}{{ end }} +{{ define "description" }}{{ .Page.Summary }}{{ end }} + +{{ define "content" }} +<div> + <h1>{{ .Page.Title }}</h1> + <p>{{ .Page.Created.Format "Jan 2, 2006" }}</p> + <div> + {{ .Page.HTML }} + </div> +</div> +{{ end }} |
