diff options
-rw-r--r-- | config.json | 17 | ||||
-rw-r--r-- | config.toml | 14 | ||||
-rw-r--r-- | config.yaml | 12 | ||||
-rw-r--r-- | content/default/messages/quickstart.md | 2 | ||||
-rw-r--r-- | themes/default/layouts/_default/list.html | 4 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.following.html | 66 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.gallery.html | 8 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.webring.html | 33 | ||||
-rw-r--r-- | themes/default/layouts/partials/following-list.html | 80 | ||||
-rw-r--r-- | themes/default/layouts/partials/gallery-images.html | 13 | ||||
-rw-r--r-- | themes/default/layouts/partials/gallery.html | 15 | ||||
-rw-r--r-- | themes/default/layouts/partials/navigator-right.html | 6 | ||||
-rw-r--r-- | themes/default/layouts/partials/web-ring.html | 43 | ||||
-rw-r--r-- | themes/default/layouts/partials/webring.html | 15 | ||||
-rw-r--r-- | themes/default/layouts/shortcodes/version.html | 7 |
15 files changed, 198 insertions, 137 deletions
diff --git a/config.json b/config.json index 883e120..4fd39bd 100644 --- a/config.json +++ b/config.json @@ -253,6 +253,18 @@ "webmanifest": { "baseName": "site", "mediaType": "application/manifest+json" + }, + "gallery": { + "baseName": "gallery", + "mediaType": "text/html" + }, + "following": { + "baseName": "following", + "mediaType": "text/html" + }, + "webring": { + "baseName": "webring", + "mediaType": "text/html" } }, "outputs": { @@ -271,7 +283,10 @@ ], "section": [ "html", - "rss" + "rss", + "gallery", + "following", + "webring" ], "taxonomy": [ "html", diff --git a/config.toml b/config.toml index 50e2007..8b90d6b 100644 --- a/config.toml +++ b/config.toml @@ -195,9 +195,21 @@ enableRobotsTXT = true baseName = "site" mediaType = "application/manifest+json" + [outputFormats.gallery] + baseName = "gallery" + mediaType = "text/html" + + [outputFormats.following] + baseName = "following" + mediaType = "text/html" + + [outputFormats.webring] + baseName = "webring" + mediaType = "text/html" + [outputs] home = ["html", "rss", "xslt.rss", "xslt.sitemap", "json", "authors", "sources", "browserconfig", "history", "records", "webmanifest"] - section = ["html", "rss"] + section = ["html", "rss", "gallery", "following", "webring"] taxonomy = ["html", "rss"] term = ["html", "rss"] page = ["html", "plain"] diff --git a/config.yaml b/config.yaml index a9c5b8b..897f781 100644 --- a/config.yaml +++ b/config.yaml @@ -169,6 +169,15 @@ outputFormats: webmanifest: baseName: site mediaType: application/manifest+json + gallery: + baseName: gallery + mediaType: text/html + following: + baseName: following + mediaType: text/html + webring: + baseName: webring + mediaType: text/html outputs: home: @@ -186,6 +195,9 @@ outputs: section: - html - rss + - gallery + - following + - webring taxonomy: - html - rss diff --git a/content/default/messages/quickstart.md b/content/default/messages/quickstart.md index 00b35c1..0db74e2 100644 --- a/content/default/messages/quickstart.md +++ b/content/default/messages/quickstart.md @@ -12,7 +12,7 @@ GIT CLONE. {{% version clone=true %}} -EXECUTE HUGO TWICE. HUGO VERSION >= 0.101.0 +EXECUTE HUGO TWICE. HUGO VERSION >= {{% version hugo=true %}} ```shell cd canory diff --git a/themes/default/layouts/_default/list.html b/themes/default/layouts/_default/list.html index 8f3c5f5..3fc93ce 100644 --- a/themes/default/layouts/_default/list.html +++ b/themes/default/layouts/_default/list.html @@ -26,12 +26,12 @@ {{- partial "author-list.html" . -}} {{ range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.picturegallery) }} - {{- partial "gallery-images.html" . -}} + {{- partial "gallery.html" . -}} {{ end }} {{ range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.webring) }} {{- partial "following-list.html" . -}} - {{- partial "web-ring.html" . -}} + {{- partial "webring.html" . -}} {{ end }} {{ end }} diff --git a/themes/default/layouts/_default/section.following.html b/themes/default/layouts/_default/section.following.html new file mode 100644 index 0000000..fc48172 --- /dev/null +++ b/themes/default/layouts/_default/section.following.html @@ -0,0 +1,66 @@ +{{- $feeds := slice -}} +{{- $paths := slice -}} +{{- $author := partial "function-authors-data.html" . -}} + +{{- range $author.feeds.rss -}} + {{- $data := split . " " -}} + {{- $url := delimit (first 1 $data) "" -}} + {{- $feeds = $feeds | append (string $url) -}} +{{- end -}} + +{{- range first 3 (shuffle $feeds) -}} + {{- $sources := where $.Site.RegularPages "Params.feed.source" . -}} + {{- $via := where $.Site.RegularPages "Params.Author" $author.user -}} + {{- $following := $via | intersect $sources -}} + + {{- range first 1 $following -}} + + {{- $href := or .Params.feed.home (print "http://" .Params.feed.domain) -}} + + <micro-author> + <micro-card> + <micro-summary> + <micro-thumbnail> + <figure> + <a + title="{{ .Params.feed.name }}" + href="{{ $href }}"> + <picture> + <img + width="64" + height="64" + alt="{{ .Params.feed.name }}" + src="{{ .Params.feed.favicon }}" + /> + </picture> + </a> + </figure> + </micro-thumbnail> + <micro-header> + <h2> + <b>{{ .Params.feed.name }}</b> + </h2> + <h3> + <a + title="{{ .Params.feed.name }}" + href="{{ $href }}"> + @{{ .Params.feed.domain }} + </a> + </h3> + <time + title="{{ .Date | time.Format "Monday, January 2, 2006 at 15:04:05 MST" }}" + datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}"> + {{ (.Date.Local | time.Format "3:04 PM Jan 2 2006") -}} + </time> + </micro-header> + <a + title="Follow {{ .Params.feed.name }}" + href="{{ $href }}"> + {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }} + <span>Follow</span> + </a> + </micro-summary> + </micro-card> + </micro-author> + {{- end -}} +{{- end -}} diff --git a/themes/default/layouts/_default/section.gallery.html b/themes/default/layouts/_default/section.gallery.html new file mode 100644 index 0000000..276ae9c --- /dev/null +++ b/themes/default/layouts/_default/section.gallery.html @@ -0,0 +1,8 @@ +{{- $folder := print "public/" .Section "/media/" -}} + +{{- partial "gallery-walk.html" + (dict + "Folder" $folder + "Context" . + ) +-}} diff --git a/themes/default/layouts/_default/section.webring.html b/themes/default/layouts/_default/section.webring.html new file mode 100644 index 0000000..8a90f96 --- /dev/null +++ b/themes/default/layouts/_default/section.webring.html @@ -0,0 +1,33 @@ +{{- $author := partial "function-authors-data.html" . -}} +{{- $feeds := partial "function-generate-feeds.html" . -}} + +{{ range first 3 (uniq (sort $feeds "FeedDateTime" "desc")) }} + <web-ring-item> + <header> + <a + title="{{ .FeedLink }}" + href="{{ .FeedLink }}"> + {{ .FeedTitle }} + </a> + </header> + <time + title="{{ .FeedDateTitle }}" + datetime="{{ .FeedDateTime }}"> + {{ .FeedDate }} + </time> + <p> + {{ "--" | markdownify }} + {{ if gt (len .FeedDescriptionShort) (len .FeedContentShort) -}} + {{ or .FeedDescriptionShort .FeedTitle }} + {{- else -}} + {{ or .FeedContentShort .FeedTitle }} + {{- end }} + — + </p> + <a + title="{{ .FeedSourceDescription }}" + href="{{ or .FeedSourceHome .FeedSourceLink }}"> + {{ .FeedSourceTitle }} + </a> + </web-ring-item> +{{ end }} diff --git a/themes/default/layouts/partials/following-list.html b/themes/default/layouts/partials/following-list.html index e99a86b..165d699 100644 --- a/themes/default/layouts/partials/following-list.html +++ b/themes/default/layouts/partials/following-list.html @@ -1,79 +1,15 @@ -{{- $feeds := slice -}} -{{- $paths := slice -}} {{- $author := partial "function-authors-data.html" . -}} - -{{- range $author.feeds.rss -}} - {{- $data := split . " " -}} - {{- $url := delimit (first 1 $data) "" -}} - {{- $feeds = $feeds | append (string $url) -}} -{{- end -}} +{{- $following := print "public/" $author.user "/following.html" -}} <following-list> <h1>Following</h1> <aside> - {{- range first 3 (shuffle $feeds) -}} - {{- $sources := where $.Site.RegularPages "Params.feed.source" . -}} - {{- $via := where $.Site.RegularPages "Params.Author" $author.user -}} - {{- $following := $via | intersect $sources -}} - - {{- range first 1 $following -}} - - {{- $href := or .Params.feed.home (print "http://" .Params.feed.domain) -}} - - <micro-author> - <micro-card> - <micro-summary> - <micro-thumbnail> - <figure> - <a - title="{{ .Params.feed.name }}" - href="{{ $href }}"> - <picture> - <img - width="64" - height="64" - alt="{{ .Params.feed.name }}" - src="{{ .Params.feed.favicon }}" - /> - </picture> - </a> - </figure> - </micro-thumbnail> - <micro-header> - <h2> - <b>{{ .Params.feed.name }}</b> - </h2> - <h3> - <a - title="{{ .Params.feed.name }}" - href="{{ $href }}"> - @{{ .Params.feed.domain }} - </a> - </h3> - <time - title="{{ .Date | time.Format "Monday, January 2, 2006 at 15:04:05 MST" }}" - datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}"> - {{ (.Date.Local | time.Format "3:04 PM Jan 2 2006") -}} - </time> - </micro-header> - <a - title="Follow {{ .Params.feed.name }}" - href="{{ $href }}"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }} - <span>Follow</span> - </a> - </micro-summary> - </micro-card> - </micro-author> - {{- else -}} - <footer> - <code>No feeds found!</code> - </footer> - {{- end -}} - {{- else -}} - <footer> - <code>No feeds found!</code> - </footer> - {{- end -}} + {{- if and $author.feeds.rss (fileExists $following) -}} + {{- (resources.Get $following).Content | safeHTML -}} + {{- else -}} + <footer> + <code>No feeds found!</code> + </footer> + {{- end -}} </aside> </following-list> diff --git a/themes/default/layouts/partials/gallery-images.html b/themes/default/layouts/partials/gallery-images.html deleted file mode 100644 index 5950637..0000000 --- a/themes/default/layouts/partials/gallery-images.html +++ /dev/null @@ -1,13 +0,0 @@ -{{ $folder := print "public/" (partial "author-user.html" .) "/media/" }} - -<gallery-images> - <h1>Gallery</h1> - <aside> - {{ partial "gallery-walk.html" - (dict - "Folder" $folder - "Context" . - ) - }} - </aside> -</gallery-images> diff --git a/themes/default/layouts/partials/gallery.html b/themes/default/layouts/partials/gallery.html new file mode 100644 index 0000000..2634b68 --- /dev/null +++ b/themes/default/layouts/partials/gallery.html @@ -0,0 +1,15 @@ +{{- $folder := print "public/" .Section "/media/" -}} +{{- $gallery := print "public/" .Section "/gallery.html" -}} + +<gallery-images> + <h1>Gallery</h1> + <aside> + {{ if fileExists $gallery }} + {{- (resources.Get $gallery).Content | safeHTML -}} + {{ else }} + <footer> + <code>No media found!</code> + </footer> + {{ end }} + </aside> +</gallery-images> diff --git a/themes/default/layouts/partials/navigator-right.html b/themes/default/layouts/partials/navigator-right.html index 01506eb..573cb8f 100644 --- a/themes/default/layouts/partials/navigator-right.html +++ b/themes/default/layouts/partials/navigator-right.html @@ -5,7 +5,7 @@ (eq .Page.Kind "section") -}} - {{- partial "gallery-images.html" . -}} + {{- partial "gallery.html" . -}} {{- partial "following-list.html" . -}} {{- end -}} @@ -15,12 +15,12 @@ (eq .Page.Kind "section") -}} - {{- partial "web-ring.html" . -}} + {{- partial "webring.html" . -}} {{- else -}} {{- range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.webring) -}} - {{- partial "web-ring.html" . -}} + {{- partial "webring.html" . -}} {{- end -}} {{- end -}} diff --git a/themes/default/layouts/partials/web-ring.html b/themes/default/layouts/partials/web-ring.html deleted file mode 100644 index 1d163af..0000000 --- a/themes/default/layouts/partials/web-ring.html +++ /dev/null @@ -1,43 +0,0 @@ -{{- $feeds := partial "function-generate-feeds.html" . -}} - -<web-ring> - <h1>Web Ring</h1> - {{ if $feeds }} - <aside> - {{ range first 3 (uniq (sort $feeds "FeedDateTime" "desc")) }} - <web-ring-item> - <header> - <a - title="{{ .FeedLink }}" - href="{{ .FeedLink }}"> - {{ .FeedTitle }} - </a> - </header> - <time - title="{{ .FeedDateTitle }}" - datetime="{{ .FeedDateTime }}"> - {{ .FeedDate }} - </time> - <p> - {{ "--" | markdownify }} - {{ if gt (len .FeedDescriptionShort) (len .FeedContentShort) -}} - {{ or .FeedDescriptionShort .FeedTitle }} - {{- else -}} - {{ or .FeedContentShort .FeedTitle }} - {{- end }} - — - </p> - <a - title="{{ .FeedSourceDescription }}" - href="{{ or .FeedSourceHome .FeedSourceLink }}"> - {{ .FeedSourceTitle }} - </a> - </web-ring-item> - {{ end }} - </aside> - {{ else }} - <footer> - <code>No content found!</code> - </footer> - {{ end }} -</web-ring> diff --git a/themes/default/layouts/partials/webring.html b/themes/default/layouts/partials/webring.html new file mode 100644 index 0000000..0f97624 --- /dev/null +++ b/themes/default/layouts/partials/webring.html @@ -0,0 +1,15 @@ +{{- $feeds := partial "function-generate-feeds.html" . -}} +{{- $webring := print "public/" .Section "/webring.html" -}} + +<web-ring> + <h1>Web Ring</h1> + {{ if and $feeds (fileExists $webring) }} + <aside> + {{- (resources.Get $webring).Content | safeHTML -}} + </aside> + {{ else }} + <footer> + <code>No content found!</code> + </footer> + {{ end }} +</web-ring> diff --git a/themes/default/layouts/shortcodes/version.html b/themes/default/layouts/shortcodes/version.html index 48aed2c..debd59a 100644 --- a/themes/default/layouts/shortcodes/version.html +++ b/themes/default/layouts/shortcodes/version.html @@ -1,11 +1,16 @@ -{{- $version := "0.11.8" -}} +{{- $version := "0.11.9" -}} {{- $number := default false (.Get "number" | default (.Get 0)) -}} {{- $clone := default false (.Get "clone" | default (.Get 1)) -}} +{{- $hugo := default false (.Get "hugo" | default (.Get 2)) -}} {{- if $number -}} {{ $version }} {{- end -}} +{{- if $hugo -}} +0.108.0 +{{- end -}} + {{- if $clone -}} ```shell git clone --branch {{ $version }} https://www.thedroneely.com/git/thedroneely/canory |