feat: add social link for RSS and some configs (#250)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{{- $rel := "" -}}
|
||||
<a href="{{ .href }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }}{{ $rel = "noopener noreffer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .rel }} {{ . }}{{ end }}"{{ with .class }} class="{{ . }}"{{ end }}>
|
||||
<a href="{{ .href }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if (urls.Parse .href).Host | or .newtab }}{{ $rel = "noopener noreffer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .rel }} {{ . }}{{ end }}"{{ with .class }} class="{{ . }}"{{ end }}>
|
||||
{{- with .icon -}}
|
||||
{{- partial "plugin/icon.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{- else -}}
|
||||
{{- $src := .source -}}
|
||||
{{- $integrity := .integrity -}}
|
||||
{{- if strings.HasPrefix $src "http" | or (strings.HasPrefix $src "//") | not -}}
|
||||
{{- if (urls.Parse $src).Host | not -}}
|
||||
{{- $res := resources.Get $src -}}
|
||||
{{- with .template -}}
|
||||
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
|
||||
|
||||
@@ -427,6 +427,13 @@
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 062: RSS */ -}}
|
||||
{{- if .social.rss -}}
|
||||
{{- $options := dict "href" (relLangURL "/index.xml") "title" "RSS" "newtab" true "rel" "me" -}}
|
||||
{{- $options = dict "icon" (dict "class" "fas fa-rss fa-fw") | merge $options -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Custom */ -}}
|
||||
{{- with .social.Custom -}}
|
||||
{{- . | safeHTML -}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{- else -}}
|
||||
{{- $href := .source -}}
|
||||
{{- $integrity := .integrity -}}
|
||||
{{- if strings.HasPrefix $href "http" | not -}}
|
||||
{{- if (urls.Parse $href).Host | not -}}
|
||||
{{- $res := resources.Get $href -}}
|
||||
{{- with .template -}}
|
||||
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
|
||||
|
||||
Reference in New Issue
Block a user