Optionally enabling comments on a per-page basis

enp1-edits
Logan McGrath 2022-02-27 08:51:13 -08:00
parent f52f212e6d
commit 1a85532374
19 changed files with 58 additions and 59 deletions

View File

@ -1,7 +1,7 @@
---
title: GitHub Copilot as a hot butter knife
author: Logan McGrath
comments: false
comments: true
date: 2021-12-13T14:49:08-0800
tags: copilot, programming
layout: post

View File

@ -2,7 +2,7 @@
title: "Embracing Nondeterminism Part I: Contexts and Effects"
description: Abstracting nondeterminism and complexity by modeling effects as first class concepts in programs.
author: Logan McGrath
comments: false
comments: true
date: 2022-01-24T17:14:03-0800
tags: functional programming, programming, scala, design patterns
layout: post
@ -414,8 +414,7 @@ Most importantly, by keeping all operations against terms within their context,
Functors thus _preserve structure_ by keeping operations within the context. For example, applying `map()` on a `List[A]` or `BinaryTree[A]`:
:::{.nowrap .numberLines}
```markdown
```{.nowrap .numberLines}
[1, 2, 3, 4] -> map (*2) -> [1, 4, 6, 8]
4 8
@ -424,14 +423,12 @@ Functors thus _preserve structure_ by keeping operations within the context. For
/ \ / \ / \ / \
1 3 5 7 1 6 10 14
```
:::
The application of `map()` produces two new and identifiable `List[B]` and `BinaryTree[B]`s. The values internally change, as they have been mapped-over by a function, and `BinaryTree[B]` specifically may re-balance itself. What matters here is that the structures are coherent and identifiable.
Compare with iteration using a `for` loop:
:::{.nowrap .numberLines}
```markdown
```{.nowrap .numberLines}
[1, 2, 3, 4] -> for(x) -> x={1, 2, 3, 4}
4
@ -440,7 +437,6 @@ Compare with iteration using a `for` loop:
/ \ / \
1 3 5 7
```
:::
Iteration as a form of lowering _destroys structure_. In order to get a `List[B]` back you would have to rebuild it yourself and any structural guarantees must be manually implemented following _procedural_ steps.

View File

@ -2,7 +2,7 @@
title: "Embracing Nondeterminism Part II: Products of Contexts"
description: Abstracting nondeterminism and complexity in contexts in order to consume products of two or more in parallel.
author: Logan McGrath
comments: false
comments: true
date: 2022-02-23T20:58:26-0800
tags: functional programming, programming, scala, design patterns
layout: post

View File

@ -11,7 +11,10 @@
<main class="page-content">
<div class="content-bound">
{{body}}
<div class="{{contentClass | default ''}}">
{{body}}
</div>
{{partial "page-comments"}}
</div>
</main>

View File

@ -1,6 +1,5 @@
{{put bodyClass: "post post-full"-}}
{{put contentClass: "post post-full"-}}
{{@applyLayout "default"-}}
<h1 class="post-title">{{title}}</h1>
{{partial "post-meta"}}
{{body}}
{{partial "post-comments"}}

View File

@ -22,7 +22,7 @@
<script src="{{getUrl 'js/main.js'}}"></script>
</head>
<body class="{{bodyClass | default 'default'}}">
<body>
{{body}}
</body>
</html>

View File

@ -1,12 +1,14 @@
<div class="post-comments">
<p><strong>Please share with me your thoughts and feedback</strong></p>
{{#if comments-}}
<div class="page-comments">
<p><strong>Please share with me your thoughts and feedback!</strong></p>
<script>
var remark_config = {
host: 'https://remark42.thisfieldwas.green',
site_id: '{{siteCommentsId}}',
url: '{{siteRoot}}{{url}}'
url: '{{absUrl}}'
}
</script>
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)} }(remark_config.components||["embed"],document);</script>
<div id="remark42"></div>
</div>
{{-#end}}

View File

@ -5,6 +5,7 @@ date: 2012-11-07T13:54:00-0600
published: 2012-11-07T13:54:00-0600
tags: Perforce, configuration management
layout: post
commensts: true
---
Following Paul Hammant's post [App-config workflow using SCM][] and subsequent

View File

@ -3,7 +3,7 @@ title: SCM-Backed Application Configuration with Perforce
author: Logan McGrath
date: 2012-11-16T17:00:00-0600
published: 2012-11-16T17:00:00-0600
comments: false
comments: true
tags: configuration management, Perforce, Sinatra, AngularJS
layout: post
---

View File

@ -3,7 +3,7 @@ title: App-Config-App in Action
author: Logan McGrath
date: 2012-11-20T17:00:00-0600
published: 2012-11-20T17:00:00-0600
comments: false
comments: true
tags: AngularJS, Perforce, Sinatra, configuration management
layout: post
---

View File

@ -3,7 +3,7 @@ title: Promoting changes with App-Config-App
author: Logan McGrath
date: 2012-11-28T13:04:00-0600
published: 2012-11-28T13:04:00-0600
comments: false
comments: true
tags: AngularJS, Perforce, Sinatra, configuration management
layout: post
---

View File

@ -6,7 +6,7 @@ published: 2021-12-05T08:08:32-0800
comments: false
tags: hakyll, Haskell, yak shave
layout: post
bodyClass: redoing-my-website
contentClass: redoing-my-website
changefreq: daily
---

View File

@ -4,7 +4,7 @@ description: >-
My website comes out of the closet. This is from where I host several of my
services, but the uptime is terrible!
author: Logan McGrath
comments: false
comments:
published: 2021-12-11T14:43:25-0800
tags: self host, configuration management, tinfoil hat, duct tape, yak shave
layout: post

View File

@ -2,7 +2,7 @@
title: Highly available ssh tunnels
description: Duct tape performs better than systemd for keeping my webserver's ssh tunnels open
author: Logan McGrath
comments: false
comments: tr
date: 2022-02-08T14:27:57-0800
published: 2022-02-09T16:02:28-0800
tags: self host, duct tape, yak shave

View File

@ -1,7 +1,7 @@
---
title: Writing about the greenest things
description: The latest and greenest of things I've written about
bodyClass: blog
contentClass: blog
layout: page
changefreq: weekly
---

View File

@ -30,8 +30,3 @@
margin: 0 auto;
}
}
.post-comments {
margin-top: 2.4em;
border-top: $border-regular;
}

View File

@ -1,14 +1,11 @@
code {
color: $code-color;
text-decoration: none;
white-space: pre-wrap;
word-wrap: break-word;
white-space: pre;
word-wrap: normal;
&:not(.sourceCode) {
color: $code-color;
font-family: inherit;
text-decoration: underline;
}
font-family: inherit;
text-decoration: underline;
.al { color: red; } /* Alert */
.an { color: saddlebrown; font-weight: bold; font-style: italic; } /* Annotation */
@ -53,6 +50,7 @@ pre.sourceCode {
code.sourceCode {
color: $source-code-color;
text-decoration: none;
display: block;
margin: 0;
padding: 0;
@ -63,10 +61,6 @@ pre.sourceCode {
white-space: pre;
word-wrap: normal;
.numberLines & {
counter-reset: line-number;
}
> span {
display: block;
@ -80,27 +74,31 @@ pre.sourceCode {
> a:first-child {
display: inline-block;
}
}
}
}
.numberLines & {
counter-increment: line-number;
&:hover {
background-color: $code-color-highlight-hover;
}
&:target {
background-color: $code-color-highlight;
}
.numberLines code.sourceCode {
counter-reset: line-number;
> a:first-child {
width: 2em;
padding: 0 0.5em 0 0;
margin: 0 0.5em 0 0;
border-right: $border-thin;
text-align: right;
user-select: none;
&::before {
content: counter(line-number);
}
}
> span {
counter-increment: line-number;
&:hover {
background-color: $code-color-highlight-hover;
}
&:target {
background-color: $code-color-highlight;
}
> a:first-child {
width: 2em;
padding: 0 0.5em 0 0;
margin: 0 0.5em 0 0;
border-right: $border-thin;
text-align: right;
user-select: none;
&::before {
content: counter(line-number);
}
}
}

View File

@ -8,3 +8,8 @@
text-decoration: underline;
}
}
.page-comments {
margin-top: 2.4em;
border-top: $border-regular;
}

View File

@ -1,7 +1,7 @@
---
title: Mowing My Technical Lawn
description: I write about my personal mishmash of tech and life
bodyClass: homepage
contentClass: homepage
layout: page
---
<h2>Hello!</h2>