feat(rss): add rssFullText param for RSS (#301)

This commit is contained in:
Dillon
2020-05-01 23:29:24 +08:00
committed by GitHub
parent 5b689bf29b
commit e3e3bdf9ee
32 changed files with 113 additions and 127 deletions

View File

@@ -1,5 +1,5 @@
{{- $content := .Inner | transform.Unmarshal | jsonify -}}
{{- $id := partial "function/id.html" (dict "content" $content "scratch" .Page.Scratch) -}}
{{- $id := dict "content" $content "scratch" .Page.Scratch | partial "function/id.html" -}}
{{- $width := cond .IsNamedParams (.Get "width") (.Get 0) | default "100%" -}}
{{- $height := cond .IsNamedParams (.Get "height") (.Get 1) | default "30rem" -}}
<div class="echarts" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>

View File

@@ -28,6 +28,6 @@
{{- end -}}
{{- $darkStyle = $darkStyle | default $lightStyle -}}
{{- $options := dict "lng" $lng "lat" $lat "zoom" $zoom "marked" $marked "lightStyle" $lightStyle "darkStyle" $darkStyle "geolocate" $geolocate "navigation" $navigation "scale" $scale "fullscreen" $fullscreen -}}
{{- $id := partial "function/id.html" (dict "content" $options "scratch" .Page.Scratch) -}}
{{- $id := dict "content" $options "scratch" .Page.Scratch | partial "function/id.html" -}}
<div class="mapbox" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
{{- .Page.Scratch.SetInMap "this" "mapbox" true -}}

View File

@@ -1,3 +1,3 @@
{{- $id := partial "function/id.html" (dict "content" (trim .Inner "\n") "scratch" .Page.Scratch) -}}
{{- $id := dict "content" (trim .Inner "\n") "scratch" .Page.Scratch | partial "function/id.html" -}}
<div class="mermaid" id="{{ $id }}"></div>
{{- .Page.Scratch.SetInMap "this" "mermaid" true -}}

View File

@@ -1,5 +1,5 @@
{{- $content := .Inner | .Page.RenderString -}}
{{- $id := partial "function/id.html" (dict "content" $content) -}}
{{- $id := dict "content" $content | partial "function/id.html" -}}
{{- $tag := .Get 1 | default "div" -}}
{{- printf `<%s id="%s">%s</%s>` $tag $id $content $tag | safeHTML -}}

View File

@@ -20,7 +20,7 @@
{{- /* trim the newline */ -}}
{{- $content = trim $content "\n" -}}
{{- $id := partial "function/id.html" (dict "content" $content "scratch" .Page.Scratch) -}}
{{- $id := dict "content" $content "scratch" .Page.Scratch | partial "function/id.html" -}}
{{- $key := .Get "group" | string | default $id -}}
{{- $typeitMap := (.Page.Scratch.Get "this").typeitMap | default dict -}}
{{- $group := index $typeitMap $key -}}

View File

@@ -8,4 +8,6 @@
{{- $res := resources.Get "svg/version.template.svg" -}}
{{- $res = $res | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
{{- $alt := printf "LoveIt %s | %s" $label $version -}}
<a href="{{ $url }}" rel="noopener noreffer" target="_blank">{{ partial "plugin/image.html" (dict "src" $res.RelPermalink "alt" $alt "class" "version") }}</a>
<a href="{{ $url }}" rel="noopener noreffer" target="_blank">
{{- dict "src" $res.RelPermalink "alt" $alt "class" "version" | partial "plugin/image.html" -}}
</a>