Compare commits

...

2 Commits

Author SHA1 Message Date
hedy ccfd592e02
Give more space between post header and post content 2024-04-18 17:23:14 +08:00
hedy 6b6aded2d7
feat: Show tags, adjust structure
- gmi: Show last mod along with post date in post meta
- both: Show simple list of tags at the end of a post
  - for web: This makes tags look like "tags" rather than "word-links",
    with removed text underline and added background color to the links.
    Small opacity/brightness change applied on hover for both dark and
    light modes.
- web: Adjust content structuring
  - hr before footnotes is removed. The footnotes is now borderless (hr
    is still visible on browsers without CSS)
  - Add upper border on footer (implemented by using bottom border on
    after content, which is now visible regardless of whether content
    exists)
  - Boldify footnotes heading - creates a visual separation in place of
    removed hr
- web: Adjust color of light text - it's now lighter and bluer to fit
  the background.
2024-04-18 17:17:01 +08:00
9 changed files with 44 additions and 43 deletions

View File

@ -52,7 +52,7 @@
--accent-bg-light: #303035; --accent-bg-light: #303035;
--code-bg: #3e3e4b; --code-bg: #3e3e4b;
--text: #eee; --text: #eee;
--text-light: #cecece; --text-light: #b8b8c6;
--non-text-light: #999fbf; --non-text-light: #999fbf;
--border: #aaa; --border: #aaa;
@ -436,25 +436,6 @@ nav .pfp-text {
/******************************************************************* /*******************************************************************
* Page sections * Page sections
*/ */
/* Differentiating between normal content links and meta content links */
.meta a, .post-meta :not(.tags) a, footer a, #after-content a {
text-decoration: none;
@media (prefers-color-scheme: dark) {
color: var(--link-alt);
}
}
.meta a:hover, .post-meta :not(.tags) a:hover, footer a:hover, #after-content a:hover {
color: var(--accent-light);
text-decoration: underline;
@media (prefers-color-scheme: dark) {
opacity: .75;
}
}
.post-meta .tags a, .post-meta .tags a:visited {
text-decoration: underline;
color: var(--text-light);
}
main, #after-content { main, #after-content {
/* For better reading experience. /* For better reading experience.
* I don't want paragraphs to be too narrow, it looks ugly; Though I don't * I don't want paragraphs to be too narrow, it looks ugly; Though I don't
@ -465,17 +446,40 @@ main, #after-content {
margin: auto; margin: auto;
padding: 0 5%; padding: 0 5%;
} }
#after-content {
margin-bottom: 4rem; /* Differentiating between normal content links and meta content links */
.meta a, footer a, #after-content a {
text-decoration: none;
@media (prefers-color-scheme: dark) {
color: var(--link-alt);
}
} }
#after-content:empty { .meta a:hover, footer a:hover, #after-content a:hover {
display: none; color: var(--accent-light);
text-decoration: underline;
@media (prefers-color-scheme: dark) {
opacity: .75;
}
} }
/* Tags */
#after-content .tags a, #after-content .tags a:visited {
padding: .2rem .5rem;
color: var(--text-light);
background-color: var(--accent-bg);
}
#after-content .tags a:hover {
text-decoration: none;
@media (prefers-color-scheme: light) {
filter: brightness(95%);
}
}
footer { footer {
text-align: center; text-align: center;
font-size: .9rem; font-size: .9rem;
color: var(--text-light); color: var(--text-light);
padding: 1rem 0 1rem 0; padding: .5rem 0 1rem 0;
margin: 0 5%; margin: 0 5%;
} }
footer a { footer a {
@ -545,7 +549,7 @@ a.anchor:hover {
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
#post-header { #post-header {
margin-bottom: 2rem; margin-bottom: 2.5rem;
} }
.post-meta, .meta, footer, #after-content { .post-meta, .meta, footer, #after-content {
font-size: .9rem; font-size: .9rem;
@ -553,8 +557,8 @@ a.anchor:hover {
} }
#content div#main { #content div#main {
border-bottom: 2px solid var(--border-light);
padding-bottom: 1rem; padding-bottom: 1rem;
margin-bottom: 5rem;
} }
.footnotes { .footnotes {
@ -562,9 +566,6 @@ a.anchor:hover {
font-size: .9rem; font-size: .9rem;
color: var(--text-light); color: var(--text-light);
} }
.footnotes #footnotes-heading {
margin-top: 1.5rem;
}
.footnotes ol { .footnotes ol {
margin-top: none; margin-top: none;
} }

View File

@ -2,13 +2,13 @@
date = '2024-04-10T05:22:46Z' date = '2024-04-10T05:22:46Z'
description = 'The visual block mode in Vim/Neovim is quite powerful. You can use it for "column" editing and vertically pasting blocks of text similar to paste(1).' description = 'The visual block mode in Vim/Neovim is quite powerful. You can use it for "column" editing and vertically pasting blocks of text similar to paste(1).'
draft = false draft = false
footnotes_heading = 'Footnotes'
hasFootnotes = true
outputs = ['html', 'gemtext'] outputs = ['html', 'gemtext']
slug = 'vim-column-editing' slug = 'vim-column-editing'
tags = ['howto', 'terminal'] tags = ['howto', 'terminal']
title = 'Vim visual block mode for column editing' title = 'Vim visual block mode for column editing'
EOF = false
publicReplyTo = "mailto:~hedy/posts@lists.sr.ht?cc=hedy%20%3Chedy.dev%40protonmail.com%3E&in-reply-to=%3Cn7UVukOUgCClct4d56HGVviI9Ig0QFF1dp0XIjC1EHZkOq9kBq4oHhA_CpVUa1LKxD73wJAZn4kUaTBoIQtENvNDF6RiSUsMfbN8fT4y2fI%3D%40protonmail.com%3E&subject=Re%3A%20Vim%20visual%20block%20mode%20for%20column%20editing" publicReplyTo = "mailto:~hedy/posts@lists.sr.ht?cc=hedy%20%3Chedy.dev%40protonmail.com%3E&in-reply-to=%3Cn7UVukOUgCClct4d56HGVviI9Ig0QFF1dp0XIjC1EHZkOq9kBq4oHhA_CpVUa1LKxD73wJAZn4kUaTBoIQtENvNDF6RiSUsMfbN8fT4y2fI%3D%40protonmail.com%3E&subject=Re%3A%20Vim%20visual%20block%20mode%20for%20column%20editing"
+++ +++

View File

@ -12,8 +12,10 @@
{{ block "main" . }}{{ end }} {{ block "main" . }}{{ end }}
</div> </div>
</main> </main>
<!-- Don't use line breaks here, we want to hide this section if 'after' is empty. --> <section id="after-content">
<section id="after-content">{{- block "after" . }}{{ end }}</section> {{- block "after" . }}{{ end }}
<hr style="margin-top: 4rem; margin-bottom: 0;"/>
</section>
<footer> <footer>
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
</footer> </footer>

View File

@ -1,4 +1,3 @@
<hr style="display: none;">
<p> <p>
Copyright © {{ with .Site.Params.CopyrightYearStart }}{{ . }}-{{ end -}} Copyright © {{ with .Site.Params.CopyrightYearStart }}{{ . }}-{{ end -}}
{{ now.Format "2006" }} {{ now.Format "2006" }}

View File

@ -1,5 +1,5 @@
{{ $footnotes := `(<div class="footnotes" role="doc-endnotes"> {{ $footnotes := `(<div class="footnotes" role="doc-endnotes">
<hr>)` -}} <hr>)` -}}
{{ $footnotesWithHeading := printf `<div class="footnotes" role="doc-endnotes"> {{ $footnotesWithHeading := printf `<hr style="display: none;"><div class="footnotes" role="doc-endnotes">
<hr><p id="footnotes-heading">%s</p>` "Footnotes" -}} <p id="footnotes-heading"><strong>%s</strong></p>` "Footnotes" -}}
{{ .Content | replaceRE $footnotes $footnotesWithHeading | safeHTML -}} {{ .Content | replaceRE $footnotes $footnotesWithHeading | safeHTML -}}

View File

@ -1,4 +1,4 @@
{{ $taxonomy := "tags" -}} {{ $taxonomy := "tags" -}}
{{ with .Page.Param $taxonomy -}}{{ with $.Prefix }}{{ . | safeHTML }}{{ end }} {{ with .Page.Param $taxonomy -}}{{ with $.Prefix }}{{ . | safeHTML }}{{ end }}
{{- range $index, $tag := . -}}{{- with $.Page.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} {{- range $index, $tag := . -}}{{- with $.Page.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
{{- if $index -}}, {{ end -}}#{{ $tag | urlize }}{{ end }}{{ end }}{{ with $.Postfix }}{{ . | safeHTML }}{{ end }}{{ end }} {{- if $index -}}, {{ end -}}#{{ $tag | urlize }}{{ end }}{{ end }}{{ with $.Postfix }}{{ . | safeHTML }}{{ end }}{{ end -}}

View File

@ -5,7 +5,7 @@
<span class="tags"> <span class="tags">
{{- range $index, $tag := $tags -}} {{- range $index, $tag := $tags -}}
{{- $taglink := $.Page.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} {{- $taglink := $.Page.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
{{- if $index -}}, {{ end -}}<a href="{{ $taglink.RelPermalink }}">{{ $tag | urlize }}</a> {{- if $index -}}&nbsp;&nbsp;{{ end -}}<a class="tag" href="{{ $taglink.RelPermalink }}">#{{ $tag | urlize }}</a>
{{- end }} {{- end }}
</span> </span>
{{- end }} {{- end }}

View File

@ -1,7 +1,7 @@
{{ define "content" -}} {{ define "content" -}}
# {{ $.Title }} # {{ $.Title }}
{{ .Date.UTC.Format "Jan 02, 2006" }} {{ .Date.UTC.Format "Jan 02, 2006" }}{{ partial "lastmod.gmi" (dict "Page" . "Prefix" " (updated on " "Postfix" ")") }}
{{ partial "processed-content.gmi" . }} {{ partial "processed-content.gmi" . }}
@ -12,8 +12,7 @@ EOF
=> {{ with .Params.publicReplyTo }}{{ . |safeHTML }}{{ else }}mailto:~hedy/posts@lists.sr.ht?subject={{ $subject }}{{ end }} Reply via email publicly (plain-text only) => {{ with .Params.publicReplyTo }}{{ . |safeHTML }}{{ else }}mailto:~hedy/posts@lists.sr.ht?subject={{ $subject }}{{ end }} Reply via email publicly (plain-text only)
=> mailto:{{ .Site.Author.email }}?subject={{ $subject }} Reply via email privately => mailto:{{ .Site.Author.email }}?subject={{ $subject }} Reply via email privately
{{ .WordCount }} words {{ .WordCount }} words{{ partial "tags.gmi" (dict "Page" . "Prefix" " · ") }}
{{ partial "lastmod.gmi" (dict "Page" . "Prefix" "This post was last updated on " "Postfix" ".") }}
=> . ← Gemlog => . ← Gemlog
=> / ← Capsule home => / ← Capsule home

View File

@ -19,7 +19,7 @@
</div> </div>
{{- end }} {{- end }}
{{- define "after" }} {{- define "after" }}
{{ if (eq .Params.EOF false) }}{{ else }}<p id="#EOF">EOF</p>{{ end }} <p>{{ partial "tags.html" (dict "Page" .) }}</p>
<section class="comments"> <section class="comments">
<p> <p>
Questions, comments? Send an email to my{{ $subject := printf "Re: %s" .Title }} Questions, comments? Send an email to my{{ $subject := printf "Re: %s" .Title }}