[new options] rss options

updatePeriod, updateFrequency, fullContents
This commit is contained in:
zzossig 2020-02-17 22:43:44 +09:00
parent 33bf85a225
commit 8038beb8ad
7 changed files with 138 additions and 11 deletions

View File

@ -302,6 +302,11 @@ busuanziSiteUV = true # unique visitors (total number of visitors)
busuanziSitePV = true # site total page view count
busuanziPagePV = true # post view count
# rss
updatePeriod = "" # Possible values: 'hourly', 'daily', 'weekly', 'monthly', or 'yearly'.
updateFrequency = ""
fullContents = false
# comment
enableComment = true
disqus_shortname = ""

View File

@ -7,26 +7,54 @@
@include themify($themes) {
&-info {
background-color: rgba(215, 238, 249, 0.4);
border-left: 5px solid #bbdefb;
color: themed('dropdown-item-color');
&[data-dir="rtl"] {
border-right: 5px solid #bbdefb;
}
&[data-dir="ltr"] {
border-left: 5px solid #bbdefb;
}
}
&-success {
background-color: rgba(217, 239, 214, 0.4);
border-left: 5px solid #c8e6c9;
color: themed('dropdown-item-color');
&[data-dir="rtl"] {
border-right: 5px solid #c8e6c9;
}
&[data-dir="ltr"] {
border-left: 5px solid #c8e6c9;
}
}
&-warning {
background-color: rgba(255, 249, 196, 0.4);
border-left: 5px solid #ffeb3b;
color: themed('dropdown-item-color');
&[data-dir="rtl"] {
border-right: 5px solid #ffeb3b;
}
&[data-dir="ltr"] {
border-left: 5px solid #ffeb3b;
}
}
&-danger {
background-color: rgba(245, 221, 221, 0.4);
border-left: 5px solid #ffcdd2;
color: themed('dropdown-item-color');
&[data-dir="rtl"] {
border-right: 5px solid #ffcdd2;
}
&[data-dir="ltr"] {
border-left: 5px solid #ffcdd2;
}
}
}
}

View File

@ -75,6 +75,11 @@ busuanziSiteUV = true
busuanziSitePV = true
busuanziPagePV = true
# rss
updatePeriod = "" # Possible values: 'hourly', 'daily', 'weekly', 'monthly', or 'yearly'.
updateFrequency = ""
fullContents = false
# comment
enableComment = true
disqus_shortname = ""

View File

@ -1,5 +1,9 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
@ -9,7 +13,10 @@
<managingEditor>{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.email }}
<webMaster>{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}{{ with .Site.Params.updatePeriod }}
<sy:updatePeriod>{{.}}</sy:updatePeriod>{{end}}{{ with .Site.Params.updateFrequency }}
<sy:updateFrequency>{{.}}</sy:updateFrequency>{{end}}{{ with .Site.Params.myname }}
<dc:creator>{{.}}</dc:creator>{{end}}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
@ -29,6 +36,31 @@
{{ with .Site.Params.email }}<author>{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
{{ if .Site.Params.fullContents }}<content:encoded>{{ .Content | html }}</content:encoded>{{end}}
{{ with $.Params.image }}<media:content url="{{ .Permalink }}{{ .Params.image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ with $.Params.featured_image }}<media:content url="{{ .Permalink }}image/{{ .Params.featured_image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ with $.Params.meta_image }}<media:content url="{{ .Permalink }}image/{{ $.Params.meta_image }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ with .Params.tags }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
{{ with .Params.categories }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
{{ with .Params.series }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
</item>
{{ end }}
@ -42,6 +74,31 @@
{{ with .Site.Params.email }}<author>{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
{{ if .Site.Params.fullContents }}<content:encoded>{{ .Content | html }}</content:encoded>{{end}}
{{ with $.Params.image }}<media:content url="{{ .Permalink }}{{ .Params.image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ with $.Params.featured_image }}<media:content url="{{ .Permalink }}image/{{ .Params.featured_image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ with $.Params.meta_image }}<media:content url="{{ .Permalink }}image/{{ $.Params.meta_image }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ with .Params.tags }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
{{ with .Params.categories }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
{{ with .Params.series }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
</item>
{{ end }}

View File

@ -1,5 +1,9 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
@ -9,7 +13,10 @@
<managingEditor>{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.email }}
<webMaster>{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}{{ with .Site.Params.updatePeriod }}
<sy:updatePeriod>{{.}}</sy:updatePeriod>{{end}}{{ with .Site.Params.updateFrequency }}
<sy:updateFrequency>{{.}}</sy:updateFrequency>{{end}}{{ with .Site.Params.myname }}
<dc:creator>{{.}}</dc:creator>{{end}}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
@ -22,6 +29,31 @@
{{ with .Site.Params.email }}<author>{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
{{ if .Site.Params.fullContents }}<content:encoded><![CDATA[{{ .Content | html }}]]></content:encoded>{{end}}
{{ with $.Params.image }}<media:content url="{{ .Permalink }}{{ .Params.image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ with $.Params.featured_image }}<media:content url="{{ .Permalink }}image/{{ .Params.featured_image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ with $.Params.meta_image }}<media:content url="{{ .Permalink }}image/{{ $.Params.meta_image }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ with .Params.tags }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
{{ with .Params.categories }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
{{ with .Params.series }}
{{ range . }}
{{ with . }}
<category>{{.}}</category>
{{ end }}
{{ end }}
{{ end }}
</item>
{{ end }}
</channel>

View File

@ -2,5 +2,5 @@
{{- with .Get "theme" -}}alert-{{.}}{{- else -}}alert-info{{- end -}}
{{- else -}}
{{- with .Get 0 -}}alert-{{.}}{{- else -}}alert-info{{- end -}}
{{- end -}}
" role="alert">{{ .Inner | markdownify }}</div>
{{- end -}}
" role="alert" data-dir="{{ with .Get "dir" }}{{.}}{{ else }}ltr{{ end }}">{{ .Inner | markdownify }}</div>

View File

@ -4,7 +4,7 @@
<img data-src="{{ if eq $base "/" }}{{ .Get "src" }}{{ else }}{{ delimit $base "" }}{{ substr (.Get "src") 1 }}{{ end }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} data-caption="{{ .Get "caption" }}" src="data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' d='M0 0h24v24H0V0z'/%3E%3Cpath fill='%23aaa' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1zm-4.44-6.19l-2.35 3.02-1.56-1.88c-.2-.25-.58-.24-.78.01l-1.74 2.23c-.26.33-.02.81.39.81h8.98c.41 0 .65-.47.4-.8l-2.55-3.39c-.19-.26-.59-.26-.79 0z'/%3E%3C/svg%3E" class="lazyload" width="{{ .Get "width" }}" height="{{ .Get "height" }}"/>
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
<figcaption style="text-align: {{ with .Get "position" }}{{ . }};{{ end }}">{{ if isset .Params "title" }}
<strong>{{ .Get "title" }}</strong>:{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}
{{ .Get "caption" }}