]> git.xn--bdkaa.com Git - xn--bdkaa.com.git/commitdiff
Add tags
authorEvgenii Akentev <i@ak3n.com>
Mon, 21 Feb 2022 18:45:48 +0000 (23:45 +0500)
committerEvgenii Akentev <i@ak3n.com>
Mon, 21 Feb 2022 18:45:48 +0000 (23:45 +0500)
config.toml
content/posts/implementations-of-the-handle-pattern.md
content/posts/thoughts-on-backpack-modules-and-records.md
themes/theme/layouts/_default/list.html
themes/theme/layouts/_default/single.html
themes/theme/layouts/partials/tags.html [new file with mode: 0644]
themes/theme/static/css/stylesheet.css

index 77f120f0ddf031e3403492397139b816ec349988..835a27add4727466f577255e63e23c2a2cffe787 100644 (file)
@@ -3,8 +3,11 @@ languageCode = "en-us"
 title = "ak3n.com"
 theme = "theme"
 
+[taxonomies]
+  tag = 'tags'
+
 [params]
-    sitename = "ak3n.com"
+  sitename = "ak3n.com"
 
 [markup]
   [markup.highlight]
index a3e659960339528b728c0d9fefde84dbf682fc55..26f28a7a30a5cf83d8caf07d8d75757db9c5545e 100644 (file)
@@ -2,6 +2,7 @@
 title: Implementations of the Handle pattern
 date: 2021-01-31
 draft: false
+tags: [haskell, backpack]
 ---
 
 In ["Monad Transformers and Effects with Backpack"](https://blog.ocharles.org.uk/posts/2020-12-23-monad-transformers-and-effects-with-backpack.html) [@acid2](https://twitter.com/acid2) presented how to apply Backpack to monad transformers. There is a less-popular approach to deal with effects — [Handle](https://jaspervdj.be/posts/2018-03-08-handle-pattern.html) ([Service](https://www.schoolofhaskell.com/user/meiersi/the-service-pattern)) pattern. I recommend reading both posts at first since they answer many questions regarding the design decisions behind the Handle pattern (why `IO`, why not type classes, etc). In this post, I want to show different implementations of the Handle pattern and compare them. All examples described below are available [in this repository](https://sr.ht/~ak3n/handle-examples/).
index 1a4631a83170c9d64792025a0c6f5fc8ee5314c5..a7fa3bd59ae50c93a53e3074c09df531787d86d2 100644 (file)
@@ -2,6 +2,7 @@
 title: Thoughts on Backpack, modules, and records
 date: 2021-01-31
 draft: false
+tags: [haskell, backpack, modules, records]
 ---
 
 In ["Implementations of the Handle pattern"](/implementations-of-the-handle-pattern) I have explored how Backpack might be used for the Handle pattern. It helped me to take a better look at Backpack and reflect a bit on modules and records in Haskell.
index 8b3cafb214ab1699c748ee34e737df6f8ec402a1..b9f855a730eaaa6eb9fb9d7696d434d0bf846e61 100644 (file)
@@ -1,5 +1,7 @@
 {{ partial "header.html" . }}
 
+<p>Posts tagged "{{ .Title }}":</p>
+
 <section>
   <ul>
     {{ range .Data.Pages.ByPublishDate.Reverse }}
index 1d1f062557dea9fca4b94fed797c7c9bdd405250..b2ef453d97b6d00e22e910fac1d4945f9149e634 100644 (file)
@@ -3,7 +3,12 @@
 <section class="blog-post">
     <h1>{{ .Title }}</h1>
     <div class="blog-post-subheader">
-        {{ .Date.Format (.Site.Params.dateform | default "January 02, 2006") }}
+        <div>
+            {{ .Date.Format (.Site.Params.dateform | default "January 02, 2006") }}
+        </div>
+        <div>
+            {{ partial "tags.html" (.GetTerms "tags") }}
+        </div>
     </div>
     <div class="blog-post-content">
         {{ partial "headline.html" .Content }}
diff --git a/themes/theme/layouts/partials/tags.html b/themes/theme/layouts/partials/tags.html
new file mode 100644 (file)
index 0000000..ce6b334
--- /dev/null
@@ -0,0 +1,5 @@
+<ul class="tags">
+    {{ range . }}
+        <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
+    {{ end }}
+</ul>
\ No newline at end of file
index 055fae290fb2fd5789b0dfe536693e5d16b3ef9c..87d4ec7974d04119b610c9c58be32e4e7dcbe3d0 100644 (file)
@@ -75,6 +75,32 @@ ul li h4 {
     visibility: hidden;
 }
 
+.blog-post-subheader div {
+    display: inline-block;
+}
+
+ul.tags {
+    margin: 0;
+    padding: 0;
+    list-style-type: none;
+}
+
+ul.tags li {
+    display: inline;
+}
+
+ul.tags li:first-child:before {
+    content: "# ";
+}
+
+ul.tags li:last-child:after {
+    content: none;
+}
+
+ul.tags li:after {
+    content: ",";
+}
+
 h1 {
     font-style: normal;
     font-size: 2rem;