Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thegeeklab/hugo-geekblog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kaussow <mail@thegeeklab.de>2022-02-07 01:57:32 +0300
committerGitHub <noreply@github.com>2022-02-07 01:57:32 +0300
commiteb17b172ed52870d81457f0a8de2f5dcfdd3d8f5 (patch)
tree20950cb26b4bdd0b06c136327e40a3df43c54126 /layouts
parente5b269fb366c069653b59a38f6def73b03904d2f (diff)
fix: use absolute ULRs in img shortcode (#196)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/partials/content.html4
-rw-r--r--layouts/partials/utils/content.html6
-rw-r--r--layouts/shortcodes/img.html10
4 files changed, 12 insertions, 10 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 5425701..84d0be3 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -28,7 +28,7 @@
{{ end }}
</header>
<section class="gblog-markdown">
- {{ partial "content" . }}
+ {{ partial "utils/content" . }}
</section>
</article>
{{ end }}
diff --git a/layouts/partials/content.html b/layouts/partials/content.html
deleted file mode 100644
index 0aff871..0000000
--- a/layouts/partials/content.html
+++ /dev/null
@@ -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 -}}
diff --git a/layouts/partials/utils/content.html b/layouts/partials/utils/content.html
new file mode 100644
index 0000000..784632f
--- /dev/null
+++ b/layouts/partials/utils/content.html
@@ -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 }}
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
index a316317..42db633 100644
--- a/layouts/shortcodes/img.html
+++ b/layouts/shortcodes/img.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 }}