fixing links after new hugo !publish!...

This commit is contained in:
Marcell Mars 2020-03-16 12:08:41 +01:00
parent d734c12928
commit 10e6ec1125
2 changed files with 32 additions and 29 deletions

View File

@ -16,24 +16,24 @@
{{ if $.Page.Site.GetPage $s_destination }}
{{ $session := $.Page.Site.GetPage $s_destination }}
{{ if not $text_link }}
<a href="/session/{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $session.Title}} title="{{ $session.Title }}"{{ end }}>{{ $session.Title }}</a>
<a href="{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $session.Title}} title="{{ $session.Title }}"{{ end }}>{{ $session.Title }}</a>
{{ else }}
<a href="/session/{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
<a href="{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
{{ end }}
{{ else }}
<a href="/session/{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">session:{{ $s_destination }} not found</span></a>
<a href="{{ $s_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">session:{{ $s_destination }} not found</span></a>
{{ end }}
{{ else if strings.HasPrefix .Destination "topic:" }}
{{ $t_destination := printf "/topic/%s" (substr .Destination 6) }}
{{ if $.Page.Site.GetPage $t_destination }}
{{ $topic := $.Page.Site.GetPage $t_destination }}
{{ if not $text_link }}
<a href="/topic/{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $topic.Title}} title="{{ $topic.Title }}"{{ end }}>{{ $topic.Title }}</a>
<a href="{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with $topic.Title}} title="{{ $topic.Title }}"{{ end }}>{{ $topic.Title }}</a>
{{ else }}
<a href="/topic/{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
<a href="{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ $text_link }}</a>
{{ end }}
{{ else }}
<a href="/topic/{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">topic:{{ $t_destination }} not found</span></a>
<a href="{{ $t_destination }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $text_link }}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">topic:{{ $t_destination }} not found</span></a>
{{ end }}
{{ else if findRE "^.*static" .Destination }}
<img src="{{ (replaceRE "^.*static" "" .Destination ) | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />

View File

@ -1,16 +1,8 @@
<title>{{ block "title" . }}
{{- .Title }} - {{ .Site.Title -}}
{{ end }}</title>
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<head>
<meta charset="utf-8" />
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<meta charset="utf-8" />
{{ if .Description }}
<meta name="description" content="{{ .Description }}" />
{{ end }}
@ -20,6 +12,17 @@
{{ if .Params.Author }}
<meta name="author" content="{{ .Params.Author}}" />
{{ end }}
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ hugo.Generator }}
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#996561">
<title>{{ block "title" . }}{{- .Title }} - {{ .Site.Title -}}{{ end }}</title>
</head>