mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
feat(shortcodes): replace [align]/[float] with [style] and add [style]
This commit is contained in:
parent
aaff1514db
commit
f8a7fd1df9
8 changed files with 24 additions and 33 deletions
|
@ -321,26 +321,6 @@
|
|||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.align-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.float-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.float-right {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
@import "../_partial/_single/footer";
|
||||
|
|
|
@ -393,11 +393,11 @@ Here is a story about love...
|
|||
int a = 1;
|
||||
{{< /typeit >}}
|
||||
|
||||
## Test Align
|
||||
## Test Style
|
||||
|
||||
{{% align right %}}
|
||||
{{< style "text-align: right">}}
|
||||
**Test Text**
|
||||
{{% /align %}}
|
||||
{{< /style >}}
|
||||
|
||||
## Test Katex
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{{- /* [left, center, right] */ -}}
|
||||
<div class={{ .Get 0 | printf "align-%s" }}>
|
||||
{{- .Inner | .Page.RenderString -}}
|
||||
</div>
|
|
@ -1,4 +0,0 @@
|
|||
{{- /* [left, right] */ -}}
|
||||
<div class={{ .Get 0 | printf "float-%s" }}>
|
||||
{{- .Inner | .Page.RenderString -}}
|
||||
</div>
|
16
layouts/shortcodes/image.html
Normal file
16
layouts/shortcodes/image.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||||
{{- $options := .Get "src" | dict "src" -}}
|
||||
{{- $options = .Get "src_s" | dict "src_s" | merge $options -}}
|
||||
{{- $options = .Get "src_l" | dict "src_l" | merge $options -}}
|
||||
{{- $options = .Get "title" | dict "title" | merge $options -}}
|
||||
{{- $options = .Get "description" | dict "description" | merge $options -}}
|
||||
{{- $lightgallery := ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}}
|
||||
{{- $options = $lightgallery | dict "lightgallery" | merge $options -}}
|
||||
{{- $options = .Page.Scratch.Get "scratch" | dict "scratch" | merge $options -}}
|
||||
{{- partial "plugin/image.html" $options -}}
|
||||
{{- with (.Get "title" | default .Get "description") -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . | safeHTML -}}
|
||||
</figcaption>
|
||||
{{- end -}}
|
||||
</figure>
|
3
layouts/shortcodes/style.html
Normal file
3
layouts/shortcodes/style.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{- $content := .Inner | .Page.RenderString -}}
|
||||
{{- $tag := .Get 1 | default "div" -}}
|
||||
{{- printf `<%s style="%s">%s</%s>` $tag ($.Get 0) $content $tag | safeHTML -}}
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"Target":"css/style.min.5313a7cd528e285a82280f60228e0e2501181a5445bde1bc99d7c7dbdb7a4767.css","MediaType":"text/css","Data":{"Integrity":"sha256-UxOnzVKOKFqCKA9gIo4OJQEYGlRFveG8mdfH29t6R2c="}}
|
||||
{"Target":"css/style.min.22797a679118d2eb3f376ecb55adbba6052c813ae165d44e004bbf861d5a1ed1.css","MediaType":"text/css","Data":{"Integrity":"sha256-Inl6Z5EY0us/N27LVa27pgUsgTrhZdROAEu/hh1aHtE="}}
|
Loading…
Reference in a new issue