diff --git a/archetypes/default.md b/archetypes/default.md index c6f3fce..3de90ce 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,5 +1,5 @@ -+++ -title = '{{ replace .File.ContentBaseName "-" " " | title }}' -date = {{ .Date }} -draft = true -+++ +--- +title: '{{ replace .File.ContentBaseName "-" " " | title }}' +date: {{ .Date }} +draft: true +--- diff --git a/hugo.toml b/hugo.toml deleted file mode 100644 index 6c35bc4..0000000 --- a/hugo.toml +++ /dev/null @@ -1,23 +0,0 @@ -baseURL = 'https://example.org/' -languageCode = 'en-US' -title = 'My New Hugo Site' - -[[menus.main]] -name = 'Home' -pageRef = '/' -weight = 10 - -[[menus.main]] -name = 'Posts' -pageRef = '/posts' -weight = 20 - -[[menus.main]] -name = 'Tags' -pageRef = '/tags' -weight = 30 - -[module] - [module.hugoVersion] - extended = false - min = "0.116.0" diff --git a/hugo.yaml b/hugo.yaml new file mode 100644 index 0000000..fe381d4 --- /dev/null +++ b/hugo.yaml @@ -0,0 +1,28 @@ +# baseURL = 'https://example.org/' +# languageCode = 'en-US' +# title = 'My New Hugo Site' + +# [[menus.main]] +# name = 'Home' +# pageRef = '/' +# weight = 10 + +# [[menus.main]] +# name = 'Posts' +# pageRef = '/posts' +# weight = 20 + +# [[menus.main]] +# name = 'Tags' +# pageRef = '/tags' +# weight = 30 + +module: + hugoVersion: + extended: false + min: "0.116.0" + +outputs: + section: + - html + - json diff --git a/layouts/albums/baseof.json b/layouts/albums/baseof.json new file mode 100644 index 0000000..e11222a --- /dev/null +++ b/layouts/albums/baseof.json @@ -0,0 +1,3 @@ +{ + {{- block "main" . }}{{ end -}} +} diff --git a/layouts/albums/list.json b/layouts/albums/list.json new file mode 100644 index 0000000..b0b3ac8 --- /dev/null +++ b/layouts/albums/list.json @@ -0,0 +1,4 @@ +{ + "images": [{{ partial "albums/images.json" . }}], + "albums": [{{ partial "albums/albums.json" . }}] +} diff --git a/layouts/partials/albums/albums.json b/layouts/partials/albums/albums.json new file mode 100644 index 0000000..ad8bd67 --- /dev/null +++ b/layouts/partials/albums/albums.json @@ -0,0 +1,15 @@ +{{- $first := true -}} +{{- range .Pages.ByTitle -}} +{{- if not $first }}, {{ end }} +{{ $first = false -}} +{ + "title": "{{ .Title }}", +{{- with .Resources.GetMatch "album.zip" }} + "albumDownload": "{{ .RelPermalink }}", +{{ else -}} +{{ warnf "Could not find album.zip for %s" .RelPermalink -}} +{{ end -}} + "images": [{{ partial "albums/images.json" . }}], + "albums": [{{ partial "albums/albums.json" . }}] +} +{{ end -}} diff --git a/layouts/partials/albums/images.json b/layouts/partials/albums/images.json new file mode 100644 index 0000000..7622118 --- /dev/null +++ b/layouts/partials/albums/images.json @@ -0,0 +1,12 @@ +{{- $first := true -}} +{{- range .Resources.ByType "image" -}} +{{- if not $first }}, {{ end }} +{{ $first = false -}} +{ + "title": "{{ .Title }}", + "url": "{{ .RelPermalink }}", + "width": "{{ .Width }}", + "height": "{{ .Height }}", + "thumbnail": "{{ (.Fit "200x200").RelPermalink }}" +} +{{ end -}}