Skip to content

Commit

Permalink
theme updates to pagination, menu and html rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
JugglerX committed Sep 20, 2022
1 parent 83eb066 commit 9edacfb
Show file tree
Hide file tree
Showing 14 changed files with 101 additions and 36 deletions.
2 changes: 0 additions & 2 deletions archetypes/default.md

This file was deleted.

59 changes: 46 additions & 13 deletions assets/scss/_pagination.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
15 changes: 15 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions exampleSite/content/pages/about.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
title: 'About'
image: images/writer.jpeg
url: "about"
menu:
main:
name: "About"
weight: 3
---

## Contra vagos
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/content/posts/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ title: "Blog"
date: 2019-02-24
menu:
main:
name: "Posts"
name: "Blog"
weight: 2
---
9 changes: 5 additions & 4 deletions exampleSite/content/posts/destruction-of-words.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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**,
Expand All @@ -56,8 +56,9 @@ $(window).scroll(function () {
});
```

## Animi igne
## Heading 2

<strong>Example of using raw HTML</strong> to insert a <a href="https://www.zerostatic.io" target="_blank">link</a>
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
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/data/author.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Sam Stone",
"name": "Winston Smith",
"title": "Writer & Futurist",
"image": "images/author.jpg"
}
2 changes: 1 addition & 1 deletion exampleSite/data/social.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
{
"name": "github",
"url": "https://github.com/zerostaticthemes",
"url": "https://github.com/zerostaticthemes/hugo-winston-theme",
"image": "images/social/github.svg"
},
{
Expand Down
4 changes: 1 addition & 3 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ <h1>{{ .Title }}{{ if .Site.Params.addDot }}<span class="dot">.</span>{{ end }}<
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
</div>
{{ .Content }}
{{ $paginator := .Paginate (where .Pages "Type" "posts") }}
{{ range $paginator.Pages }}
{{ range .Pages }}
{{ .Render "summary" }}
{{ end }}
{{ partial "paginator" . }}
{{ end }}
3 changes: 1 addition & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{ define "header_css" }}{{ end }}
{{ define "body_classes" }}page-home{{ end }}

{{ define "main" }}
Expand All @@ -17,7 +16,7 @@ <h1>{{ .Title }}{{ if .Site.Params.addDot }}<span class="dot">.</span>{{ end }}<
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ end }}
{{ template "_internal/pagination.html" . }}
{{ partial "paginator" . }}
{{ end }}

{{ end }}
Expand Down
19 changes: 12 additions & 7 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<div class='header'>
<a class="header-logo" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
<a class="header-logo" href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a>
<div class="menu-main">
<ul>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li class="menu-item-{{ .Name | lower }}{{ if $currentPage.IsMenuCurrent "main" . }} active{{ end }}">
<a href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{end}}
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ $active := or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
{{ $active = or $active (eq (.URL | relLangURL) ($currentPage.RelPermalink | relLangURL)) }}
<li class="menu-item-{{ .Name | lower }} {{ if $active }}active{{ end }}">
<a href="{{.URL}}">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
{{end}}
</ul>
</div>
<div id="toggle-menu-main-mobile" class="hamburger-trigger">
Expand Down
14 changes: 14 additions & 0 deletions layouts/posts/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ define "body_classes" }}page-blog-list{{ end }}

{{ define "main" }}
<div class="intro">
<h1>{{ .Title }}{{ if .Site.Params.addDot }}<span class="dot">.</span>{{ end }}</h1>
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
</div>
{{ .Content }}
{{ $paginator := .Paginate (where .Pages "Type" "posts") }}
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ end }}
{{ partial "paginator" . }}
{{ end }}
1 change: 0 additions & 1 deletion layouts/posts/single.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{ define "header_css" }}{{ end }}
{{ define "body_classes" }}page-blog-single{{ end }}

{{ define "main" }}
Expand Down
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9edacfb

Please sign in to comment.