24 Commits

Author SHA1 Message Date
e97d4f921d Add background-accent color 2022-04-23 22:47:42 -05:00
5ffca36b84 Add table formatting, requires using custom "table" shortcode 2022-04-23 17:54:05 -05:00
f4c056b99c Add simple <abbr> shortcode 2022-04-23 17:10:48 -05:00
3713fdae5b Insert line breaks between commas in CSS 2022-04-23 17:09:13 -05:00
1127795717 Remove duplicate padding rule on .series-pages 2022-04-21 20:43:47 -05:00
1db48c3101 Somehow I had two .navbar queries next to eachother 2022-04-21 20:40:35 -05:00
430139d292 Add lastmod to blog archetype 2022-04-20 09:47:40 -05:00
ac9ca6f97e Add a duplicate series-box to the bottom of the page 2022-04-19 17:51:03 -05:00
8cadf8e735 Move prevnext to be above related posts 2022-04-12 21:57:58 -05:00
42a7e27d09 Use horizontal scrolling on related posts section 2022-04-11 21:08:39 -05:00
2371f1de13 Revert "Use a markdown file for footer"
This reverts commit 81e141cef9.

The footer.md gets rendered at /footer/ which is not intended.
2022-04-11 02:10:40 -05:00
81e141cef9 Use a markdown file for footer 2022-04-10 22:33:28 -05:00
2113c7a4e9 Better related posts section 2022-04-10 15:42:58 -05:00
b14e0e90fd Don't make the gap bigger for regular list pages 2022-04-10 03:08:22 -05:00
2742bac9ff Increase gap between series 2022-04-10 02:48:56 -05:00
e8f9d1c5df Replace See also with a nicer looking Related posts section 2022-04-10 02:14:42 -05:00
dff23045a8 Use <main> and have different class names for authors 2022-04-09 23:29:22 -05:00
4f450374cf Use RenderString for extra footer content 2022-04-09 20:03:56 -05:00
a3a7f50a5b Remove gap between paragraphs in footer 2022-04-09 19:54:42 -05:00
2cc4f45d4f Add the option to add even more stuff to footer 2022-04-09 19:26:52 -05:00
33d0f81444 Set video preload to metadata 2022-04-09 01:17:59 -05:00
5668feed1d Support additional-head.html 2022-04-08 01:18:20 -05:00
586bea37d5 Re-add margins on mobile 2022-04-04 21:54:52 -05:00
37c04460b5 Clean up some of the div layout 2022-04-04 21:47:26 -05:00
15 changed files with 152 additions and 77 deletions

View File

@ -2,6 +2,7 @@
title: {{ replace .Name "-" " " | humanize }}
date: {{ .Date }}
lastmod: {{ .Date }}
toc: true
comments: true
draft: true

View File

@ -8,6 +8,7 @@
--background-3: #282828;
--background-4: #333;
--background-5: #444;
--background-accent: #111d2f;
--text-normal: #d3d3d3;
--link-color: #4da6ff;
--figure-border: #1b5b9b;
@ -24,6 +25,7 @@
--background-3: #d8d8d8;
--background-4: #bbb;
--background-5: #aaa;
--background-accent: #aec9ee;
--text-normal: #000;
--link-color: #0057bf;
--figure-border: #2e7bc9;
@ -52,6 +54,7 @@
}
/* Post layout (in list pages) */
.list-page-content {
display: flex;
@ -68,8 +71,13 @@
gap: 40px;
}
.series-taxonomy ul {
gap: 80px;
}
.page-list li,
.series-taxonomy li {
.series-taxonomy li,
.related-posts .post {
padding-top: 8px;
padding-left: 24px;
padding-right: 24px;
@ -84,21 +92,25 @@
opacity: .75;
}
.post-title {
.post-title,
.author-name {
margin-bottom: 10px;
}
.post-title a {
.post-title a,
.author-name a {
color: inherit;
text-decoration: inherit;
}
.post-meta-item {
.post-meta-item,
.author-meta-item {
margin-right: 10px;
display: inline-block;
}
.post-metadata {
.post-metadata,
.author-metadata {
margin-bottom: 15px;
}
@ -111,7 +123,8 @@
margin-top: 15px;
}
.post-description {
.post-description,
.author-description {
margin-top: 10px;
}
@ -149,7 +162,6 @@
gap: 10px;
flex-flow: row wrap;
list-style: none;
padding: 0;
background-color: var(--background);
padding: 8px;
border-radius: 16px;
@ -202,10 +214,6 @@
/* Header formatting (website title and article section headers) */
.top {
margin: 20px;
}
.header a,
.section-header a {
color: inherit;
@ -242,15 +250,31 @@
padding: 8px 15px;
}
.content,
footer {
margin: 20px;
/* Related posts */
.related hr {
margin: 25px 0;
}
footer {
text-align: center;
@media (min-width: 720px) {
.related {
/* this makes it full width -- 720px max-width on body
* add an extra 40px to give a 20px margin on left and right */
margin-left: calc(-100vw / 2 + 760px / 2);
margin-right: calc(-100vw / 2 + 760px / 2);
}
}
.related-posts {
display: grid;
gap: 20px;
grid-auto-flow: column;
grid-auto-columns: 300px;
overflow-x: auto;
}
/* Back to top */
#back-to-top {
position: fixed;
float: right;
@ -278,9 +302,6 @@ footer {
.navbar {
display: flex;
}
.navbar {
flex-grow: 1;
overflow: auto;
}
@ -338,6 +359,7 @@ footer {
/* Basic elements */
html {
scroll-behavior: smooth;
margin: 0 20px;
}
@media screen and (prefers-reduced-motion: reduce) {
@ -350,11 +372,19 @@ body {
background-color: var(--background);
color: var(--text-normal);
font-family: "Open Sans", "Noto Sans", sans-serif;
margin: auto;
margin: 0 auto 20px;
max-width: 720px;
overflow-wrap: break-word;
}
footer {
text-align: center;
}
footer p {
margin: 0;
}
img,
video {
max-width: 100%;
@ -408,6 +438,27 @@ hr {
border-color: var(--background-5);
}
table.markdown {
border-collapse: collapse;
border: 2px solid var(--text-normal);
}
.markdown thead {
background-color: var(--background-4);
}
.markdown th,
.markdown td {
padding: 8px;
}
.markdown tbody tr:nth-child(odd) {
background-color: var(--background);
}
.markdown tbody tr:nth-child(even) {
background-color: var(--background-2);
}
* {
box-sizing: border-box;
}
@ -504,9 +555,7 @@ li.disabled > .page-link:hover {
/* Breadcrumb navigation */
.breadcrumb {
margin-top: 40px;
margin-bottom: 20px;
margin-left: 20px;
margin: 30px 0 20px;
}
.breadcrumb ul {
@ -572,7 +621,8 @@ li.disabled > .page-link:hover {
/* Light mode */
@media print, (prefers-color-scheme: light) {
@media print,
(prefers-color-scheme: light) {
/* Basic elements */
.section:hover {
color: inherit;

View File

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

View File

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

View File

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

View File

@ -7,25 +7,7 @@
</div>
{{ partial "post-metadata/full.html" . }}
{{ with (.GetTerms "series") }}
{{ $series := slice }}
{{ range . }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="series-box">
{{ partial "icon.html" "info" }}
{{ if gt (len $series) 1 }}
This post is part of multiple series:
{{ else }}
This post is part of a series:
{{ end }}
{{ delimit $series ", " }}
</div>
{{ end }}
{{ partial "series-box.html" . }}
{{ if .Params.Toc }}
<div class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
@ -46,23 +28,9 @@
</div>
{{ end }}
{{ .Content }}
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<div class="see-also">
<h2>{{ i18n "see_also" }}</h2>
<ul>
{{ range . }}
<li>
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
<div class="post-content">
{{ .Content }}
</div>
{{ if or .NextInSection .PrevInSection }}
<div class="prevnext">
@ -94,6 +62,22 @@
</div>
{{ end }}
{{ partial "series-box.html" . }}
{{ $related := .Site.RegularPages.Related . | first 10 }}
{{ with $related }}
<div class="related">
<hr>
<h2>{{ i18n "related_posts" }}</h2>
<div class="related-posts">
{{ range . }}
{{ .Render "summary/post" }}
{{ end }}
</div>
<hr>
</div>
{{ end }}
{{ if .Params.comments }}
<div class="comments">
{{ partial "comments.html" . }}

View File

@ -1,12 +1,12 @@
<div class="post">
<h2 class="post-title">
<div class="author">
<h2 class="author-name">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "post-metadata/author.html" . }}
<div class="post-description">
<div class="author-description">
{{ partial "description-or-summary.html" . }}
</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" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
{{ else if eq .MediaType.MainType "video" }}
<video controls>
<video controls preload="metadata">
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
{{ i18n "browser_no_video_support" }}
</video>

View File

@ -37,4 +37,6 @@
<meta name="language" content="{{ .Language.Lang }}">
<meta name="description" content="{{ (partial "seo-tags/description.html" .) | plainify }}">
{{ partial "additional-head.html" . }}
</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 */}}
{{ $total_words := 0 }}
{{ range .Data.Pages }}
{{ $total_words = add $total_words .WordCount }}
{{ 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" }}
{{ i18n "post_count" (len .Data.Pages) }}
</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" }}
{{ i18n "wordcount" $total_words }}
</span>

View File

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

View File

@ -0,0 +1,17 @@
{{ with (.GetTerms "series") }}
{{ $series := slice }}
{{ range . }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="series-box">
{{ partial "icon.html" "info" }}
{{ if gt (len $series) 1 }}
This post is part of multiple series:
{{ else }}
This post is part of a series:
{{ end }}
{{ delimit $series ", " }}
</div>
{{ end }}

View File

@ -0,0 +1 @@
<abbr title="{{ .Get "title" }}">{{ .Inner }}</abbr>

View File

@ -0,0 +1,10 @@
{{/* See https://willschenk.com/articles/2020/styling_tables_with_hugo/ */}}
{{ $class := "markdown" }}
{{ with .Get "class" }}
{{ $class = delimit (slice $class .) " " }}
{{ end }}
{{ $htmlTable := .Inner | markdownify }}
{{ $new := printf `<table class="%s">` $class }}
{{ (replace $htmlTable "<table>" $new) | safeHTML }}