Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions assets/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ div.feature-matrix {
vertical-align: center;
}
}
footer nav ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-wrap: wrap;
gap: 0.5em 1em;
}
footer nav ul li a {
text-decoration: none;
}
@media screen and (max-width: 450px) {
big {
font-size: 300%;
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<link rel="icon" href="{{ relURL "favicon.ico" }}">
{{- $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "main.scss" . | css.Sass }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{- partial "breadcrumbs.html" . -}}
</head>
<body>
{{ partial "banner.html" . -}}
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ define "main" }}
{{ .Content | replaceRE "(<h2 id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1} <a href="#${2}">#</a> ${3}` | safeHTML }}
{{ partial "footer.html" . }}
{{ end }}
1 change: 1 addition & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<div class="block">
{{ .Content }}
</div>
{{ partial "footer.html" . }}
{{ end }}
20 changes: 20 additions & 0 deletions layouts/partials/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "{{ .Site.BaseURL }}"
}{{ if ne .Kind "home" }},
{
"@type": "ListItem",
"position": 2,
"name": "{{ .Title }}",
"item": "{{ .Permalink }}"
}{{ end }}
]
}
</script>
10 changes: 10 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<footer>
<hr>
<nav>
<ul>
<li><a href="{{ relURL "/" }}">Home</a></li>
<li><a href="{{ relURL "architecture/" }}">Architecture</a></li>
<li><a href="{{ relURL "reply-to-this/" }}">Reply to this</a></li>
</ul>
</nav>
</footer>
5 changes: 4 additions & 1 deletion script/graphviz-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import Viz from "../static/js/viz-global.js"
for (const { Path: pathInPublic } of JSON.parse(readFileSync("public/diagram-list.json", "utf-8"))) {
const path = `public${pathInPublic}.html`
const contents = readFileSync(path, "utf-8")
const html = parse(contents)
// `node-html-parser` can misparse unquoted URLs ending in `/` (e.g. `href=../architecture/`)
// and rewrite links as empty anchors. Quote these attribute values before parsing.
const normalized = contents.replace(/\b(href|src)=([^"'`\s>]+)/g, '$1="$2"')
const html = parse(normalized)
const vizImport = html.querySelector('script[src$="viz-global.js"]')
if (!vizImport) {
console.error(`No 'viz-global.js' import found in ${path}; skipping`)
Expand Down