diff options
| author | Reorx <novoreorx@gmail.com> | 2022-09-07 16:20:55 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-09-07 16:20:55 +0800 |
| commit | ceede2988aa86ad19a2ff84bb3eb76b91b8dd4da (patch) | |
| tree | be07df163b941520c64284aeefd1606c4c55532f /layouts | |
| parent | ea271b565162f9a4144b97c23dbce3135403e094 (diff) | |
move .first-entry css to main.css, styling newsletter section
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/archives.html | 2 | ||||
| -rw-r--r-- | layouts/newsletter/section.html | 106 |
2 files changed, 57 insertions, 51 deletions
diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index c2e7aed..285b592 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -1,7 +1,7 @@ {{- define "main" }} <header class="page-header"> - <h1>{{ .Title }} !</h1> + <h1>{{ .Title }}</h1> {{- if .Description }} <div class="post-description"> {{ .Description }} diff --git a/layouts/newsletter/section.html b/layouts/newsletter/section.html index e64f285..47901f3 100644 --- a/layouts/newsletter/section.html +++ b/layouts/newsletter/section.html @@ -3,64 +3,70 @@ {{- define "main" }} <div class="main-icon">@</div> -<header class="page-header"> - <h1>{{ .Title }}</h1> - {{- with .Param "archivesSlug" }} - <div> - <a href="{{ $.RelPermalink }}{{ . }}/">Archives</a> +<div class="content"> + <div class="first-entry"> + <header class="entry-header"> + <h1>{{ .Title }}</h1> + </header> + <section class="entry-content">{{ .Description | markdownify }}</section> </div> - {{- end }} -</header> -{{- $pages := where .Pages "Params.hidden" "!=" true }} + {{- $pages := where .Pages "Params.hidden" "!=" true }} -{{/* related issue: https://github.com/gohugoio/hugo/issues/9003 */}} -{{ $paginator := "" }} -{{ if (.Param "paginate") }} - {{- $paginator = .Paginate $pages (.Param "paginate") }} -{{ else }} - {{- $paginator = .Paginate $pages }} -{{ end }} + {{/* related issue: https://github.com/gohugoio/hugo/issues/9003 */}} + {{ $paginator := "" }} + {{ if (.Param "paginate") }} + {{- $paginator = .Paginate $pages (.Param "paginate") }} + {{ else }} + {{- $paginator = .Paginate $pages }} + {{ end }} -{{- range $index, $page := $paginator.Pages }} -<article class="post-entry"> - <header class="entry-header"> - <h2> - {{- .Title }} - {{- if .Draft }}<sup><span class="entry-isdraft"> [Draft]</span></sup>{{- end }} - {{- if .Weight }}<sup><span class="entry-isdraft"> [Pinned]</span></sup>{{- end }} - </h2> - </header> - {{- if (ne (.Param "hideSummary") true) }} - <section class="entry-content"> - {{ if .Description }} - <p>{{ .Description | plainify | htmlUnescape }}</p> - {{ else }} - <p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p> - {{ end }} - </section> + {{- range $index, $page := $paginator.Pages }} + <article class="post-entry"> + <header class="entry-header"> + <h2> + {{- .Title }} + {{- if .Draft }}<sup><span class="entry-isdraft"> [Draft]</span></sup>{{- end }} + {{- if .Weight }}<sup><span class="entry-isdraft"> [Pinned]</span></sup>{{- end }} + </h2> + </header> + {{- if (ne (.Param "hideSummary") true) }} + <section class="entry-content"> + {{ if .Description }} + <p>{{ .Description | plainify | htmlUnescape }}</p> + {{ else }} + <p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p> + {{ end }} + </section> + {{- end }} + {{- if not (.Param "hideMeta") }} + <footer class="entry-footer"> + {{- partial "post_meta.html" . -}} + </footer> + {{- end }} + <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> + </article> {{- end }} - {{- if not (.Param "hideMeta") }} - <footer class="entry-footer"> - {{- partial "post_meta.html" . -}} + + {{- if gt $paginator.TotalPages 1 }} + <footer class="page-footer"> + <nav class="pagination"> + {{- if $paginator.HasPrev }} + <a class="prev" href="{{ $paginator.Prev.URL | absURL }}">« {{ i18n "prev_page" }}</a> + {{- end }} + {{- if $paginator.HasNext }} + <a class="next" href="{{ $paginator.Next.URL | absURL }}">{{ i18n "next_page" }} »</a> + {{- end }} + </nav> </footer> {{- end }} - <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> -</article> -{{- end }} -{{- if gt $paginator.TotalPages 1 }} -<footer class="page-footer"> - <nav class="pagination"> - {{- if $paginator.HasPrev }} - <a class="prev" href="{{ $paginator.Prev.URL | absURL }}">« {{ i18n "prev_page" }}</a> - {{- end }} - {{- if $paginator.HasNext }} - <a class="next" href="{{ $paginator.Next.URL | absURL }}">{{ i18n "next_page" }} »</a> - {{- end }} - </nav> -</footer> -{{- end }} + {{- with .Param "archivesSlug" }} + <div> + <a href="{{ $.RelPermalink }}{{ . }}/">Archives</a> + </div> + {{- end }} +</div> {{ end }} |
