mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 20:50:40 +00:00
fix: use absolute ULRs in img shortcode (#196)
This commit is contained in:
parent
e5b269fb36
commit
eb17b172ed
@ -28,7 +28,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</header>
|
</header>
|
||||||
<section class="gblog-markdown">
|
<section class="gblog-markdown">
|
||||||
{{ partial "content" . }}
|
{{ partial "utils/content" . }}
|
||||||
</section>
|
</section>
|
||||||
</article>
|
</article>
|
||||||
{{ end }}
|
{{ 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 }}
|
{{ with $source }}
|
||||||
{{ $caption := default .Title $customAlt }}
|
{{ $caption := default .Title $customAlt }}
|
||||||
|
|
||||||
{{ $tiny := (.Resize "320x").RelPermalink }}
|
{{ $tiny := (.Resize "320x").Permalink }}
|
||||||
{{ $small := (.Resize "600x").RelPermalink }}
|
{{ $small := (.Resize "600x").Permalink }}
|
||||||
{{ $medium := (.Resize "1200x").RelPermalink }}
|
{{ $medium := (.Resize "1200x").Permalink }}
|
||||||
{{ $large := (.Resize "1800x").RelPermalink }}
|
{{ $large := (.Resize "1800x").Permalink }}
|
||||||
|
|
||||||
{{ $size := dict "tiny" $tiny "small" $small "medium" $medium "large" $large }}
|
{{ $size := dict "tiny" $tiny "small" $small "medium" $medium "large" $large }}
|
||||||
|
|
||||||
|
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<figure class="gblog-post__figure">
|
<figure class="gblog-post__figure">
|
||||||
<a class="gblog-markdown__link--raw" href="{{ .RelPermalink }}">
|
<a class="gblog-markdown__link--raw" href="{{ .Permalink }}">
|
||||||
<picture>
|
<picture>
|
||||||
<source
|
<source
|
||||||
{{ with $customSize }}
|
{{ with $customSize }}
|
||||||
|
Loading…
Reference in New Issue
Block a user