refactoring gemini-specific layouts, throw out mermaid, cross-reference www and gmi
This commit is contained in:
parent
a5232c0baa
commit
e4e90b32e9
|
@ -23,7 +23,7 @@ enableGitInfo = true
|
|||
description = "Freshly baked thoughts"
|
||||
accent = "#018661"
|
||||
showBorder = true
|
||||
copyright = "<a href='/no-copyright-no-tracking'>No © and no tracking</a> - sharing is caring. <svg class='icon icon-small' width='16' height='16'><title>lightbulb icon</title><use xlink:href='#bulb'></use></svg> <a href='/'>Brain Baking</a>. <svg class='icon icon-small' width='16' height='16'><title>feed icon</title><use xlink:href='#news'></use></svg><a href='/subscribe'>RSS Feeds</a>."
|
||||
copyright = "<a href='/no-copyright-no-tracking'>No © and no tracking</a>. <svg class='icon icon-small' width='16' height='16'><title>lightbulb icon</title><use xlink:href='#bulb'></use></svg> <a href='/'>Brain Baking</a> | <a href='gemini://brainbaking.com/'>Gemini</a>. <svg class='icon icon-small' width='16' height='16'><title>feed icon</title><use xlink:href='#news'></use></svg><a href='/subscribe'>RSS Feeds</a>."
|
||||
|
||||
[Author]
|
||||
name = "Wouter Groeneveld"
|
||||
|
|
|
@ -17,14 +17,7 @@ An address can point to anything - that includes functions. Function pointers ar
|
|||
|
||||
Let's take a look at simple concepts: a person has a certain age.
|
||||
|
||||
{{<mermaid>}}
|
||||
graph LR;
|
||||
A{Person}
|
||||
B[Age]
|
||||
C[Is Old?]
|
||||
A --> B
|
||||
A -.-> C
|
||||
{{< /mermaid >}}
|
||||
![](../ddd-mermaid.jpg "A simple domain model.")
|
||||
|
||||
I can ask the person if he's old, and depending on the age the response will be yes (`true`) or no (`false`). Sounds almost too simple to implement in an object-oriented language like C#:
|
||||
|
||||
|
|
|
@ -77,15 +77,7 @@ To be able to effectively master these "lean skills", principles from all worlds
|
|||
|
||||
This can be as technical as we want it to be. For example, take the excellent idea of studying [7 programmings languages in 7 weeks](https://pragprog.com/book/btlang/seven-languages-in-seven-weeks). To facilitate rapid learning that is required in a modern ever-changing software engineering world, requiring students to adapt to a new language every week would serve the purpose of building resilience to constant change. This exercise will be theoretically substantiated by drawing from philosophical and psychological research. Without this step, students would not have a firm understanding of [why this resilience is needed](post/teaching-philosophy-first/), and they will not be able to translate what they have learned into the real world after graduating.
|
||||
|
||||
{{<mermaid>}}
|
||||
graph LR;
|
||||
A(Philosophy)
|
||||
B(Psychology)
|
||||
C(Software Engineering)
|
||||
A --> C
|
||||
A -.-> B
|
||||
B --> C
|
||||
{{< /mermaid >}}
|
||||
Philosophy - Psychology - Software Engineering.
|
||||
|
||||
I have yet to come across a good body of work emerged from within the Software Engineering world that successfully combines these ideas. Engineering research is typically very technical, and engineering education research as stated before either too vague or too pedagogical. Philosophy isn't exactly popular, especially among pragmatic engineers. University faculties do not usually work outside their own safe boundaries.
|
||||
|
||||
|
|
|
@ -93,27 +93,11 @@ Now that the VPS is (somewhat) secure, let's install `nginx` and configure our w
|
|||
|
||||
You first need to know that the previous setup was like this:
|
||||
|
||||
{{<mermaid>}}
|
||||
graph LR;
|
||||
Browser[Browser]
|
||||
NS[DNS Nameserver]
|
||||
Cloud[Cloudflare NS/SSL]
|
||||
Github[Github Pages]
|
||||
Browser --> NS
|
||||
NS --> Cloud
|
||||
Cloud --> Github
|
||||
{{< /mermaid >}}
|
||||
![](../vps-setup-1.jpg "The VPS setup: previous")
|
||||
|
||||
I leveraged Cloudflare's free SSL certificates to secure my static websites. Now that we have our own VPS, we'd like to alter the schematic like so:
|
||||
|
||||
{{<mermaid>}}
|
||||
graph LR;
|
||||
Browser[Browser]
|
||||
NS[DNS/NS Nameserver]
|
||||
VPS[Own VPS + SSL]
|
||||
Browser --> NS
|
||||
NS --> VPS
|
||||
{{< /mermaid >}}
|
||||
![](../vps-setup-2.jpg "The VPS setup: current")
|
||||
|
||||
That would involve modifying `NS` records at my domain host, resulting in a downtime of several hours until the new DNS records are correctly propagated. Bigger companies resolve this by installing their own nameservers.
|
||||
|
||||
|
|
|
@ -29,14 +29,7 @@ My aim was to publish a physical version of a book, similar to my favorite opini
|
|||
|
||||
The setup:
|
||||
|
||||
{{<mermaid>}}
|
||||
graph LR;
|
||||
md[Plaintext, md =]
|
||||
tex[LaTeX, tex =]
|
||||
pdf[Postscript, pdf =]
|
||||
md --> tex
|
||||
tex --> pdf
|
||||
{{< /mermaid >}}
|
||||
![](../pandoc-toolchain.jpg "The toolchain.")
|
||||
|
||||
For LaTeX compilation, `xetex` instead of `pdflatex` was employed, as my experience taught me the first one is more flexible when it comes to typesetting and such. My Makefile jumpstart command looks like this:
|
||||
|
||||
|
|
|
@ -45,14 +45,7 @@ The left part - where you do the work - is simply hideous, and usually riddled w
|
|||
|
||||
As mentioned in the [pandoc article](/post/2020/05/using-pandoc/), this is the setup:
|
||||
|
||||
{{<mermaid>}}
|
||||
graph LR;
|
||||
md[Plaintext, md =]
|
||||
tex[LaTeX, tex =]
|
||||
pdf[Postscript, pdf =]
|
||||
md --> tex
|
||||
tex --> pdf
|
||||
{{< /mermaid >}}
|
||||
![](../paper-toolchain.jpg "The pandoc toolchain.")
|
||||
|
||||
Simple enough, and the [Pandoc User Guide](https://pandoc.org/MANUAL.html) helps you in understanding the specifics when converting from Markdown to Tex. The most challenging part of writing academic papers in Markdown is not the conversion process but the annoying details you have to get right when adhering to a layout/template of a conference or journal. I write most things in Sublime, and put simple commands in a `Makefile` in order for `⌘+B` (Build) to work. The build file itself is straightforward enough:
|
||||
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
# {{ .Title }}{{ $scratch := newScratch }}
|
||||
{{ $content := .RawContent -}}
|
||||
{{ $content := $content | replaceRE "`(.+?)`" "$1" -}}{{ $content := $content | replaceRE "`" "```" -}}
|
||||
{{ $content := $content | replaceRE "`(.+?)`" "$1" -}}
|
||||
{{ $content := $content | replaceRE "`" "```" -}}
|
||||
{{ $content := $content | replaceRE `\*\*(.+?)\*\*` "$1" -}}
|
||||
{{ $content := $content | replaceRE `_(.+?)_` "$1" -}}
|
||||
{{ $content := $content | replaceRE `#### ` "### " -}}
|
||||
{{ $content := $content | replaceRE `<span>(.+?)</span>` "-- $1" -}}
|
||||
{{ $content := $content | replaceRE `\n- (.+?)` "\n* $1" -}}
|
||||
{{ $content := $content | replaceRE `\n(\d+). (.+?)` "\n* $2" -}}
|
||||
{{ $content := $content | replaceRE `\[\^(.+?)\]:?` "" -}}
|
||||
{{ $content := $content | replaceRE `<br/??>` "\n" -}}
|
||||
{{ $content := $content | replaceRE `<a .*href="(.+?)".*>(.+?)</a>` "[$2]($1)" -}}
|
||||
{{ $content := $content | replaceRE `\sgemini://(\S*)` " [gemini://$1](gemini://$1)" -}}
|
||||
{{ $content := $content | replaceRE `{{< audio "(.+?)" >}}` "=> https://brainbaking.com/$1 Embedded Audio link - $1" -}}
|
||||
{{ $content := $content | replaceRE `{{< video "(.+?)" >}}` "=> https://brainbaking.com/$1 Embedded Video link - $1" -}}
|
||||
{{ $content := $content | replaceRE `{{< youtube (.+?) >}}` "=> https://www.youtube.com/watch?v=$1 YouTube link to $1" -}}
|
||||
{{ $content := $content | replaceRE `!\[.*\]\((.+?) \"(.+?)\"\)` "=> $1 Image: $2" -}}
|
||||
{{ $content := $content | replaceRE `<.*?>` "" -}}
|
||||
{{ $content := $content | replaceRE `\n\n!\[.*\]\((.+?) \"(.+?)\"\)` "\n\n=> $1 Image: $2" -}}
|
||||
{{ $content := $content | replaceRE `\n\n!\[.*]\((.+?)\)` "\n\n=> $1 Embedded Image: $1" -}}
|
||||
{{ $links := findRE `\n=> ` $content }}{{ $scratch.Set "ref" (add (len $links) 1) }}
|
||||
{{ $refs := findRE `\[.+?\]\(.+?\)` $content }}
|
||||
{{ $scratch.Set "content" $content }}{{ range $refs }}{{ $ref := $scratch.Get "ref" }}{{ $contentInLoop := $scratch.Get "content" }}{{ $url := (printf "%s #%d" . $ref) }}{{ $contentInLoop := replace $contentInLoop . $url -}}{{ $scratch.Set "content" $contentInLoop }}{{ $scratch.Set "ref" (add $ref 1) }}{{ end }}{{ $content := $scratch.Get "content" | replaceRE `\[(.+?)\]\((.+?)\) #(\d+)` "$1 [$3]" -}}
|
||||
{{ $content }}
|
||||
{{ $content | safeHTML }}
|
||||
|
||||
---
|
||||
Written by Wouter Groeneveld on {{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}.
|
||||
|
@ -31,5 +36,6 @@ Written by Wouter Groeneveld on {{ .Lastmod.Format (.Site.Params.dateFormat | de
|
|||
=> {{ replace .RelPermalink "/gemini" "" 1}} {{ .Title }}: {{ .Params.Subtitle }}{{ end }}{{ end }}
|
||||
---
|
||||
|
||||
=> {{ replace .Site.BaseURL "https" "gemini" }} Back to the Index
|
||||
=> / Back to the Index
|
||||
=> https://brainbaking.com{{ replace (replace .RelPermalink "/gemini" "" 1) "index.gmi" "" }} View this article on the WWW
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ Behold my freshly baked thoughts for you to enjoy. If you'd like, you can subscr
|
|||
{{ range .Pages.GroupByDate "January" }}
|
||||
### {{ .Key }} {{ $year }}
|
||||
{{ range .Pages.ByDate.Reverse }}
|
||||
=> {{ replace .Permalink "/gemini" "" 1}} {{ .Date.Format ("02") }} - {{ .Title }}
|
||||
=> {{ replace .RelPermalink "/gemini" "" 1}} {{ .Date.Format ("02") }} - {{ .Title }}
|
||||
{{ .Params.Subtitle }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -56,4 +56,4 @@ Go on. Have a snack. How about some chocolate?
|
|||
\|______________________;________________|
|
||||
```
|
||||
|
||||
|
||||
=> https://brainbaking.com Brain Baking on the WWW
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<script defer src="{{"mermaid/mermaid.min.js" | relURL}}">
|
||||
mermaid.initialize({
|
||||
startOnLoad: true,
|
||||
flowchart: {
|
||||
useMaxWidth: true
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="mermaid" align="{{ if .Get "align" }}{{ .Get "align" }}{{ else }}center{{ end }}" >
|
||||
{{ safeHTML .Inner }}
|
||||
</div>
|
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -21,7 +21,7 @@
|
|||
<svg class='icon icon-text' width='24' height='24'>
|
||||
<title>Back to top</title>
|
||||
<use xlink:href='#up'></use>
|
||||
</svg><a href="#header">Top</a>
|
||||
</svg><a href="#header">Top</a> | <a href="gemini://brainbaking.com{{ .RelPermalink }}">Read on Gemini</a>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
<footer>
|
||||
|
||||
<p class="copyright text-muted">{{ .Site.Params.copyright | default "© All rights reserved. Powered by [Hugo](https://gohugo.io) and [Minimal](https://github.com/calintat/minimal)" | markdownify }}</p>
|
||||
<p class="copyright text-muted">{{ .Site.Params.copyright | markdownify }}</p>
|
||||
|
||||
</footer>
|
||||
|
||||
|
|
Loading…
Reference in New Issue