diff options
author | Urja Acharya <urja.acharya@huskers.unl.edu> | 2021-03-04 05:02:32 +0300 |
---|---|---|
committer | Urja Acharya <urja.acharya@huskers.unl.edu> | 2021-03-04 05:02:32 +0300 |
commit | 23b19f817da907f9c4b3d286b72d8ebd32468194 (patch) | |
tree | 4fdbae9ec919bedfbc03019bfa77aa6322725ce6 /layouts/partials | |
parent | 7993d0b887b93b161e81744f938607d16bdb709d (diff) |
Reorganization and style changes
Diffstat (limited to 'layouts/partials')
-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 |
8 files changed, 127 insertions, 103 deletions
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> |