From 9edacfbc30f318fa8fc6e2a347fc9955bd0eb9be Mon Sep 17 00:00:00 2001 From: Robert Austin Date: Mon, 19 Sep 2022 19:52:42 -0700 Subject: [PATCH] theme updates to pagination, menu and html rendering --- archetypes/default.md | 2 - assets/scss/_pagination.scss | 59 +++++++++++++++---- exampleSite/config.toml | 15 +++++ exampleSite/content/pages/about.md | 2 + exampleSite/content/posts/_index.md | 3 +- .../content/posts/destruction-of-words.md | 9 +-- exampleSite/data/author.json | 2 +- exampleSite/data/social.json | 2 +- layouts/_default/list.html | 4 +- layouts/index.html | 3 +- layouts/partials/header.html | 19 +++--- layouts/posts/list.html | 14 +++++ layouts/posts/single.html | 1 - theme.toml | 2 +- 14 files changed, 101 insertions(+), 36 deletions(-) delete mode 100644 archetypes/default.md create mode 100644 layouts/posts/list.html diff --git a/archetypes/default.md b/archetypes/default.md deleted file mode 100644 index ac36e06..0000000 --- a/archetypes/default.md +++ /dev/null @@ -1,2 +0,0 @@ -+++ -+++ diff --git a/assets/scss/_pagination.scss b/assets/scss/_pagination.scss index daf1339..78dff13 100644 --- a/assets/scss/_pagination.scss +++ b/assets/scss/_pagination.scss @@ -1,25 +1,58 @@ ul.pagination { - margin: 0; - padding: 0; - list-style: none; display: flex; + justify-content: center; + list-style: none; + margin: 20px 0 20px 0; + padding: 0; li { - display: inline-block; - a { - display: inline-block; - text-decoration: none; - padding: 5px 8px; - border: 2px solid var(--heading-color); - border-right: none; + list-style: none; + text-decoration: none; + border: 2px solid var(--highlight-color); + border-right: none; + text-align: center; + vertical-align: middle; + &:hover { + border-color: var(--highlight-color); + background-color: var(--highlight-color); + color: white; + a { + color: white; + } } - &.active { + &.pagination-item-current { + border-color: var(--highlight-color); + background-color: var(--highlight-color); + color: white; a { + color: white; } } + a { + padding: 9px 13px; + display: block; + color: var(--highlight-color); + text-decoration: none; + } &:last-of-type { - a { - border-right: 2px solid var(--heading-color); + border-right: 2px solid var(--highlight-color); + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + &:hover { + border-color: var(--highlight-color); } + &.active { + border-color: var(--highlight-color); + } + } + &:first-of-type { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + } + svg { + width: 8px; + line-height: 10px; + margin-bottom: 2px; + vertical-align: middle; } } } diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 00a9265..def65c7 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -22,3 +22,18 @@ pygmentsUseClasses = true addDot = true addFrame = true highlightColor = '#7b16ff' + +# markdown config settings https://gohugo.io/getting-started/configuration-markup/#goldmark +[markup] + [markup.goldmark] + [markup.goldmark.renderer] + hardWraps = false + unsafe = true + xhtml = false + +[menu] + [[menu.main]] + identifier = 'home' + name = 'Home' + url = '/' + weight = 1 diff --git a/exampleSite/content/pages/about.md b/exampleSite/content/pages/about.md index 2047429..6ebc57b 100644 --- a/exampleSite/content/pages/about.md +++ b/exampleSite/content/pages/about.md @@ -1,9 +1,11 @@ --- title: 'About' image: images/writer.jpeg +url: "about" menu: main: name: "About" + weight: 3 --- ## Contra vagos diff --git a/exampleSite/content/posts/_index.md b/exampleSite/content/posts/_index.md index c2f051d..6636e7c 100644 --- a/exampleSite/content/posts/_index.md +++ b/exampleSite/content/posts/_index.md @@ -3,5 +3,6 @@ title: "Blog" date: 2019-02-24 menu: main: - name: "Posts" + name: "Blog" + weight: 2 --- diff --git a/exampleSite/content/posts/destruction-of-words.md b/exampleSite/content/posts/destruction-of-words.md index c2472b4..a3b2e68 100644 --- a/exampleSite/content/posts/destruction-of-words.md +++ b/exampleSite/content/posts/destruction-of-words.md @@ -5,7 +5,7 @@ description: "As soon as Winston had dealt with each of the messages, he clipped image: images/cctv.jpeg --- -## He moved over to the window +# He moved over to the window Lorem markdownum comes; pro est [modo famulus](#pervenerat), quo quod neu manibus aether his nomine, Aurora, voce. Ipse virga res vidit profanis vocatos, @@ -31,13 +31,13 @@ nitet inplevit. ### Heading 3 -Oriente nec radios nurus, quod undas, occupat conpescit femina est; resistite +Oriente nec radios nurus, quod undas, occupat conpescit femina est 🥷. resistite regno armenta suspirat. Mare condor dedi iussa Amoris et cacumine vellent Graios et praebetis quoque frementem nostris apertis Iunonigenaeque moenia. Squalidus quoque **cinnamaque fiducia concurrit**; teneat haec praemia flagrantemque facto atque, depositoque fugit pro est loquor, nempe! -## Ocior saxa Phoebus placet +#### Heading 4 Enim acclinia opera; _ea gemit_. Cervice sine tibi forma; non inde rubescere usque fixurus Echione, ut. Inter genetrix tergo; semina praestant at **eadem**, @@ -56,8 +56,9 @@ $(window).scroll(function () { }); ``` -## Animi igne +## Heading 2 +Example of using raw HTML to insert a link Saeva gaudia; per est subit Ereboque et altaque repetunt repperit aegida ingenium humumque vitium quoque distantia vidit. Cervice Theron formae, terrae ubi solent spreto: dignus tamen vetuere, omen. Plures victa successor vellet, et diff --git a/exampleSite/data/author.json b/exampleSite/data/author.json index 7a03583..3c554c9 100644 --- a/exampleSite/data/author.json +++ b/exampleSite/data/author.json @@ -1,5 +1,5 @@ { - "name": "Sam Stone", + "name": "Winston Smith", "title": "Writer & Futurist", "image": "images/author.jpg" } \ No newline at end of file diff --git a/exampleSite/data/social.json b/exampleSite/data/social.json index 9b4d3fd..858f55d 100644 --- a/exampleSite/data/social.json +++ b/exampleSite/data/social.json @@ -7,7 +7,7 @@ }, { "name": "github", - "url": "https://github.com/zerostaticthemes", + "url": "https://github.com/zerostaticthemes/hugo-winston-theme", "image": "images/social/github.svg" }, { diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 58c63be..f90e6fd 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -6,9 +6,7 @@

{{ .Title }}{{ if .Site.Params.addDot }}.{{ end }}< {{ if .Params.description }}

{{ .Params.description }}

{{ end }} {{ .Content }} - {{ $paginator := .Paginate (where .Pages "Type" "posts") }} - {{ range $paginator.Pages }} + {{ range .Pages }} {{ .Render "summary" }} {{ end }} - {{ partial "paginator" . }} {{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 29a8e0d..e9a6fcc 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,4 +1,3 @@ -{{ define "header_css" }}{{ end }} {{ define "body_classes" }}page-home{{ end }} {{ define "main" }} @@ -17,7 +16,7 @@

{{ .Title }}{{ if .Site.Params.addDot }}.{{ end }}< {{ range $paginator.Pages }} {{ .Render "summary" }} {{ end }} - {{ template "_internal/pagination.html" . }} + {{ partial "paginator" . }} {{ end }} {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index eea1cf0..ab9e08c 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,13 +1,18 @@
- +
diff --git a/layouts/posts/list.html b/layouts/posts/list.html new file mode 100644 index 0000000..62c1f6e --- /dev/null +++ b/layouts/posts/list.html @@ -0,0 +1,14 @@ +{{ define "body_classes" }}page-blog-list{{ end }} + +{{ define "main" }} +
+

{{ .Title }}{{ if .Site.Params.addDot }}.{{ end }}

+ {{ if .Params.description }}

{{ .Params.description }}

{{ end }} +
+ {{ .Content }} + {{ $paginator := .Paginate (where .Pages "Type" "posts") }} + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ end }} + {{ partial "paginator" . }} +{{ end }} \ No newline at end of file diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 787ee4c..810ae3a 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -1,4 +1,3 @@ -{{ define "header_css" }}{{ end }} {{ define "body_classes" }}page-blog-single{{ end }} {{ define "main" }} diff --git a/theme.toml b/theme.toml index 396a0ef..aba9167 100644 --- a/theme.toml +++ b/theme.toml @@ -6,7 +6,7 @@ description = "Hugo Winston is a bold minimal blogging theme" homepage = "https://github.com/zerostaticthemes/hugo-winston-theme" demosite = "https://hugo-winston.netlify.app" -tags = ["blog", "minimal", "clean", "bootstrap", "zerostatic"] +tags = ["blog", "minimal", "clean", "zerostatic"] features = ["blog"] [author]