From e2aff35eb02e501640987e72a08b40a32120204d Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Sun, 20 Mar 2022 02:31:00 -0400 Subject: generators/hugo/layouts/_markup/render-image: Deprecate image shortcodes Add render image hook and carefully slip figures into content. Image shortcodes can now be replaced with markdown and eventually removed. --- .../tdro/layouts/_default/_markup/render-image.html | 18 ++++++++++++++++++ .../hugo/themes/tdro/layouts/_default/single.html | 9 ++++++++- public/css/tdro.css | 7 +------ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 generators/hugo/themes/tdro/layouts/_default/_markup/render-image.html diff --git a/generators/hugo/themes/tdro/layouts/_default/_markup/render-image.html b/generators/hugo/themes/tdro/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..b5deec5 --- /dev/null +++ b/generators/hugo/themes/tdro/layouts/_default/_markup/render-image.html @@ -0,0 +1,18 @@ +{{ $imageFile := print "public" (.Destination | safeURL) }} +{{ $image := imageConfig $imageFile }} +{{- /* This comment removes trailing newlines. */ -}} +
+ + {{ $.Text }} + +
+ {{ $.Title | markdownify }} +
+
+{{- /* This comment removes trailing newlines. */ -}} diff --git a/generators/hugo/themes/tdro/layouts/_default/single.html b/generators/hugo/themes/tdro/layouts/_default/single.html index 572b90a..df33970 100644 --- a/generators/hugo/themes/tdro/layouts/_default/single.html +++ b/generators/hugo/themes/tdro/layouts/_default/single.html @@ -21,7 +21,14 @@ {{- partial "page-status.html" . -}} - {{- .Content | replaceRE "

" "

" | replaceRE "\n

" "
" | + replaceRE "

" "
" | + replaceRE "

" "

" | + replaceRE " diff --git a/public/css/tdro.css b/public/css/tdro.css index a0c2753..9df79df 100644 --- a/public/css/tdro.css +++ b/public/css/tdro.css @@ -505,11 +505,6 @@ ul { text-align: center; } -.content figure a { - display: inline-block; - width: 100%; -} - .content sup, .content sub { font-size: 75%; @@ -1425,7 +1420,7 @@ ol li:before { position: absolute; } -figure a, +figure > a, .navbar-item, .webring a, .article__more__content a, -- cgit v1.2.3