mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 12:40:39 +00:00
fix: use absolute ULRs in img shortcode (#196)
This commit is contained in:
parent
e5b269fb36
commit
eb17b172ed
@ -28,7 +28,7 @@
|
||||
{{ end }}
|
||||
</header>
|
||||
<section class="gblog-markdown">
|
||||
{{ partial "content" . }}
|
||||
{{ partial "utils/content" . }}
|
||||
</section>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
@ -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 -}}
|
6
layouts/partials/utils/content.html
Normal file
6
layouts/partials/utils/content.html
Normal 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 }}
|
@ -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 }}
|
||||
|
Loading…
Reference in New Issue
Block a user