14 Commits

20 changed files with 179 additions and 123 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;
@ -68,8 +69,13 @@
gap: 40px; gap: 40px;
} }
.series-taxonomy ul {
gap: 80px;
}
.page-list li, .page-list li,
.series-taxonomy li { .series-taxonomy li,
.related-posts .post {
padding-top: 8px; padding-top: 8px;
padding-left: 24px; padding-left: 24px;
padding-right: 24px; padding-right: 24px;
@ -84,21 +90,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 +117,7 @@
margin-top: 15px; margin-top: 15px;
} }
.post-description { .post-description, .author-description {
margin-top: 10px; margin-top: 10px;
} }
@ -202,10 +208,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,13 +244,17 @@
padding: 8px 15px; padding: 8px 15px;
} }
.content, .related-posts {
footer { display: flex;
margin: 20px; flex-wrap: wrap;
justify-content: space-evenly;
gap: 10px;
align-items: stretch; /* this is default anyways */
} }
footer { .related-posts .post {
text-align: center; min-width: 10%;
flex: 1 1 49%;
} }
#back-to-top { #back-to-top {
@ -338,6 +344,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 +357,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 +519,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 {
@ -607,6 +620,7 @@ li.disabled > .page-link:hover {
pre { pre {
white-space: pre-wrap; white-space: pre-wrap;
overflow-wrap: anywhere; overflow-wrap: anywhere;
break-inside: avoid;
} }
.table-of-contents { .table-of-contents {

View File

@ -35,8 +35,8 @@ post_count:
read_more: read_more:
other: "Read more" other: "Read more"
see_also: related_posts:
other: "See also" other: "Related posts"
older_post: older_post:
other: "Older" other: "Older"

View File

@ -35,8 +35,8 @@ no_posts:
read_more: read_more:
other: "Leer más" other: "Leer más"
see_also: related_posts:
other: "Véase también" other: "Publicaciones similares"
older_post: older_post:
other: "Más antiguo" other: "Más antiguo"

View File

@ -4,7 +4,7 @@
{{ partial "head.html" . }} {{ partial "head.html" . }}
<body> <body>
<a id="top" aria-hidden="true"></a> <a id="top" name="top" aria-hidden="true"></a>
<div class="top"> <div class="top">
{{ partial "top.html" . }} {{ partial "top.html" . }}
@ -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 }}
<hr>
<footer> <footer>
<hr>
<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

@ -15,15 +15,17 @@
{{ end }} {{ end }}
<div class="page-list"> <div class="page-list">
<ul> {{ with .Paginator.Pages }}
{{ range .Paginator.Pages }} <ul>
<li>{{ .Render "summary/post" }}</li> {{ range . }}
{{ else }} <li>{{ .Render "summary/post" }}</li>
<div> {{ end }}
{{ i18n "no_posts" }} </ul>
</div> {{ else }}
{{ end }} <div>
</ul> {{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
</div> </div>

View File

@ -46,21 +46,17 @@
</div> </div>
{{ end }} {{ end }}
{{ .Content }} <div class="post-content">
{{ .Content }}
</div>
{{ $related := .Site.RegularPages.Related . | first 5 }} {{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }} {{ with $related }}
<div class="see-also"> <h2>{{ i18n "related_posts" }}</h2>
<h2>{{ i18n "see_also" }}</h2> <div class="related-posts">
{{ range . }}
<ul> {{ .Render "summary/post" }}
{{ range . }} {{ end }}
<li>
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
</div> </div>
{{ end }} {{ end }}

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

@ -5,10 +5,16 @@
</h1> </h1>
<div class="page-list"> <div class="page-list">
<ul> {{ with .Paginator.Pages }}
{{ range .Paginator.Pages }} <ul>
<li>{{ .Render "summary/author" }}</li> {{ range . }}
{{ end }} <li>{{ .Render "summary/author" }}</li>
</ul> {{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@ -10,15 +10,17 @@
{{ .Content }} {{ .Content }}
<div class="page-list"> <div class="page-list">
<ul> {{ with .Paginator.Pages }}
{{ range .Paginator.Pages }} <ul>
<li>{{ .Render "summary/post" }}</li> {{ range . }}
{{ else }} <li>{{ .Render "summary/post" }}</li>
<div> {{ end }}
{{ i18n "no_posts" }} </ul>
</div> {{ else }}
{{ end }} <div>
</ul> {{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}

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>

View File

@ -5,10 +5,16 @@
</h1> </h1>
<div class="series-taxonomy"> <div class="series-taxonomy">
<ul> {{ with .Pages }}
{{ range .Pages }} <ul>
<li>{{ .Render "summary/series" }}</li> {{ range . }}
{{ end }} <li>{{ .Render "summary/series" }}</li>
</ul> {{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@ -10,20 +10,22 @@
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
<div class="page-list"> <div class="page-list">
<ul> {{ with .Paginator.Pages.Reverse }}
{{ $i := 0 }} <ul>
{{ $total := len .Pages }} {{ $i := 0 }}
{{ range .Paginator.Pages.Reverse }} {{ $total := len $.Pages }}
{{ $i = add 1 $i }} {{ range . }}
{{ .Scratch.Set "series_position" $i }} {{ $i = add 1 $i }}
{{ .Scratch.Set "series_total" $total }} {{ .Scratch.Set "series_position" $i }}
<li>{{ .Render "summary/post" }}</li> {{ .Scratch.Set "series_total" $total }}
{{ else }} <li>{{ .Render "summary/post" }}</li>
<div> {{ end }}
{{ i18n "no_posts" }} </ul>
</div> {{ else }}
{{ end }} <div>
</ul> {{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}

View File

@ -5,12 +5,18 @@
</h1> </h1>
<div class="tag-list"> <div class="tag-list">
<ul> {{ with .Data.Terms.Alphabetical }}
{{ range .Data.Terms.Alphabetical }} <ul>
<a href="{{ .Page.Permalink }}"> {{ range . }}
<li>{{ .Page.Title | markdownify }}</li> <a href="{{ .Page.Permalink }}">
</a> <li>{{ .Page.Title | markdownify }}</li>
{{ end }} </a>
</ul> {{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@ -7,15 +7,17 @@
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
<div class="page-list"> <div class="page-list">
<ul> {{ with .Paginator.Pages }}
{{ range .Paginator.Pages }} <ul>
<li>{{ .Render "summary/post" }}</li> {{ range . }}
{{ else }} <li>{{ .Render "summary/post" }}</li>
<div> {{ end }}
{{ i18n "no_posts" }} </ul>
</div> {{ else }}
{{ end }} <div>
</ul> {{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}

View File

@ -10,12 +10,18 @@
</h1> </h1>
<div class="taxonomy"> <div class="taxonomy">
<ul> {{ with .Data.Terms.Alphabetical }}
{{ range .Data.Terms.Alphabetical }} <ul>
<li> {{ range . }}
<a href="{{ .Page.Permalink }}">{{ .Page.Title | markdownify }}</a> <li>
</li> <a href="{{ .Page.Permalink }}">{{ .Page.Title | markdownify }}</a>
{{ end }} </li>
</ul> {{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@ -12,15 +12,17 @@
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
<div class="page-list"> <div class="page-list">
<ul> {{ with .Paginator.Pages }}
{{ range .Paginator.Pages }} <ul>
<li>{{ .Render "summary/post" }}</li> {{ range . }}
{{ else }} <li>{{ .Render "summary/post" }}</li>
<div> {{ end }}
{{ i18n "no_posts" }} </ul>
</div> {{ else }}
{{ end }} <div>
</ul> {{ i18n "no_posts" }}
</div>
{{ end }}
</div> </div>
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}