Compare commits

...

2 commits

Author SHA1 Message Date
c972ba9776 report broken links 2025-04-21 12:27:03 +02:00
4eb19e8b3e styling 2025-04-21 12:26:56 +02:00
2 changed files with 19 additions and 14 deletions

View file

@ -4,24 +4,26 @@
{{- $u := urls.Parse $destination -}}
{{- if not $u.Scheme -}}
{{- with site.GetPage .Destination -}}
{{- $backlinks := .Store.Get "backlinks" | default slice -}}
{{- $page := site.GetPage $destination -}}
{{- if $page -}}
{{- $backlinks := $page.Store.Get "backlinks" | default slice -}}
{{- $backlinks := $backlinks|append $currentPage.RelPermalink -}}
{{- .Store.Set "backlinks" ($backlinks|uniq) -}}
{{- $page.Store.Set "backlinks" ($backlinks|uniq) -}}
{{- if not $text -}}
{{- $text = .LinkTitle -}}
{{- $text = $page.LinkTitle -}}
{{- end -}}
<span class="supt">{{- .Section -}}</span><a href="{{- .RelPermalink -}}" {{- with .Title }} title="{{ . }}"{{ end -}}>{{- $text -}}</a>
{{- end -}}
{{- if hasPrefix $destination "/library" -}}
<span class="supt">{{- $page.Section -}}</span><a href="{{- $page.RelPermalink -}}" {{- with $page.Title }} title="{{ . }}"{{ end -}}>{{- $text -}}</a>
{{- else if hasPrefix $destination "/library" -}}
{{- $bib := strings.TrimPrefix "/library/" $destination -}}
{{- $b := index site.Data.books.catalog $bib -}}
{{- if not $text -}}
{{- $text = $b.title|default "" -}}
{{- end -}}
<span class="supt">library</span><a href="/library/BROWSE_LIBRARY.html#/books/{{- $bib -}}">{{- $text -}}</a>
{{- else -}}
{{- warnf "In %s broken link: %s" $currentPage.RelPermalink $destination -}}
{{- end -}}
{{- else -}}
<span class="supt">www</span><a href="{{ .Destination | safeURL }}"{{- with .Title }} title="{{ . }}"{{ end -}}{{- if $u.IsAbs }} rel="external"{{ end -}}>{{- with .Text }}{{ . }}{{- end -}}</a>
<span class="supt">www</span><a href="{{ .Destination | safeURL }}"{{- with .Title }} title="{{ . }}"{{ end -}}{{- if $u.IsAbs }} rel="external"{{ end -}}>{{- if .Text }}{{ .Text }}{{- else -}}{{- .Destination -}}{{- end -}}</a>
{{- end -}}
{{- /* chomp trailing newline */ -}}

View file

@ -373,7 +373,7 @@ blockquote {
padding-left: 3rem;
padding-right: 10rem;
width: 100%;
max-width: 720px;
max-width: 800px;
padding-top: 0.5rem;
font-size: 1.4rem;
@ -395,10 +395,9 @@ blockquote {
display: grid;
grid-template-rows: auto auto 1fr;
grid-template-areas: "title" "menu" "article";
margin-top: 4rem;
padding-left: 3rem;
padding-right: 10rem;
max-width: 720px;
max-width: 800px;
}
.title {
@ -406,7 +405,7 @@ blockquote {
margin-top: 4rem;
font-style: italic;
font-size: 2rem;
margin-bottom: 4rem;
margin-bottom: 6rem;
}
.supt {
@ -428,7 +427,7 @@ blockquote {
grid-area: menu;
margin-bottom: 2rem;
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-columns: minmax(0, auto) minmax(0, auto);
}
.toc {
@ -438,6 +437,10 @@ blockquote {
position: relative;
}
.toc:empty + .graph-menus {
grid-column: 1/-1;
}
#TableOfContents {
margin-left: -2rem;
margin-top: -1.5rem;
@ -466,7 +469,7 @@ nav#TableOfContents ol li a:hover {
}
.graph-menu {
display: inline-grid;
display: flex;
grid-auto-rows: max-content;
font-size: 1.4rem;
font-style: italic;