diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 4 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 11 | ||||
-rw-r--r-- | layouts/index.html | 31 | ||||
-rw-r--r-- | layouts/partials/footer.html | 26 | ||||
-rw-r--r-- | layouts/partials/header.html | 89 | ||||
-rw-r--r-- | layouts/partials/homeHeader.html | 17 | ||||
-rw-r--r-- | layouts/partials/index/pinnedPost.html | 14 | ||||
-rw-r--r-- | layouts/partials/index/recentPost.html | 9 | ||||
-rw-r--r-- | layouts/partials/regularHeader.html | 27 | ||||
-rw-r--r-- | layouts/partials/share.html | 36 | ||||
-rw-r--r-- | layouts/partials/social.html | 12 | ||||
-rw-r--r-- | layouts/section/archive.html | 2 |
12 files changed, 138 insertions, 140 deletions
diff --git a/layouts/404.html b/layouts/404.html index 5a1c6de..7542398 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,3 +1,3 @@ {{ define "main" }} -<h1>Page not found</h1> -{{ end }}
\ No newline at end of file +<p>The page does not exist. <a href="{{ `/` | relURL }}">Go back to home page</a>.</p> +{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 68fff46..dcf346a 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,11 +2,12 @@ <html lang="{{ .Site.LanguageCode }}"> {{- partial "head.html" . -}} <body> - {{- partial "header.html" . -}} - <main> - {{- block "main" . }} - {{- end }} - </main> + {{ if .IsHome }} + {{ partial "homeHeader" . }} + {{ else }} + {{ partial "regularHeader" . }} + {{ end }} + <main>{{- block "main" . }} {{- end }}</main> {{- partial "footer.html" . -}} </body> </html> diff --git a/layouts/index.html b/layouts/index.html index 6b3157a..7095424 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,33 +1,6 @@ {{ define "main" }} -{{ range ((where .Site.Pages "Params.pinned" true).ByDate.Reverse) | first 1 }} -<h2> - <a href="{{ .Permalink }}">{{ .Title }}</a> -</h2> -<div class="pinned-post home-page-card"> - <p>{{ .Summary | plainify | truncate 250 }}</p> - <div class="home-page-card-links"> - <a href="{{ .Permalink }}"> - Read Pinned Post - </a> - </div> - <div class="home-page-card-links"> - <a href="{{ `pinnedposts` | relURL }}">All Pinned</a> - </div> -</div> -{{ end }} - -<h3>Recent Posts</h3> -<div class="recent-posts home-page-card"> - {{ range ((where .Site.Pages "Kind" "page").ByDate.Reverse) | first 6 }} - {{ partial "listPage" . }} - {{ end }} - <div class="home-page-card-links"> - <a href="{{ `archive` | relURL }}" - >All Posts</a - > - </div> -</div> - +{{ partial "index/pinnedPost" . }} +{{ partial "index/recentPost" . }} <h3>Sections</h3> <div class="site-sections home-page-card"> {{ range .Site.Sections }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 878ec2b..f0c644e 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,39 +1,37 @@ <footer> {{ if eq .Kind "section" }} - <div> - {{ template "_internal/pagination.html" . }} - </div> - {{ end }} {{ if eq .Kind "page" }} + <div>{{ template "_internal/pagination.html" . }}</div> + {{ end }} + {{ if eq .Kind "page" }} <div class="prev-next"> {{- if .PrevInSection }} <a class="active" href="{{ .PrevInSection.Permalink | relURL }}" aria-label="Previous Article" - >Previous</a - > + ><i class="bi bi-arrow-left-circle"></i + ></a> {{- else }} - <div class="disabled">N/A</div> + <div class="disabled"><i class="bi bi-arrow-left-circle"></i></div> {{- end }} - <a href="#" aria-label="navigate to top">Top</a> + <a href="#" aria-label="navigate to top" + ><i class="bi bi-box-arrow-in-up"></i></a> {{- if .NextInSection }} <a class="active" href="{{ .NextInSection.Permalink | relURL }}" aria-label="Next Article" - >Next</a - > + ><i class="bi bi-arrow-right-circle"></i + ></a> {{- else }} - <div class="disabled">N/A</div> + <div class="disabled"><i class="bi bi-arrow-right-circle"></i></div> {{- end }} </div> {{ end }} <div class="footer"> <p> - {{ if .Site.Params.theme.copyrightInFooter }} - © - {{end}} + {{ if .Site.Params.theme.copyrightInFooter }} © {{end}} {{ dateFormat "2006" now }} {{ .Site.Params.author }}. {{ .Site.Params.theme.footerText | markdownify }}. </p> diff --git a/layouts/partials/header.html b/layouts/partials/header.html deleted file mode 100644 index 8d0719b..0000000 --- a/layouts/partials/header.html +++ /dev/null @@ -1,89 +0,0 @@ -{{ if .IsHome }} -<header class="home-page-header"> - <div class="header-image-container"> - <div class="header-image"> - <img - src="{{ .Site.Params.about.profileImage | relURL }}" - alt="profile image of {{ .Site.Params.author }}" - /> - </div> - </div> - <div class="header-info"> - <h1 class="main-title">{{- .Site.Title -}}</h1> - <p class="about-narrative"> - {{ .Site.Params.about.narrative | markdownify }} - </p> - {{ $width := mul (len .Site.Params.social) 2 }} - <div class="social-info" style="width: {{ $width }}em;"> - {{- range $key, $val := .Site.Params.social -}} - <a class="header-icon" href="{{ $val.url }}" aria-label="{{ $key }}" - ><i class="{{ $val.icon }}"></i> - </a> - {{- end -}} - </div> - </div> -</header> -{{ else }} -<header class="regular-page-header"> - <div - style=" - display: flex; - justify-content: space-between; - width: 98%; - margin-bottom: 0.5em; - " - > - <a class="header-icon" href="{{ `/` | relURL }}" aria-label="home page"> - <i class="bi bi-house-door"></i> - </a> - <div - class="share-links" - style=" - display: flex; - margin-left: 1em; - align-items: center; - width: 120px; - justify-content: space-between; - " - > - {{ $url := printf "%s" .URL | absLangURL }} - <a - class="header-icon" - href="mailto:?subject={{ print .Title ` by ` .Site.Params.author }}&body={{ $url }}" - target="_self" - rel="noopener" - aria-label="share by email" - ><i class="bi bi-envelope"></i - ></a> - <a - class="header-icon" - href="https://facebook.com/sharer/sharer.php?u={{ $url }}" - target="_blank" - rel="noopener" - aria-label="share on facebook" - ><i class="bi bi-facebook"></i - ></a> - <a - class="header-icon" - href="https://twitter.com/intent/tweet/?text={{ print .Title ` by ` .Site.Params.author }}&url={{ $url }}" - target="_blank" - rel="noopener" - aria-label="share on twitter" - ><i class="bi bi-twitter"></i - ></a> - </div> - </div> - <div class="page-title-and-info" style="text-align: center"> - <h1 class="page-title"> - {{ if or (eq .Kind "taxonomy") (eq .Kind "term") }}#{{ end }}{{ .Title }} - </h1> - {{ if eq .Kind "page" }} - <p class="document-date"> - {{ dateFormat .Site.Params.theme.dateFormat .Date }} · {{ .Site.Params.author }} - </p> - {{ if .Description }} - <p class="document-description">"{{ .Description }}"</p> - {{ end }} {{ end }} - </div> -</header> -{{ end }} diff --git a/layouts/partials/homeHeader.html b/layouts/partials/homeHeader.html new file mode 100644 index 0000000..a32c792 --- /dev/null +++ b/layouts/partials/homeHeader.html @@ -0,0 +1,17 @@ +<header class="home-page-header"> + <div class="header-image-container"> + <div class="header-image"> + <img + src="{{ .Site.Params.about.profileImage | relURL }}" + alt="profile image of {{ .Site.Params.author }}" + /> + </div> + </div> + <div class="header-info"> + <h1 class="main-title">{{- .Site.Title -}}</h1> + <p class="about-narrative"> + {{ .Site.Params.about.narrative | markdownify }} + </p> + {{ partial "social" . }} + </div> +</header> diff --git a/layouts/partials/index/pinnedPost.html b/layouts/partials/index/pinnedPost.html new file mode 100644 index 0000000..8b29a3d --- /dev/null +++ b/layouts/partials/index/pinnedPost.html @@ -0,0 +1,14 @@ +{{ range ((where .Site.Pages "Params.pinned" true).ByDate.Reverse) | first 1 }} +<h2> + <a href="{{ .Permalink }}">{{ .Title }}</a> +</h2> +<div class="pinned-post home-page-card"> + <p>{{ .Summary | plainify | truncate 250 }}</p> + <div class="home-page-card-links"> + <a href="{{ .Permalink }}"> Read Pinned Post </a> + </div> + <div class="home-page-card-links"> + <a href="{{ `pinnedposts` | relURL }}">All Pinned</a> + </div> +</div> +{{ end }} diff --git a/layouts/partials/index/recentPost.html b/layouts/partials/index/recentPost.html new file mode 100644 index 0000000..7578c0f --- /dev/null +++ b/layouts/partials/index/recentPost.html @@ -0,0 +1,9 @@ +<h3>Recent Posts</h3> +<div class="recent-posts home-page-card"> + {{ range ((where .Site.Pages "Kind" "page").ByDate.Reverse) | first 6 }} + {{ partial "listPage" . }} + {{ end }} + <div class="home-page-card-links"> + <a href="{{ `archive` | relURL }}">All Posts</a> + </div> +</div> diff --git a/layouts/partials/regularHeader.html b/layouts/partials/regularHeader.html new file mode 100644 index 0000000..69470fc --- /dev/null +++ b/layouts/partials/regularHeader.html @@ -0,0 +1,27 @@ +<header class="regular-page-header"> + <div + style=" + display: flex; + justify-content: space-between; + width: 98%; + margin-bottom: 0.5em; + " + > + <a class="header-icon" href="{{ `/` | relURL }}" aria-label="home page"> + <i class="bi bi-house-door"></i> + </a> + {{ partial "share" . }} + </div> + <div class="page-title-and-info" style="text-align: center"> + <h1 class="page-title"> + {{ if or (eq .Kind "taxonomy") (eq .Kind "term") }}#{{ end }}{{ .Title }} + </h1> + {{ if eq .Kind "page" }} + <p class="document-date"> + {{ dateFormat .Site.Params.theme.dateFormat .Date }} · {{ .Params.author }} + </p> + {{ if .Description }} + <p class="document-description">"{{ .Description }}"</p> + {{ end }} {{ end }} + </div> +</header> diff --git a/layouts/partials/share.html b/layouts/partials/share.html new file mode 100644 index 0000000..e7cd823 --- /dev/null +++ b/layouts/partials/share.html @@ -0,0 +1,36 @@ +<div + class="share-links" + style=" + display: flex; + margin-left: 1em; + align-items: center; + width: 120px; + justify-content: space-between; + " +> + {{ $url := printf "%s" .URL | absLangURL }} + <a + class="header-icon" + href="mailto:?subject={{ print .Title ` by ` .Site.Params.author }}&body={{ $url }}" + target="_self" + rel="noopener" + aria-label="share by email" + ><i class="bi bi-envelope"></i + ></a> + <a + class="header-icon" + href="https://facebook.com/sharer/sharer.php?u={{ $url }}" + target="_blank" + rel="noopener" + aria-label="share on facebook" + ><i class="bi bi-facebook"></i + ></a> + <a + class="header-icon" + href="https://twitter.com/intent/tweet/?text={{ print .Title ` by ` .Site.Params.author }}&url={{ $url }}" + target="_blank" + rel="noopener" + aria-label="share on twitter" + ><i class="bi bi-twitter"></i + ></a> +</div> diff --git a/layouts/partials/social.html b/layouts/partials/social.html new file mode 100644 index 0000000..5a1bd37 --- /dev/null +++ b/layouts/partials/social.html @@ -0,0 +1,12 @@ +{{ $width := mul (len .Site.Params.social) 2 }} +<div class="social-info" style="width: {{ $width }}em;"> + {{- range $key, $val := .Site.Params.social -}} {{ if eq $key "email" }} + <a class="header-icon" href="mailto:{{- $val.url }}" aria-label="{{ $key }}" + ><i class="{{ $val.icon }}"></i> + </a> + {{ else }} + <a class="header-icon" href="{{- $val.url }}" aria-label="{{ $key }}" + ><i class="{{ $val.icon }}"></i> + </a> + {{ end }} {{- end -}} +</div> diff --git a/layouts/section/archive.html b/layouts/section/archive.html index 20050ac..3ca7c90 100644 --- a/layouts/section/archive.html +++ b/layouts/section/archive.html @@ -1,5 +1,5 @@ {{ define "main" }} -{{$paginator := .Paginate (where .Site.Pages "Kind" "page").ByDate.Reverse 50 }} +{{$paginator := .Paginate (where .Site.Pages "Kind" "page").ByDate.Reverse 20 }} <div class="archive-table"> {{ range $paginator.Pages }} {{ partial "listPage" . }} |