8 Commits

9 changed files with 45 additions and 36 deletions

View File

@ -52,6 +52,7 @@
} }
/* Post layout (in list pages) */ /* Post layout (in list pages) */
.list-page-content { .list-page-content {
display: flex; display: flex;
@ -84,21 +85,21 @@
opacity: .75; opacity: .75;
} }
.post-title { .post-title, .author-name {
margin-bottom: 10px; margin-bottom: 10px;
} }
.post-title a { .post-title a, .author-name a {
color: inherit; color: inherit;
text-decoration: inherit; text-decoration: inherit;
} }
.post-meta-item { .post-meta-item, .author-meta-item {
margin-right: 10px; margin-right: 10px;
display: inline-block; display: inline-block;
} }
.post-metadata { .post-metadata, .author-metadata {
margin-bottom: 15px; margin-bottom: 15px;
} }
@ -111,7 +112,7 @@
margin-top: 15px; margin-top: 15px;
} }
.post-description { .post-description, .author-description {
margin-top: 10px; margin-top: 10px;
} }
@ -202,10 +203,6 @@
/* Header formatting (website title and article section headers) */ /* Header formatting (website title and article section headers) */
.top {
margin: 20px;
}
.header a, .header a,
.section-header a { .section-header a {
color: inherit; color: inherit;
@ -242,15 +239,6 @@
padding: 8px 15px; padding: 8px 15px;
} }
.content,
footer {
margin: 20px;
}
footer {
text-align: center;
}
#back-to-top { #back-to-top {
position: fixed; position: fixed;
float: right; float: right;
@ -338,6 +326,7 @@ footer {
/* Basic elements */ /* Basic elements */
html { html {
scroll-behavior: smooth; scroll-behavior: smooth;
margin: 0 20px;
} }
@media screen and (prefers-reduced-motion: reduce) { @media screen and (prefers-reduced-motion: reduce) {
@ -350,11 +339,19 @@ body {
background-color: var(--background); background-color: var(--background);
color: var(--text-normal); color: var(--text-normal);
font-family: "Open Sans", "Noto Sans", sans-serif; font-family: "Open Sans", "Noto Sans", sans-serif;
margin: auto; margin: 0 auto 20px;
max-width: 720px; max-width: 720px;
overflow-wrap: break-word; overflow-wrap: break-word;
} }
footer {
text-align: center;
}
footer p {
margin: 0;
}
img, img,
video { video {
max-width: 100%; max-width: 100%;
@ -504,9 +501,7 @@ li.disabled > .page-link:hover {
/* Breadcrumb navigation */ /* Breadcrumb navigation */
.breadcrumb { .breadcrumb {
margin-top: 40px; margin: 30px 0 20px;
margin-bottom: 20px;
margin-left: 20px;
} }
.breadcrumb ul { .breadcrumb ul {

View File

@ -14,17 +14,23 @@
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
{{ end }} {{ end }}
<div class="content"> <main>
{{ block "main" . }} {{ block "main" . }}
{{ .Content }} {{ .Content }}
{{ end }} {{ end }}
</div> </main>
{{ with .Site.Copyright }} {{ if or .Site.Copyright .Site.Params.footer }}
<footer>
<hr> <hr>
<footer>
<small> <small>
{{ . | safeHTML }} {{ with .Site.Copyright }}
<p>{{ . | safeHTML }}</p>
{{ end }}
{{ with .Site.Params.footer }}
{{ . | $.RenderString (dict "display" "block") }}
{{ end }}
</small> </small>
</footer> </footer>
{{ end }} {{ end }}

View File

@ -46,7 +46,9 @@
</div> </div>
{{ end }} {{ end }}
<div class="post-content">
{{ .Content }} {{ .Content }}
</div>
{{ $related := .Site.RegularPages.Related . | first 5 }} {{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }} {{ with $related }}

View File

@ -1,12 +1,12 @@
<div class="post"> <div class="author">
<h2 class="post-title"> <h2 class="author-name">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2> </h2>
{{ partial "post-metadata/author.html" . }} {{ partial "post-metadata/author.html" . }}
<div class="post-description"> <div class="author-description">
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
</div> </div>

View File

@ -0,0 +1,4 @@
{{/*
Create a file named `layouts/partials/additional-head.html` at your site root to
add extra tags into <head>. Page variables are passed.
*/}}

View File

@ -11,7 +11,7 @@
{{ if eq .MediaType.MainType "image" }} {{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" /> <img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
{{ else if eq .MediaType.MainType "video" }} {{ else if eq .MediaType.MainType "video" }}
<video controls> <video controls preload="metadata">
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}"> <source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
{{ i18n "browser_no_video_support" }} {{ i18n "browser_no_video_support" }}
</video> </video>

View File

@ -37,4 +37,6 @@
<meta name="language" content="{{ .Language.Lang }}"> <meta name="language" content="{{ .Language.Lang }}">
<meta name="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}"> <meta name="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
{{ partial "additional-head.html" . }}
</head> </head>

View File

@ -1,16 +1,16 @@
<div class="post-metadata" aria-label="{{ i18n "aria_author_metadata" }}"> <div class="author-metadata" aria-label="{{ i18n "aria_author_metadata" }}">
{{/* Calculate the total word count */}} {{/* Calculate the total word count */}}
{{ $total_words := 0 }} {{ $total_words := 0 }}
{{ range .Data.Pages }} {{ range .Data.Pages }}
{{ $total_words = add $total_words .WordCount }} {{ $total_words = add $total_words .WordCount }}
{{ end }} {{ end }}
<span class="post-meta-item" aria-label="{{ i18n "aria_author_post_count" }}"> <span class="author-meta-item" aria-label="{{ i18n "aria_author_post_count" }}">
{{ partial "icon.html" "newspaper" }} {{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }} {{ i18n "post_count" (len .Data.Pages) }}
</span> </span>
<span class="post-meta-item" aria-label="{{ i18n "aria_author_word_count" }}"> <span class="author-meta-item" aria-label="{{ i18n "aria_author_word_count" }}">
{{ partial "icon.html" "align-left" }} {{ partial "icon.html" "align-left" }}
{{ i18n "wordcount" $total_words }} {{ i18n "wordcount" $total_words }}
</span> </span>

View File

@ -12,7 +12,7 @@
{{ if eq $type "image" }} {{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" /> <img src="{{ $src }}" alt="{{ $alt }}" />
{{ else if eq $type "video" }} {{ else if eq $type "video" }}
<video controls> <video controls preload="metadata">
<source src="{{ $src }}" alt="{{ $alt }}"> <source src="{{ $src }}" alt="{{ $alt }}">
{{ i18n "browser_no_video_support" }} {{ i18n "browser_no_video_support" }}
</video> </video>