From f9abb3674fd1ed901af8b8dd1b4be02e3dca0691 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 18 Mar 2023 16:31:10 -0400 Subject: [PATCH] move more implementation to theme for consistency, reuse later ; enable pagination ; tune home page to be just a welcome page ; tune search page text ; tune headings --- archetypes/.gitkeep | 0 archetypes/default.md | 6 - config.toml | 85 ++++++++++- static/.gitkeep | 0 themes/hugo-xmin/archetypes/default.md | 9 +- themes/hugo-xmin/content/search.md | 10 ++ themes/hugo-xmin/exampleSite/config.toml | 83 +++++++++++ themes/hugo-xmin/exampleSite/config.yaml | 42 ------ themes/hugo-xmin/layouts/_default/index.json | 5 + themes/hugo-xmin/layouts/_default/list.html | 22 ++- themes/hugo-xmin/layouts/_default/search.html | 33 +++++ themes/hugo-xmin/layouts/_default/single.html | 3 +- themes/hugo-xmin/layouts/partials/header.html | 5 + .../hugo-xmin/layouts}/robots.txt | 0 .../static}/admin/desktop/config.yml | 0 .../static}/admin/desktop/index.html | 0 .../hugo-xmin/static}/admin/index.html | 0 .../hugo-xmin/static}/admin/mobile/config.yml | 0 .../hugo-xmin/static}/admin/mobile/index.html | 0 .../static}/admin/mobile/mobile-overrides.css | 0 themes/hugo-xmin/static/css/fonts.css | 4 +- themes/hugo-xmin/static/js/fuse.min.js | 9 ++ themes/hugo-xmin/static/js/mark.min.js | 7 + themes/hugo-xmin/static/js/search.js | 136 ++++++++++++++++++ 24 files changed, 395 insertions(+), 64 deletions(-) create mode 100644 archetypes/.gitkeep delete mode 100644 archetypes/default.md create mode 100644 static/.gitkeep create mode 100644 themes/hugo-xmin/content/search.md create mode 100644 themes/hugo-xmin/exampleSite/config.toml delete mode 100644 themes/hugo-xmin/exampleSite/config.yaml create mode 100644 themes/hugo-xmin/layouts/_default/index.json create mode 100644 themes/hugo-xmin/layouts/_default/search.html rename {layouts => themes/hugo-xmin/layouts}/robots.txt (100%) rename {static => themes/hugo-xmin/static}/admin/desktop/config.yml (100%) rename {static => themes/hugo-xmin/static}/admin/desktop/index.html (100%) rename {static => themes/hugo-xmin/static}/admin/index.html (100%) rename {static => themes/hugo-xmin/static}/admin/mobile/config.yml (100%) rename {static => themes/hugo-xmin/static}/admin/mobile/index.html (100%) rename {static => themes/hugo-xmin/static}/admin/mobile/mobile-overrides.css (100%) create mode 100644 themes/hugo-xmin/static/js/fuse.min.js create mode 100644 themes/hugo-xmin/static/js/mark.min.js create mode 100644 themes/hugo-xmin/static/js/search.js diff --git a/archetypes/.gitkeep b/archetypes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/archetypes/default.md b/archetypes/default.md deleted file mode 100644 index 00e77bd..0000000 --- a/archetypes/default.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "{{ replace .Name "-" " " | title }}" -date: {{ .Date }} -draft: true ---- - diff --git a/config.toml b/config.toml index 12ebfdd..3a7674c 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,83 @@ -baseURL = 'http://example.org/' +baseURL = '/' +title = 'accessible.tips' + +DefaultContentLanguage = "en" languageCode = 'en-us' -title = 'My New Hugo Site' -enableRobotsTXT = true \ No newline at end of file +timeZone = 'UTC' + +enableEmoji = true +enableRobotsTXT = true +rssLimit = 25 + +ignoreFiles = [ '.gitignore', '.gitkeep' ] + +theme = ['hugo-xmin'] + +footnotereturnlinkcontents = '↩' + +uglyURLs = false +[permalinks] + tips = '/tips/:slug/' + posts = '/posts/:slug/' + tags = '/tags/:title/' + +[sitemap] + changefreq = 'weekly' + filename = 'sitemap.xml' + priority = 0.5 + +[imaging] + [imaging.exif] + disableDate = false + disableLatLong = true + +[markup] + [markup.goldmark] + [markup.goldmark.renderer] + unsafe = true + [markup.highlilght] + codeFences = false + +[outputs] + home = ["HTML", "RSS", "JSON"] + +[params] + description = 'A collection of accessibility tips and tricks' + footer = '© KemoNine {Year}' + +[menu] +[[menu.main]] + identifier = 'home' + name = 'Home' + url = '/' + weight = 10 +[[menu.main]] + identifier = 'posts' + name = 'Blog' + url = '/posts/' + weight = 20 +#[[menu.main]] +# identifier = 'tags' +# name = 'Tags' +# url = '/tags/' +# weight = 30 +[[menu.main]] + identifier = 'categories' + name = 'Categories' + url = '/categories/' + weight = 40 +[[menu.main]] + identifier = 'tips' + name = 'Tips' + url = '/tips/' + weight = 50 +[[menu.main]] + identifier = 'rss' + name = 'RSS' + url = 'index.xml' + weight = 60 +[[menu.main]] + identifier = 'search' + name = 'Search' + url = '/search/' + weight = 70 diff --git a/static/.gitkeep b/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-xmin/archetypes/default.md b/themes/hugo-xmin/archetypes/default.md index fb98e92..a589c6e 100644 --- a/themes/hugo-xmin/archetypes/default.md +++ b/themes/hugo-xmin/archetypes/default.md @@ -1,4 +1,5 @@ ---- -title: '' -date: '' ---- ++++ +toc = true +draft = true ++++ + diff --git a/themes/hugo-xmin/content/search.md b/themes/hugo-xmin/content/search.md new file mode 100644 index 0000000..d5eb02b --- /dev/null +++ b/themes/hugo-xmin/content/search.md @@ -0,0 +1,10 @@ ++++ +title = "Search" +author = ["KemoNine"] +draft = false +layout = "search" +[sitemap] + priority = 0.1 ++++ + +This page was adapted from diff --git a/themes/hugo-xmin/exampleSite/config.toml b/themes/hugo-xmin/exampleSite/config.toml new file mode 100644 index 0000000..a785bab --- /dev/null +++ b/themes/hugo-xmin/exampleSite/config.toml @@ -0,0 +1,83 @@ +baseURL = '/' +title = 'accessible.tips' + +DefaultContentLanguage = "en" +languageCode = 'en-us' +timeZone = 'UTC' + +enableEmoji = true +enableRobotsTXT = true +rssLimit = 25 + +ignoreFiles = [ '.gitignore', '.gitkeep' ] + +theme = ['hugo-xmin'] + +footnotereturnlinkcontents = '↩' + +uglyURLs = false +[permalinks] + tips = '/tips/:slug/' + posts = '/posts/:slug/' + tags = '/tags/:title/' + +[sitemap] + changefreq = 'weekly' + filename = 'sitemap.xml' + priority = 0.5 + +[imaging] + [imaging.exif] + disableDate = false + disableLatLong = true + +[markup] + [markup.goldmark] + [markup.goldmark.renderer] + unsafe = true + [markup.highlilght] + codeFences = false + +[outputs] + home = ["HTML", "RSS", "JSON"] + +[params] + description = 'A collection of accessibility tips and tricks' + footer = '© KemoNine {Year}' + +[menu] +[[menu.main]] + identifier = 'home' + name = 'Home' + url = '/' + weight = 10 +[[menu.main]] + identifier = 'tips' + name = 'Tips' + url = '/tips/' + weight = 20 +[[menu.main]] + identifier = 'posts' + name = 'Posts' + url = '/posts/' + weight = 30 +[[menu.main]] + identifier = 'tags' + name = 'Tags' + url = '/tags/' + weight = 40 +[[menu.main]] + identifier = 'categories' + name = 'Categories' + url = '/categories/' + weight = 50 +[[menu.main]] + identifier = 'rss' + name = 'RSS' + url = 'index.xml' + weight = 60 +[[menu.main]] + identifier = 'search' + name = 'Search' + url = '/search/' + weight = 70 diff --git a/themes/hugo-xmin/exampleSite/config.yaml b/themes/hugo-xmin/exampleSite/config.yaml deleted file mode 100644 index aaec0d1..0000000 --- a/themes/hugo-xmin/exampleSite/config.yaml +++ /dev/null @@ -1,42 +0,0 @@ -baseurl: "/" -languageCode: "en-us" -title: "A minimal Hugo website" -theme: "hugo-xmin" -googleAnalytics: "" -disqusShortname: "" -ignoreFiles: ["\\.Rmd$", "\\.Rmarkdown$", "_cache$"] -footnotereturnlinkcontents: "↩" -paginate: 1 - -permalinks: - note: "/note/:year/:month/:day/:slug/" - post: "/post/:year/:month/:day/:slug/" - -menu: - main: - - name: Home - url: "" - weight: 1 - - name: About - url: "about/" - weight: 2 - - name: Categories - url: "categories/" - weight: 3 - - name: Tags - url: "tags/" - weight: 4 - - name: Subscribe - url: "index.xml" - -params: - description: "A website built through Hugo and blogdown." - footer: "© [Yihui Xie](https://yihui.org) 2017 -- {Year} | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)" - GithubEdit: "https://github.com/yihui/hugo-xmin/edit/feature/github-edit/exampleSite/content/" - -markup: - highlight: - codeFences: false - goldmark: - renderer: - unsafe: true diff --git a/themes/hugo-xmin/layouts/_default/index.json b/themes/hugo-xmin/layouts/_default/index.json new file mode 100644 index 0000000..c93f805 --- /dev/null +++ b/themes/hugo-xmin/layouts/_default/index.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/themes/hugo-xmin/layouts/_default/list.html b/themes/hugo-xmin/layouts/_default/list.html index 9a9ea66..6e341cc 100644 --- a/themes/hugo-xmin/layouts/_default/list.html +++ b/themes/hugo-xmin/layouts/_default/list.html @@ -6,17 +6,27 @@ {{ .Content }} +{{ if not .IsHome }} {{ template "_internal/pagination.html" . }} +{{ end }} {{ partial "footer.html" . }} diff --git a/themes/hugo-xmin/layouts/_default/search.html b/themes/hugo-xmin/layouts/_default/search.html new file mode 100644 index 0000000..deb32ec --- /dev/null +++ b/themes/hugo-xmin/layouts/_default/search.html @@ -0,0 +1,33 @@ +{{ partial "header.html" . }} + +
+
+ + +
+ +
+ +
+
+ + + + + + + +
+ +{{ partial "footer.html" . }} diff --git a/themes/hugo-xmin/layouts/_default/single.html b/themes/hugo-xmin/layouts/_default/single.html index 5c98e62..8139eac 100644 --- a/themes/hugo-xmin/layouts/_default/single.html +++ b/themes/hugo-xmin/layouts/_default/single.html @@ -2,7 +2,8 @@