render links adds to mentioned in
This commit is contained in:
parent
b64d06b942
commit
4d482d9908
4 changed files with 41 additions and 13 deletions
|
@ -25,6 +25,6 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<h{{ add 1 .Level }} id="{{ .Anchor | safeURL }}" class="hx css-{{ .Page.File.UniqueID }}-h{{ add 1 .Level }}"><span class="counters">{{ $counter }} </span>{{ .Text | safeHTML }}<a class="hpar" href="#{{ .Anchor | safeURL }}">¶</a> {{ .Page.Store.Get "level" }}</h{{ add 1 .Level }}>
|
<h{{ add 1 .Level }} id="{{ .Anchor | safeURL }}" class="hx css-{{ .Page.File.UniqueID }}-h{{ add 1 .Level }}"><span class="counters">{{ $counter }} </span>{{ .Text | safeHTML }}<a class="hpar" href="#{{ .Anchor | safeURL }}"></a> {{ .Page.Store.Get "level" }}</h{{ add 1 .Level }}>
|
||||||
|
|
||||||
{{ .Page.Store.Set "previousLevel" .Level }}
|
{{ .Page.Store.Set "previousLevel" .Level }}
|
||||||
|
|
|
@ -1,16 +1,27 @@
|
||||||
{{- $currentPage := .Page -}}
|
{{- $currentPage := .Page -}}
|
||||||
{{- $u := urls.Parse .Destination -}}
|
{{- $text := .Text -}}
|
||||||
|
{{- $destination := .Destination -}}
|
||||||
|
|
||||||
|
{{- $u := urls.Parse $destination -}}
|
||||||
{{- if not $u.Scheme -}}
|
{{- if not $u.Scheme -}}
|
||||||
{{- with site.GetPage .Destination -}}
|
{{- with site.GetPage .Destination -}}
|
||||||
{{- $backlinks := .Store.Get "backlinks" | default slice -}}
|
{{- $backlinks := .Store.Get "backlinks" | default slice -}}
|
||||||
{{- $backlinks := $backlinks|append $currentPage.RelPermalink -}}
|
{{- $backlinks := $backlinks|append $currentPage.RelPermalink -}}
|
||||||
{{- .Store.Set "backlinks" ($backlinks|uniq) -}}
|
{{- .Store.Set "backlinks" ($backlinks|uniq) -}}
|
||||||
|
{{- if not $text -}}
|
||||||
|
{{- $text = .LinkTitle -}}
|
||||||
|
{{- end -}}
|
||||||
|
<span class="supt">{{- .Section -}}⁄</span><a href="{{- .RelPermalink -}}" {{- with .Title }} title="{{ . }}"{{ end -}}>{{- $text -}}</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- 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>
|
||||||
|
{{- 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>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<a href="{{ .Destination | safeURL }}"
|
|
||||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
|
||||||
{{- if $u.IsAbs }} rel="external"{{ end -}}
|
|
||||||
>
|
|
||||||
{{- with .Text }}{{ . }}{{ end -}}
|
|
||||||
</a>
|
|
||||||
{{- /* chomp trailing newline */ -}}
|
{{- /* chomp trailing newline */ -}}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{{ $currentPage := . }}
|
{{ $currentPage := . }}
|
||||||
{{ $currentPageGraph := $currentPage.Store.Get "graph"}}
|
{{ $currentPageGraph := $currentPage.Store.Get "graph"}}
|
||||||
|
|
||||||
{{ $data := (dict "allPages" site.AllPages "currentPage" $currentPage)}}
|
{{ $data := (dict "allPages" site.AllPages "currentPage" $currentPage)}}
|
||||||
{{- with (templates.Defer (dict "data" $data)) -}}
|
{{- with (templates.Defer (dict "data" $data)) -}}
|
||||||
{{ range $page := .allPages }}
|
{{ range $page := .allPages }}
|
||||||
|
@ -19,5 +18,6 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- partial "menu_isin.html" (dict "currentPage" .currentPage "isin" (.currentPage.Store.Get "isin")) -}}
|
{{- partial "menu_isin.html" (dict "currentPage" .currentPage "isin" (.currentPage.Store.Get "isin")) -}}
|
||||||
{{- partial "menu_mentioned_in.html" (dict "currentPage" .currentPage "mentioned_in" (.currentPage.Store.Get "mentioned_in")) -}}
|
{{- $mentionedInAll := union (.currentPage.Store.Get "mentioned_in") (.currentPage.Store.Get "backlinks") -}}
|
||||||
|
{{- partial "menu_mentioned_in.html" (dict "currentPage" .currentPage "mentioned_in" ($mentionedInAll|uniq)) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -16,7 +16,6 @@ hr {
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
h1,
|
||||||
h2,
|
|
||||||
h3,
|
h3,
|
||||||
h4,
|
h4,
|
||||||
h5,
|
h5,
|
||||||
|
@ -347,6 +346,22 @@ a:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 1.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
border-left: 1px red solid;
|
||||||
|
margin-left: 1rem;
|
||||||
|
margin-right: 2rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 2rem;
|
||||||
|
padding-top: 0.1rem;
|
||||||
|
padding-bottom: 0.1rem;
|
||||||
|
background-color: #fff9f9;
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -361,7 +376,8 @@ a:hover {
|
||||||
max-width: 720px;
|
max-width: 720px;
|
||||||
|
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
font-size: 1.1rem;
|
font-size: 1.4rem;
|
||||||
|
font-style: italic;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,7 +417,8 @@ a:hover {
|
||||||
cursive;
|
cursive;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
color: rgba(0, 0, 0, 0.8);
|
/* color: rgba(0, 0, 0, 0.8); */
|
||||||
|
color: red;
|
||||||
vertical-align: baseline;
|
vertical-align: baseline;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -0.3em;
|
top: -0.3em;
|
||||||
|
|
Loading…
Add table
Reference in a new issue