Initial commit.
This commit is contained in:
10
themes/blowfish/layouts/_default/_markup/render-heading.html
Normal file
10
themes/blowfish/layouts/_default/_markup/render-heading.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ $anchor := anchorize .Anchor }}
|
||||
<h{{ .Level }} class="relative group">{{ .Text | safeHTML }}
|
||||
<div id="{{ $anchor }}" class="anchor"></div>
|
||||
{{ if .Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}
|
||||
<span
|
||||
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
|
||||
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#{{ $anchor }}" aria-label="{{ i18n "article.anchor_label" }}">#</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</h{{ .Level }}>
|
||||
55
themes/blowfish/layouts/_default/_markup/render-image.html
Normal file
55
themes/blowfish/layouts/_default/_markup/render-image.html
Normal file
@@ -0,0 +1,55 @@
|
||||
{{ define "RenderImageSimple" -}}
|
||||
<img class="my-0 rounded-md" loading="lazy" alt="{{ .alt }}" src="{{ .src }}">
|
||||
{{- end }}
|
||||
|
||||
{{ define "RenderImageResponsive" -}}
|
||||
<img
|
||||
class="my-0 rounded-md"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
fetchpriority="low"
|
||||
alt="{{ .alt }}"
|
||||
srcset="
|
||||
{{ (.resource.Resize "330x").RelPermalink }} 330w,
|
||||
{{ (.resource.Resize "660x").RelPermalink }} 660w,
|
||||
{{ (.resource.Resize "1280x").RelPermalink }} 1280w
|
||||
"
|
||||
data-zoom-src="{{ .resource.RelPermalink }}"
|
||||
src="{{ .resource.RelPermalink }}">
|
||||
{{- end }}
|
||||
|
||||
{{ define "RenderImageCaption" -}}
|
||||
{{- with .caption }}
|
||||
<figcaption>{{ . | markdownify }}</figcaption>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $disableImageOptimizationMD := .Page.Site.Params.disableImageOptimizationMD | default false }}
|
||||
{{- $url := urls.Parse .Destination }}
|
||||
{{- $altText := .Text }}
|
||||
{{- $caption := .Title }}
|
||||
{{- $isRemote := findRE "^https?" $url.Scheme }}
|
||||
{{- $resource := "" }}
|
||||
|
||||
{{- if not $isRemote }}
|
||||
{{- $resource = or ($.Page.Resources.GetMatch $url.String) (resources.Get $url.String) }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
<figure>
|
||||
{{- if $isRemote }}
|
||||
{{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }}
|
||||
{{- else if $resource }}
|
||||
{{- $isSVG := eq $resource.MediaType.SubType "svg" }}
|
||||
{{- $shouldOptimize := and (not $disableImageOptimizationMD) (not $isSVG) }}
|
||||
{{- if $shouldOptimize }}
|
||||
{{ template "RenderImageResponsive" (dict "resource" $resource "alt" $altText) }}
|
||||
{{- else }}
|
||||
{{ template "RenderImageSimple" (dict "src" $resource.RelPermalink "alt" $altText) }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }}
|
||||
{{- end }}
|
||||
|
||||
{{ template "RenderImageCaption" (dict "caption" $caption) }}
|
||||
</figure>
|
||||
11
themes/blowfish/layouts/_default/_markup/render-link.html
Normal file
11
themes/blowfish/layouts/_default/_markup/render-link.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<a
|
||||
href="{{ .Destination | safeURL }}"
|
||||
{{- with .Title -}}
|
||||
title="{{ . }}"
|
||||
{{- end }}
|
||||
{{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }}
|
||||
target="_blank"
|
||||
{{ end }}>
|
||||
{{- .Text | safeHTML -}}
|
||||
</a>
|
||||
{{- /* Trim EOF */ -}}
|
||||
Reference in New Issue
Block a user