fix: use absolute ULRs in img shortcode (#196)

This commit is contained in:
Robert Kaussow 2022-02-06 23:57:32 +01:00 committed by GitHub
parent e5b269fb36
commit eb17b172ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View File

@ -28,7 +28,7 @@
{{ end }}
</header>
<section class="gblog-markdown">
{{ partial "content" . }}
{{ partial "utils/content" . }}
</section>
</article>
{{ end }}

View File

@ -1,4 +0,0 @@
{{- $content := .Content -}}
{{- $content = $content | replaceRE `<nav id="TableOfContents">\s*<ul>\s*<li>\s*<ul>` `<nav id="TableOfContents"><ul>` | replaceRE `</ul>\s*</li>\s*</ul>\s*</nav>` `</ul></nav>` | safeHTML -}}
{{- $content = $content | replaceRE `(<table>(?:.|\n)+?</table>)` `<div class=table-wrap> ${1} </div>` | safeHTML -}}
{{- $content -}}

View File

@ -0,0 +1,6 @@
{{ $html := .Content }}
{{ $html = $html | replaceRE `<nav id="TableOfContents">\s*<ul>\s*<li>\s*<ul>` `<nav id="TableOfContents"><ul>` | replaceRE `</ul>\s*</li>\s*</ul>\s*</nav>` `</ul></nav>` | safeHTML }}
{{ $html = $html | replaceRE `(<table>(?:.|\n)+?</table>)` `<div class=table-wrap> ${1} </div>` | safeHTML }}
{{ return $html }}

View File

@ -6,17 +6,17 @@
{{ with $source }}
{{ $caption := default .Title $customAlt }}
{{ $tiny := (.Resize "320x").RelPermalink }}
{{ $small := (.Resize "600x").RelPermalink }}
{{ $medium := (.Resize "1200x").RelPermalink }}
{{ $large := (.Resize "1800x").RelPermalink }}
{{ $tiny := (.Resize "320x").Permalink }}
{{ $small := (.Resize "600x").Permalink }}
{{ $medium := (.Resize "1200x").Permalink }}
{{ $large := (.Resize "1800x").Permalink }}
{{ $size := dict "tiny" $tiny "small" $small "medium" $medium "large" $large }}
<div class="flex justify-center">
<figure class="gblog-post__figure">
<a class="gblog-markdown__link--raw" href="{{ .RelPermalink }}">
<a class="gblog-markdown__link--raw" href="{{ .Permalink }}">
<picture>
<source
{{ with $customSize }}