From 8038beb8ad11191846ee5df0e025a4614776502e Mon Sep 17 00:00:00 2001 From: zzossig Date: Mon, 17 Feb 2020 22:43:44 +0900 Subject: [PATCH] [new options] rss options updatePeriod, updateFrequency, fullContents --- README.ko.md | 5 ++ assets/sass/components/_alert.scss | 36 +++++++++++++-- exampleSite/config/_default/params.toml | 5 ++ layouts/_default/rss.xml | 61 ++++++++++++++++++++++++- layouts/_default/taxonomy.xml | 36 ++++++++++++++- layouts/shortcodes/alert.html | 4 +- layouts/shortcodes/img.html | 2 +- 7 files changed, 138 insertions(+), 11 deletions(-) diff --git a/README.ko.md b/README.ko.md index 2923a78..786b90b 100644 --- a/README.ko.md +++ b/README.ko.md @@ -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 = "" diff --git a/assets/sass/components/_alert.scss b/assets/sass/components/_alert.scss index 3a657a4..bb80248 100644 --- a/assets/sass/components/_alert.scss +++ b/assets/sass/components/_alert.scss @@ -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; + } } } } diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 437c127..301dcf0 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -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 = "" diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 70d5944..d7d0708 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,5 +1,9 @@ {{ printf "" | safeHTML }} - + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} @@ -9,7 +13,10 @@ {{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}}{{ with .Site.Params.email }} {{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}{{ with .Site.Params.updatePeriod }} + {{.}}{{end}}{{ with .Site.Params.updateFrequency }} + {{.}}{{end}}{{ with .Site.Params.myname }} + {{.}}{{end}} {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} @@ -29,6 +36,31 @@ {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ .Summary | html }} + {{ if .Site.Params.fullContents }}{{ .Content | html }}{{end}} + {{ with $.Params.image }}featured image{{end}} + {{ with $.Params.featured_image }}featured image{{end}} + {{ with $.Params.meta_image }}meta image{{end}} + {{ with .Params.tags }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} + {{ with .Params.categories }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} + {{ with .Params.series }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} {{ end }} @@ -42,6 +74,31 @@ {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ .Summary | html }} + {{ if .Site.Params.fullContents }}{{ .Content | html }}{{end}} + {{ with $.Params.image }}featured image{{end}} + {{ with $.Params.featured_image }}featured image{{end}} + {{ with $.Params.meta_image }}meta image{{end}} + {{ with .Params.tags }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} + {{ with .Params.categories }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} + {{ with .Params.series }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} {{ end }} diff --git a/layouts/_default/taxonomy.xml b/layouts/_default/taxonomy.xml index 99ff5d0..0c80a14 100644 --- a/layouts/_default/taxonomy.xml +++ b/layouts/_default/taxonomy.xml @@ -1,5 +1,9 @@ {{ printf "" | safeHTML }} - + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} @@ -9,7 +13,10 @@ {{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}}{{ with .Site.Params.email }} {{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}{{ with .Site.Params.updatePeriod }} + {{.}}{{end}}{{ with .Site.Params.updateFrequency }} + {{.}}{{end}}{{ with .Site.Params.myname }} + {{.}}{{end}} {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} @@ -22,6 +29,31 @@ {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ .Summary | html }} + {{ if .Site.Params.fullContents }}{{end}} + {{ with $.Params.image }}featured image{{end}} + {{ with $.Params.featured_image }}featured image{{end}} + {{ with $.Params.meta_image }}meta image{{end}} + {{ with .Params.tags }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} + {{ with .Params.categories }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} + {{ with .Params.series }} + {{ range . }} + {{ with . }} + {{.}} + {{ end }} + {{ end }} + {{ end }} {{ end }} diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html index 284fad7..b65afb1 100644 --- a/layouts/shortcodes/alert.html +++ b/layouts/shortcodes/alert.html @@ -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 }} +{{- end -}} +" role="alert" data-dir="{{ with .Get "dir" }}{{.}}{{ else }}ltr{{ end }}">{{ .Inner | markdownify }} diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 4282425..02cae79 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -4,7 +4,7 @@ {{ if .Get "link"}}{{ end }} {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} -
{{ if isset .Params "title" }} +
{{ if isset .Params "title" }} {{ .Get "title" }}:{{ end }} {{ if or (.Get "caption") (.Get "attr")}} {{ .Get "caption" }}