feat(image): add image lightgallery
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<figure>
|
||||
{{- partial "plugin/image.html" (dict "src" .Destination "alt" .Text "title" .Title ) -}}
|
||||
{{- with .Title | default .Text -}}
|
||||
{{- $lightgallery := ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}}
|
||||
{{- partial "plugin/image.html" (dict "src" .Destination "title" .Title "description" .Text "lightgallery" $lightgallery "context" .Page) -}}
|
||||
{{- with (.Title | default .Text) -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . | safeHTML -}}
|
||||
</figcaption>
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
{{- errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- .Scratch.Set "scratch" $scratch -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" -}}
|
||||
{{- .Scratch.Set "production" true -}}
|
||||
{{- .Scratch.Set "CDN" .Site.Params.cdn -}}
|
||||
{{- $scratch.Set "production" true -}}
|
||||
{{- $scratch.Set "CDN" .Site.Params.cdn -}}
|
||||
{{- end -}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</h1>
|
||||
|
||||
{{- /* Content */ -}}
|
||||
<div class="content">
|
||||
<div class="content" id="content">
|
||||
{{- partial "single/content.html" .Content -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{- with .Params.featuredImage -}}
|
||||
<div class="featured-image-preview">
|
||||
{{- $image := $.Params.featuredImagePreview | default . -}}
|
||||
{{- partial "plugin/image.html" (dict "src" $image "alt" "featured image") -}}
|
||||
{{- partial "plugin/image.html" (dict "src" $image "description" $.Description "context" $) -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user