all repos — website @ a2e6dd0ec7990b24f11e971462f9cdf1f5dc9fef

My website

Add support for pandoc-style fences

:::{#foo .bar}
text
:::

becomes

<div id="foo" class="bar">
text
</text>
Alan Pearce alan@alanpearce.eu
Tue, 28 May 2024 16:42:08 +0200
commit

a2e6dd0ec7990b24f11e971462f9cdf1f5dc9fef

parent

287cfec3d2479415bf3b7069702dbdb8c87b1826

5 files changed, 16 insertions(+), 2 deletions(-)

jump to
M go.modgo.mod
@@ -19,6 +19,7 @@ github.com/getsentry/sentry-go v0.27.0 	github.com/gohugoio/hugo v0.126.1
 	github.com/otiai10/copy v1.14.0
 	github.com/pkg/errors v0.9.1
+	github.com/stefanfritsch/goldmark-fences v1.0.0
 	github.com/sykesm/zap-logfmt v0.0.4
 	github.com/thessem/zap-prettyconsole v0.4.0
 	github.com/yuin/goldmark v1.7.1
M go.sumgo.sum
@@ -224,6 +224,8 @@ github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
 github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
 github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
+github.com/stefanfritsch/goldmark-fences v1.0.0 h1:cAL9eFJx5AfODfzURJg/R4M0TdynZb4azpGtXebywCI=
+github.com/stefanfritsch/goldmark-fences v1.0.0/go.mod h1:afDcGjekNr4uEUtTuDNmU+yPElZkv0bF2ASp+KoYsDk=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
M internal/builder/posts.gointernal/builder/posts.go
@@ -13,6 +13,7 @@ 	"github.com/adrg/frontmatter"
 	mapset "github.com/deckarep/golang-set/v2"
 	"github.com/pkg/errors"
+	fences "github.com/stefanfritsch/goldmark-fences"
 	"github.com/yuin/goldmark"
 	"github.com/yuin/goldmark/extension"
 	htmlrenderer "github.com/yuin/goldmark/renderer/html"
@@ -46,6 +47,7 @@ goldmark.WithExtensions( 		extension.GFM,
 		extension.Footnote,
 		extension.Typographer,
+		&fences.Extender{},
 	),
 )
 
M nix/gomod2nix.tomlnix/gomod2nix.toml
@@ -116,6 +116,9 @@ hash = "sha256-+rV3cDZr13N8E0rJ7iHmwsKYKH+EhV+IXBut+JbBiIE="   [mod."github.com/spf13/cast"]
     version = "v1.6.0"
     hash = "sha256-hxioqRZfXE0AE5099wmn3YG0AZF8Wda2EB4c7zHF6zI="
+  [mod."github.com/stefanfritsch/goldmark-fences"]
+    version = "v1.0.0"
+    hash = "sha256-Ei+FLtzyHEqz/ZUwHqtQMKHawglcHqcdXmIa8PLvqtc="
   [mod."github.com/sykesm/zap-logfmt"]
     version = "v0.0.4"
     hash = "sha256-KXVFtOU54chusK8AhZrzrvbbNmzq1mNrhs/7OmO+huE="
M templates/style.csstemplates/style.css
@@ -114,11 +114,16 @@ background-color: unset;   color: unset;
 }
 
-blockquote {
+blockquote,
+.aside {
   border-left: 1px solid #999;
   color: #222;
   padding-left: 20px;
   font-style: italic;
+}
+
+.aside {
+  font-style: unset;
 }
 
 footer {
@@ -179,7 +184,8 @@ pre code {     color: #ddd;
   }
 
-  blockquote {
+  blockquote,
+  .aside {
     color: #ccc;
   }