mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-23 18:10:52 +02:00
feat: support latest Hugo to fix Markdown links no longer rendering
This commit is contained in:
parent
adc14f11d2
commit
4fe544d8c2
3 changed files with 25 additions and 17 deletions
|
@ -90,7 +90,6 @@ outputFormats:
|
|||
baseName: backlinks
|
||||
isPlainText: true
|
||||
notAlternative: true
|
||||
weight: 1
|
||||
params:
|
||||
locale:
|
||||
date_format: 'Jan 2, 2006'
|
||||
|
|
|
@ -1,2 +1,8 @@
|
|||
{{- /* Hugo 0.126 requires a `home` layout even if it serves no purpose, otherwise shows warning */ -}}
|
||||
{{- jsonify dict -}}
|
||||
{{- /* Hugo 0.126+ requires a `home` layout file even if it's empty, otherwise shows warning */ -}}
|
||||
{{- if (eq (getenv "HUGO_BLOX_DEBUG") "true") -}}
|
||||
{{- range site.Pages -}}{{- $_ := .WordCount -}}{{- end -}}
|
||||
{{- $backlinks := (.Store.Get "backlinks" | uniq) | default dict -}}
|
||||
{{- jsonify (dict "indent" " ") $backlinks -}}
|
||||
{{- else -}}
|
||||
{{- jsonify dict -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,19 +1,22 @@
|
|||
{{ $show_backlinks := .Params.backlinks | default true }}
|
||||
{{ if $show_backlinks }}
|
||||
{{ $backlinks := site.Home.Store.Get "backlinks" | uniq }}
|
||||
{{ with (where $backlinks "links_to" .RelPermalink) }}
|
||||
<div class="backlinks">
|
||||
<div class="mb-1 font-semibold tracking-tight">
|
||||
{{ (T "backlinks") | default "Backlinks" }}
|
||||
{{ $defer_globals := (dict "page" . )}}
|
||||
{{ with (templates.Defer (dict "data" $defer_globals )) }}
|
||||
{{ $backlinks := (site.Home.Store.Get "backlinks" | uniq) | default dict }}
|
||||
{{ with (where $backlinks "links_to" .page.RelPermalink) }}
|
||||
<div class="backlinks">
|
||||
<div class="mb-1 font-semibold tracking-tight">
|
||||
{{ (T "backlinks") | default "Backlinks" }}
|
||||
</div>
|
||||
<ul>
|
||||
{{ range (sort . "page.date" "desc") }}
|
||||
{{ $page := .page }}
|
||||
<li>
|
||||
<a href="{{ $page.relPermalink }}" class="backlink">{{ $page.linkTitle }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
<ul>
|
||||
{{ range (sort . "page.date" "desc") }}
|
||||
{{ $page := .page }}
|
||||
<li>
|
||||
<a href="{{ $page.relPermalink }}" class="backlink">{{ $page.linkTitle }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue