diff options
author | Óscar Nájera <hi@oscarnajera.com> | 2022-01-01 21:03:20 +0100 |
---|---|---|
committer | Óscar Nájera <hi@oscarnajera.com> | 2022-01-01 21:03:20 +0100 |
commit | 113d4e53416ddf42212da6f217670bdc6f0c9dd8 (patch) | |
tree | 7e9bcd4a2a274e45da5538fe67c525dfb36680de /layouts | |
parent | e34ded01904b07456a48cf28f1a5a2d2d77a0be7 (diff) | |
download | hugo-minimalist-theme-113d4e53416ddf42212da6f217670bdc6f0c9dd8.tar.gz hugo-minimalist-theme-113d4e53416ddf42212da6f217670bdc6f0c9dd8.tar.bz2 hugo-minimalist-theme-113d4e53416ddf42212da6f217670bdc6f0c9dd8.zip |
Import new minimalist design
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 37 | ||||
-rw-r--r-- | layouts/_default/archive.terms.html | 21 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 9 | ||||
-rw-r--r-- | layouts/_default/list.html | 14 | ||||
-rw-r--r-- | layouts/_default/search.html | 30 | ||||
-rw-r--r-- | layouts/_default/single.html | 93 | ||||
-rw-r--r-- | layouts/_default/summary.html | 25 | ||||
-rw-r--r-- | layouts/_default/terms.html | 19 | ||||
-rw-r--r-- | layouts/index.html | 22 | ||||
-rw-r--r-- | layouts/index.json | 7 | ||||
-rw-r--r-- | layouts/partials/author_card.html | 12 | ||||
-rw-r--r-- | layouts/partials/footer.html | 10 | ||||
-rw-r--r-- | layouts/partials/head.html | 57 | ||||
-rw-r--r-- | layouts/partials/header.html | 63 | ||||
-rw-r--r-- | layouts/partials/hero.html | 7 | ||||
-rw-r--r-- | layouts/partials/meta.html | 15 | ||||
-rw-r--r-- | layouts/partials/metadata.html | 24 | ||||
-rw-r--r-- | layouts/partials/open_section.html | 9 | ||||
-rw-r--r-- | layouts/partials/pagination.html | 18 | ||||
-rw-r--r-- | layouts/partials/post.html | 20 | ||||
-rw-r--r-- | layouts/partials/post_pager.html | 10 | ||||
-rw-r--r-- | layouts/section_page/single.html | 8 | ||||
-rw-r--r-- | layouts/taxonomy/terms.html | 35 |
23 files changed, 259 insertions, 306 deletions
diff --git a/layouts/404.html b/layouts/404.html index c2f0c31..eada35e 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,17 +1,28 @@ -{{ define "main" }} -<div id="content" class="bg-near-white pb2 pt5"> - <header class="tc ph5 lh-copy"> - <h1 class="f1 f-headline-l code dib orange">404</h1> - <h2 class="tc f1-l fw1">Sorry, we can't find the page you are looking for.</h2> - </header> +{{ define "main"}} +<div class="mw7 center"> - <p class="fw1 i tc mt4 mt5-l f4 f3-l">Are you looking for one of these?</p> + <h1> Page not found</h1> + + {{/* Suggest recently published pages to the user. */}} + + <p>Perhaps you were looking for one of these?</p> + + {{ $query := where (where (where (where site.RegularPages.ByDate.Reverse "Title" "!=" "") "Kind" "in" (slice "page" "section")) "Params.private" "!=" true) "Permalink" "!=" "" }} + {{ $count := len $query }} + {{ if gt $count 0 }} + <h2>{{ i18n "user_profile_latest" }}</h2> + <ul class="list pl0 ba br2"> + {{ range first 10 $query }} + <li class="bb pa3 w3-hover-theme"> + <a href="{{ .RelPermalink }}" class="link near-white"> + <h4>{{ .Title }}</h4> + {{ .Summary }}</a> + {{ partial "metadata.html" . }} + </li> + {{ end }} + </ul> + {{ end }} - <div class="db tc ma3 f6"> - {{ range .Site.Menus.main }} - <a class="dib link dim ph3 pv2 ba br1 ttu f5 ma1" href="{{ .URL | relLangURL }}" title="{{ .Title }}"> - {{ .Pre }} {{ .Name }}</a> - {{ end }} - </div> </div> + {{ end }} diff --git a/layouts/_default/archive.terms.html b/layouts/_default/archive.terms.html deleted file mode 100644 index 7b5a540..0000000 --- a/layouts/_default/archive.terms.html +++ /dev/null @@ -1,21 +0,0 @@ -{{ define "main" }} -<div id="content" class="bg-near-white pa2 pt5"> - {{ range (where .Site.RegularPages "Section" "post").GroupByDate "2006" }} - <section class="f4 bb b--black-40 mw7 center"> - <h4 class="">{{ .Key }}</h4> - - {{ range .Pages.GroupByDate "January" }} - <ul class="list mv1"> - <li class="b">{{ .Key }}</li> - - <ul class="pv2"> - {{ range .Pages }} - <li class="black-50"><a href="{{ .Permalink }}" class="f4 dark-gray underline-hover">{{.Title}}</a> - {{ .Date.Format "Jan 2" }}</li> - {{ end}} - </ul> - </ul> - {{ end}} - </section> - {{ end }} -</div> -{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index f5fb3d8..20e0c0c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,16 +1,11 @@ <!DOCTYPE html> <html> {{- partial "head.html" . -}} - <body class="bg-near-white sans-serif" - style="background:url('{{ .Site.Params.coverImage | absURL }}') fixed;"> + <body class="w3-theme-dark"> {{- partial "header.html" . -}} - - <div id="content" class="fl w-75-ns bg-black-10"> + <div id="content" class="min-vh-100"> {{- block "main" . }}{{- end }} </div> - {{- partial "footer.html" . -}} - - {{- block "footerfiles" . }}{{- end }} </body> </html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c9839f8..a1f0f08 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,8 +1,10 @@ {{ define "main" }} -<section class="bg-near-white pb2 pt4"> - {{ range .Paginator.Pages }} - {{ .Render "summary" }} - {{ end }} - {{ partial "pagination.html" . }} -</section> +{{ partial "open_section.html" . }} + +{{ range .Paginator.Pages.ByPublishDate.Reverse }} +<div class="stripe-dark"> + {{ partial "post.html" . }} +</div> +{{ end }} +{{ partial "pagination.html" . }} {{ end }} diff --git a/layouts/_default/search.html b/layouts/_default/search.html deleted file mode 100644 index 4bf77f2..0000000 --- a/layouts/_default/search.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ define "footerfiles" }} -<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> -<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.2.1/fuse.min.js"></script> -<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js"></script> -<script src="{{ "js/search.js" | absURL }}"></script> -{{ end }} - -{{ define "main" }} -<section class="bg-near-white pt5"> - <div class="mw7 center pv4" > - <form action="{{ .Permalink }}"> - <input id="search-query" name="s"/> - </form> - <div id="search-results"> - <h3>Matching pages</h3> - </div> - </div> -</section> -<!-- this template is sucked in by search.js and appended to the search-results div above. So editing here will adjust style --> -<script id="search-result-template" type="text/x-js-template"> - <div id="summary-${key}" class="bt bb b--black-10 ph4"> - <h4><a href="${link}">${title}</a></h4> - <p>${snippet}…</p> - - - ${ isset tags }<p><i class="fa fa-tags"></i> Tags: ${tags}</p>${ end } - ${ isset categories }<p><i class="fa fa-bookmark"></i> Categories: ${categories}</p>${ end } - </div> -</script> -{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6007308..3d75915 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,71 +1,42 @@ {{ define "main" }} -<article> - <div id="post-header-cover" class="bg-center cover bg-black-30" - {{ with .Params.cover }} - style="background-image:url({{ . }})" - {{ end }} > - <header class="dt pa2 mw6 center post-header white"> - <h1 class="f1 lh-title"> - {{ .Title }}</h1> - - {{ if not (eq .Params.showMeta false) }} - <div class="f4 tracked mb3">{{ .Date.Format "Mon, Jan 2, 2006" }}</div> - {{ partial "meta.html" . }} +<article class="mw7 center ph2"> + <header> + <h2 class="baskerville f2 lh-title mv3"> + {{ .Title }} + </h2> + + {{ with .Params.subtitle }} + <h3 class="f3 baskerville mv3">{{ . }}</h3> + {{end}} + + {{ if isset .Params "image" }} + {{ $image := resources.Get .Params.image }} + {{ $image := $image.Fill (default "400x400" .Params.image_size) }} + <div class="relative"> + <img src="{{ $image.RelPermalink }}" class="db center" alt= "{{ .Title }}"> + {{ with .Params.caption }} + <a href="{{ .url }}" class="link near-white absolute bottom-0 right-0 pa2 bg-black-30 br2"> + {{ .text }} + </a> {{ end }} - </header> - </div> - - <div id="content" class="bg-near-white"> - <div class="mw7 center lh-copy pv4 ph2 black-70"> - {{ .Content }} </div> + {{end}} - <footer class="mw7 center ph3 pb2 bt bb cf b--black-50"> - {{ with .Params.tags }} - <div class="fl-ns w-50-ns mb2"> - - <h5 class="f5 ttu black-60"><i class="fa fa-lg fa-tags"></i> Tagged in</h5> - {{ range . }} - <a class="f5 link br1 ph3 pv2 blue dib hover-bg-light-blue hover-white ba" - href="{{ $.Site.LanguagePrefix }}/tags/{{ . | urlize }}/">{{ . }}</a> - {{ end }} - </div> - {{ end }} - - <div class="fl-ns w-50-ns mb2"> - <h5 class="f5 ttu black-60"><i class="fa fa-lg fa-share-alt"></i> Share in Social Networks</h5> - {{ range .Site.Params.sharingOptions }} - <a class="f4 link br1 ph3 pv2 blue dib hover-bg-light-blue hover-white ba" target="new" href="{{ printf .url $.Permalink }}"> - <i class="fa {{ .icon }}"></i> - </a> - {{ end }} - </div> - </footer> + {{ if isset .Params "metadata" }} + {{ partial "metadata.html" . }} + {{ end }} - <!-- Pagination Actions for posts --> - {{ if not (eq .Params.showActions false) }} - <div class="mv3 tc"> - {{ with .NextInSection }} - <a href="{{ .RelPermalink }}" class="dib f4 link br1 ma1 pa2 blue hover-bg-light-blue hover-white ba"> - <i class="fa fa-angle-left"></i> Newer <br/> - {{ .Title }} - </a> - {{ end}} - {{ with .PrevInSection }} - <a href="{{ .RelPermalink }}" class="dib f4 link br1 ma1 pa2 blue hover-bg-light-blue hover-white ba"> - Older <i class="fa fa-angle-right"></i> <br/> - {{ .Title }} - </a> - {{ end}} - </div> - {{ end}} + </header> - {{ if not (eq .Params.comments false) }} - <div class="mw7 center mv4 pa2"> - {{ template "_internal/disqus.html" . }} - </div> - {{ end }} + <div class="main-content sans-serif f5 f4-ns lh-copy baskerville"> +{{ .Content }} </div> </article> +<div class="sans-serif f5 f4-ns lh-copy pv2"> +{{ if isset .Params "metadata" }} +{{ partial "author_card" . }} +{{ end }} +{{ partial "post_pager" . }} +</div> {{ end }} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html deleted file mode 100644 index 20c8d9c..0000000 --- a/layouts/_default/summary.html +++ /dev/null @@ -1,25 +0,0 @@ -<article class="ba br2 b--black-10 mw7 mh3-ns mv3 bg-near-white"> - <a href='{{ .Permalink }}' class="db pa4-ns pa2 black no-underline dim "> - <header> - <h1 class="f2 lh-title black-90"> - {{ .Title }} - </h1> - <div class="gray">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words - {{ .ReadingTime }} min read</div> - </header> - <p class="f4 lh-copy black-80"> - {{ .Summary }} - </p> - <footer> - - <nobr class="link">Continue reading →</nobr> - {{ with .Params.thumbnailImage }} - <img src="{{ . }}" class="mt2 br2 grow"> - {{ else }} - {{ if .Params.cover }} - <img src="{{ .Params.cover }}" class="mt2 br2 grow" /> - {{ end}} - {{ end }} - - </footer> - </a> -</article> diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html deleted file mode 100644 index 42d5541..0000000 --- a/layouts/_default/terms.html +++ /dev/null @@ -1,19 +0,0 @@ -{{ define "main" }} -<div id="content" class="bg-near-white pa2 pt5"> - <section class="mw7 center"> - {{ range .Data.Terms.ByCount }} - <h4 class="f4"> - <a href="{{ .Name }}" class="dark-gray underline-hover"> - {{ .Name }} ({{ .Pages | len }}) - </a> - </h4> - - <ul class="bb b--black-50 pb2"> - {{ range .Pages.ByDate.Reverse }} - <li class="black-50"><a href="{{ .Permalink }}" class="f4 dark-gray underline-hover">{{.Title}}</a> - {{ .Date.Format "Jan 2, 2006" }}</li> - {{ end}} - </ul> - {{ end }} - </section> -</div> -{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 9b143c0..b256f80 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,8 +1,20 @@ {{ define "main" }} - <!-- Note that .Data.Pages is the equivalent of .Site.Pages on the homepage template. --> - {{ $paginator := .Paginate (where .Data.Pages "Section" "post") }} - {{ range $paginator.Pages }} - {{ .Render "summary" }} +{{ partial "hero.html" . }} + +<!-- Page Content --> +{{ range $index, $element := where .Pages "Type" "in" .Site.Params.mainSections }} +{{ partial "open_section.html" . }} + + {{ range first .Params.index_show .Pages.ByPublishDate.Reverse }} + <div class="stripe-dark"> + {{ partial "post.html" . }} + </div> {{ end }} - {{ partial "pagination.html" . }} + + <div class="tc pa3"> + <i class="fas fa-angle-right"></i> + <a href="{{ .Type }}" class="f3 link near-white">See all</a> + </div> + </div> +{{ end }} {{ end }} diff --git a/layouts/index.json b/layouts/index.json deleted file mode 100644 index b8559e7..0000000 --- a/layouts/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{{- $.Scratch.Add "index" slice -}} -{{- range .Site.RegularPages -}} -{{- if ne .Params.noindex true -}} - {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}} -{{- end -}} -{{- end -}} -{{- $.Scratch.Get "index" | jsonify -}} diff --git a/layouts/partials/author_card.html b/layouts/partials/author_card.html new file mode 100644 index 0000000..33c86b8 --- /dev/null +++ b/layouts/partials/author_card.html @@ -0,0 +1,12 @@ +<div class="mw7 center ph3 flex flex-column flex-row-ns"> + <div class="w-10-ns"> + <img src="{{ .Site.Params.Owner_avatar }}" class="br-100"> + </div> + <div class="w-90-ns ph3-ns"> + <h5 class="f3 mv1 berkshire-swash">{{ .Site.Params.Owner }}</h5> + <h6 class="f4 fw4 light-gray pa0 ma0">{{ .Site.Params.Role }}</h6> + <p class="f5 lh-copy"> + {{ .Site.Params.bio }} + </p> + </div> +</div> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index d437bde..a9e1474 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,5 +1,7 @@ -<footer id="footer" class="fl center pa2 bg-white-40"> - <span class="db tc black-80"> - © {{ now.Format "2006" }} {{ with .Site.Params.footer.copyright }}{{ . | safeHTML }}{{ else }}{{ with .Site.Author.name }}{{ . }}{{ else }}{{ with .Site.Title }}{{ . }}{{ end }}{{ end }}{{ end }}. All Rights Reserved - </span> +<footer class="bg-black"> + <div class="w-100 ph3 pv3 tc"> + {{ with .Site.GetPage "footer.md" }} + {{ .Content }} + {{ end }} + </div> </footer> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index adaa5ab..48eaddd 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,45 +1,12 @@ -<meta name="viewport" content="width=device-width, initial-scale=1"> -<meta charset="UTF-8"> -<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/> -<!-- FontAwesome --> -<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> - -<!-- CustomCSS --> - {{ range .Site.Params.customCSS }} - {{ if isset . "href" }} - <link {{ if not (isset . "rel") }}rel="stylesheet" {{ end }}{{ range $key, $value := . }} {{ if eq $key "href" }}{{ (printf "%s=\"%s\"" $key ($value | absURL)) | safeHTMLAttr }}{{ else }}{{ (printf "%s=\"%s\"" $key (string $value)) | safeHTMLAttr }}{{ end }}{{ end }}> - {{ else }} - <link rel="stylesheet" href="{{ . | absURL }}"> - {{ end }} - {{ end }} - -<!-- Highligth.js --> -<link rel="stylesheet" - href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/zenburn.min.css"> -<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> -<script>hljs.initHighlightingOnLoad();</script> - -<!-- Mathjax --> -<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML' async></script> - -<!-- CSS --> -<style> - a { - text-decoration: none; - color: #357edd; - } - - #sidebar { - text-shadow: 1px 1px 1px #111; - } - - .post-header { - text-shadow: 1px 2px 1px rgba(0,0,0,0.9); - } - - pre { - background: #3f3f3f; - color: #dcdcdc; - padding: 0.5em;} - -</style> +<head> + <meta charset="utf-8"> + <link rel="icon" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + {{ $styles := resources.Get "scss/style.scss" | resources.ToCSS | resources.Minify }} + <link rel="stylesheet" href="{{ $styles.Permalink }}" type="text/css" media="screen" /> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" /> + {{ $title := print .Site.Title " | " .Title }} + {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} + <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script> + <title>{{ $title }}</title> +</head> diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 9b2aaab..ef345ca 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,44 +1,27 @@ -{{ if .Site.Author.gravataremail }} - {{ .Scratch.Set "authorPicture" (printf "//www.gravatar.com/avatar/%s" (urlize (md5 (.Site.Author.gravataremail )))) }} -{{ else if .Site.Author.picture }} - {{ .Scratch.Set "authorPicture" (absURL .Site.Author.picture) }} -{{ end }} +<nav class="header w-100 w3-theme-d3 w3-theme-border z-2 cf"> + <a href="{{ site.BaseURL }}" class="pl5 db fl link"> -<nav id="sidebar" class="fl w-25-ns bg-gray vh-100-ns"> - <div class="tc pv4"> - <a href="/#about" class="white link"> - {{ with ($.Scratch.Get "authorPicture") }} - <img class="br-100" src="{{ . }}{{ if in . "//www.gravatar.com/avatar/" }}?s=110{{ end }}"/> - {{ end }} - <h3 class="f3"> - {{ .Site.Author.name }} - </h3> - </a> - </div> - <ul class="list bd ba"> - {{ range .Site.Menus.main }} - <li class="ma2 dib"> - <a class="link white db grow" href="{{ .URL | relLangURL }}" title="{{ .Title }}"> - {{ .Pre }} {{ .Name }}</a> - </li> - {{ end }} - </ul> - <ul class="list"> - {{ range .Site.Menus.links }} - <li class="pv2"> - <a class="link white db grow" href="{{ .URL | relLangURL }}" title="{{ .Title }}"> - {{ .Pre }} {{ .Name }}</a> - </li> - {{ end }} - </ul> + {{ with resources.Get .Site.Params.logo }} + <img height="{{ site.Params.logo_height }}" class="v-btm" src="{{ .Permalink }}" alt="{{ site.Title }}"> + {{ end }} + + <span class="near-white pl2 pt0 f2 berkshire-swash"> + {{ .Site.Title }} + </span> - <ul class="list"> - {{ range .Site.Menus.misc }} - <li class="pv2"> - <a class="link white db grow" href="{{ .URL | relLangURL }}" title="{{ .Title }}"> - {{ .Pre }} {{ .Name }}</a> - </li> - {{ end }} - </ul> + </a> + <input class="menu-btn dn" type="checkbox" id= "menu-btn"> + <label class="fr dn-ns ma2 pa3 menu-icon" for="menu-btn"> + <span class="navicon bg-near-white"></span> + </label> + <ul class="ma0 pa0 list overflow-hidden br w3-theme-border"> + {{ range .Site.Menus.main }} + <li class="fl-ns bl bb br2 w3-hover-theme w3-theme-border "> + <a class="db f6 pa3 link near-white grow" + href="{{ .URL }}">{{$text := print .Name | safeHTML }} {{ $text }} + </a> + </li> + {{ end }} + </ul> </nav> diff --git a/layouts/partials/hero.html b/layouts/partials/hero.html new file mode 100644 index 0000000..7345fe9 --- /dev/null +++ b/layouts/partials/hero.html @@ -0,0 +1,7 @@ +<div style="background: linear-gradient( rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.5) ), url('{{ .Params.image }}'); background-position: center;" + class="bg-center pv5" > + <div class="mw7 center ph2"> + <h1 class="f1 tc title berkshire-swash">{{ .Title }}</h1> + {{ .Content }} + </div> +</div> diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html deleted file mode 100644 index 84e76e5..0000000 --- a/layouts/partials/meta.html +++ /dev/null @@ -1,15 +0,0 @@ -{{ with .Params.categories }} -<i class="fa fa-lg fa-bookmark"></i> -{{ range . }} -<a class="link underline-hover white mr3" - href="{{ $.Site.LanguagePrefix }}/categories/{{ . | urlize }}/">{{ . }}</a> -{{ end }} -{{ end }} - -{{ with .Params.tags }} -<i class="fa fa-lg fa-tags"></i> -{{ range . }} -<a class="link underline-hover white" - href="{{ $.Site.LanguagePrefix }}/tags/{{ . | urlize }}/">{{ . }}</a> -{{ end }} -{{ end }} diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html new file mode 100644 index 0000000..77373f9 --- /dev/null +++ b/layouts/partials/metadata.html @@ -0,0 +1,24 @@ +{{ $dateTime := .PublishDate.Format "2006-01-02" }} +{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} + +<p class="f6 lh-copy mv0 ph4 pv2">By {{ range .Params.authors }} {{ . }} {{ end }} +<br/> +<i class="far fa-calendar"></i> +<time class="f6 lh-copy mv0" datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time> +| +{{ .ReadingTime }} mins read +{{ with .Params.tags }} +| <i class="fas fa-tags"></i> + {{ range . }} + {{ $href := print (absURL "tags/") (urlize .) }} + <a class="link underline light-gray" href="{{ $href }}">{{ . }}</a> + {{ end }} +{{ end }} +{{ with .Params.categories }} +| <i class="fas fa-bookmark"></i> + {{ range . }} + {{ $href := print (absURL "tags/") (urlize .) }} + <a class="link underline light-gray" href="{{ $href }}">{{ . }}</a> + {{ end }} +{{ end }} +</p> diff --git a/layouts/partials/open_section.html b/layouts/partials/open_section.html new file mode 100644 index 0000000..f58cdf9 --- /dev/null +++ b/layouts/partials/open_section.html @@ -0,0 +1,9 @@ +<div class="stripe-dark"> + <div class="mw7 center pa2"> + <h2 class="baskerville f2 lh-title">{{ .Title }}</h2> + + <div class="main-content lh-copy"> + {{ .Content }} + </div> + </div> +</div> diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 16ad74e..3aa16f7 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -1,15 +1,17 @@ {{ $pag := $.Paginator }} {{ if gt $pag.TotalPages 1 }} -<div class="center db tc ma4 f6"> +<nav class="flex items-center justify-center pa4 f5"> {{ if $pag.HasPrev }} - <a href="{{ $pag.Prev.URL }}" aria-label="Previous" class="dib link dim ph3 pv2 ba br1 ttu">Newer Posts</a> + <a href="{{ $pag.Prev.URL }}" rel="prev" class="near-white link grow hover-bg-light-gray hover-near-black pa2 ba">« {{ T "Prev" }}</a> {{ end }} - {{ range $pag.Pagers }} - <a href="{{ .URL }}" class="dib link dim ph3 pv2 b ba br1 {{ if eq . $pag }}bg-blue white{{ end }}">{{ .PageNumber }}</a> + {{ if eq . $pag }} + <span class= "white w3-theme ma1 pa2 ba"> {{ $pag.PageNumber }}</span> + {{ else }} + <a href="{{ .URL }}" class="db near-white link grow hover-bg-light-gray hover-near-black pa2 ba">{{ .PageNumber }}</a> {{ end }} -{{ if $pag.HasNext }} - <a href="{{ $pag.Next.URL }}" aria-label="Next" class="dib link dim ph3 pv2 ba br1 ttu">Older posts</a> -{{ end }} -</div> + {{ end }} + {{ if $pag.HasNext }} + <a href="{{ $pag.Next.URL }}" rel="next" class="near-white link grow hover-bg-light-gray hover-near-black pa2 ba">{{ T "Next" }} »</a> {{ end }} +</nav> {{ end }} diff --git a/layouts/partials/post.html b/layouts/partials/post.html new file mode 100644 index 0000000..8eaadee --- /dev/null +++ b/layouts/partials/post.html @@ -0,0 +1,20 @@ +<article class="mw7 center pv4 ph3"> +<a class="db no-underline grow" href= "{{ .RelPermalink }}"> + <h3 class="f3 baskerville mt0 lh-title near-white">{{.Title }}</h3> + <div class="cf"> + {{ if isset .Params "image" }} + {{ $image := resources.Get .Params.image }} + {{ $image := $image.Resize (default "320x" .Params.thumbnail_size) }} + <div class="fl-ns mb4 mb0-ns pr3-ns"> + <img src="{{ $image.RelPermalink }}" class="db center"> + </div> + {{ end }} + <div class="f5 lh-copy near-white"> + {{ .Summary }} + </div> + </div> +</a> +{{ if isset .Params "metadata" }} +{{ partial "metadata.html" . }} +{{ end }} +</article> diff --git a/layouts/partials/post_pager.html b/layouts/partials/post_pager.html new file mode 100644 index 0000000..6fe00aa --- /dev/null +++ b/layouts/partials/post_pager.html @@ -0,0 +1,10 @@ +<nav class="flex items-center justify-center pa4 f5"> +{{ with .NextInSection }} + <a href="{{ .RelPermalink }}" rel="prev" class="near-white link bg-animate hover-bg-light-gray hover-near-black pa2 ba ma2"> + « {{ .Title }}</a> +{{ end }} +{{ with .PrevInSection }} + <a href="{{ .RelPermalink }}" rel="prev" class="near-white link bg-animate hover-bg-light-gray hover-near-black pa2 ba ma2"> + {{ .Title }} »</a> +{{ end }} +</nav> diff --git a/layouts/section_page/single.html b/layouts/section_page/single.html new file mode 100644 index 0000000..1f550d3 --- /dev/null +++ b/layouts/section_page/single.html @@ -0,0 +1,8 @@ +{{ define "main" }} +{{ partial "hero.html" . }} + +{{ range .Resources.ByType "page" }} +{{ partial "open_section.html" . }} +{{ end }} + +{{ end }} diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html new file mode 100644 index 0000000..babfd87 --- /dev/null +++ b/layouts/taxonomy/terms.html @@ -0,0 +1,35 @@ +{{ define "main" }} +<section class="mw7 center"> + <h2 class="baskerville f2 fw1 ph3 ph0-l near-white lh-title">{{ .Title }}</h2> + <section class=""> + {{ range .Data.Terms.ByCount }} + <a class="dib near-white link grow hover-bg-white-80 hover-near-black pa2 ba ma1 br2" href="#{{ .Name | urlize }}-list" data-tag="{{ .Name | lower }}"> + {{ .Name }} + </a> + {{ end }} + </section> + + <!-- EACH tag post --> + <section class=""> + {{ range .Data.Terms.ByCount }} + <div id="{{ .Name | urlize }}-list" class="pa1 pa2-ns bb" data-tag="{{ .Name | lower }}"> + <h4 class="f4 bold center lh-title"> + <a class="link dim near-white" href="{{ .Name | urlize }}"> + {{ .Name }} ({{ .Pages | len }}) + </a> + </h4> + <ul class="list ml0"> + {{ range .Pages.ByDate }} + <li class="pv1 fa-check fas"> + <a class="link dim near-white lh-copy" href="{{ .Permalink }}"> + {{ .Title }} + </a> + <span class="white-60"> - {{ .Date | time.Format ":date_long" }}</span> + </li> + {{ end }} + </ul> + </div> + {{ end }} + </section> +</section> +{{ end }} |