diff options
Diffstat (limited to 'layouts/_default/_markup')
-rw-r--r-- | layouts/_default/_markup/render-codeblock.html | 20 | ||||
-rw-r--r-- | layouts/_default/_markup/render-image.html | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..21c5100 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1,20 @@ +{{- $class := .Attributes.class | default "" -}} +{{- $lang := .Attributes.lang | default .Type -}} +<div class="codeblock"> + <header> + <span class="codeblock-lang">{{ $lang }}</span> + <button + class="codeblock-copy" + data-id="codeblock-id-{{ .Ordinal }}" + data-copied-text="{{ T `article.codeblock.copied` }}" + > + {{ T `article.codeblock.copy` }} + </button> + </header> + <code id="codeblock-id-{{ .Ordinal }}" style="display:none;">{{- .Inner -}}</code> + {{- if transform.CanHighlight $lang -}} + <div class="{{ $class }}">{{- highlight .Inner $lang -}}</div> + {{- else -}} + <pre><code class="{{ $class }}">{{- .Inner -}}</code></pre> + {{- end -}} +</div> diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 0ed5584..5577736 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -17,7 +17,7 @@ {{- $Height = $image.Height -}} {{- $galleryImage = true -}} - {{- if (default true .Page.Site.Params.imageProcessing.content.enabled) -}} + {{- if .Page.Site.Params.imageProcessing.content.enabled -}} {{- $small := $image.Resize `480x` -}} {{- $big := $image.Resize `1024x` -}} {{- $Srcset = printf `%s 480w, %s 1024w` $small.RelPermalink $big.RelPermalink -}} |