This commit is contained in:
parent
64d1719fa0
commit
30c5e39a63
4 changed files with 59 additions and 34 deletions
11
config.toml
11
config.toml
|
@ -66,11 +66,14 @@ DefaultContentLanguage = "ru"
|
||||||
# set title for the table of contents
|
# set title for the table of contents
|
||||||
# can be overridden in a page's front-matter
|
# can be overridden in a page's front-matter
|
||||||
# TocTitle = "Содержание" # default
|
# TocTitle = "Содержание" # default
|
||||||
|
[params.author]
|
||||||
|
email = ""
|
||||||
|
name = "Сисадмин Линк"
|
||||||
|
|
||||||
[languages]
|
[languages]
|
||||||
[languages.ru]
|
[languages.ru]
|
||||||
languageCode = 'ru'
|
languageCode = "ru"
|
||||||
languageName = 'RU'
|
languageName = "RU"
|
||||||
title = "Sadium"
|
title = "Sadium"
|
||||||
[languages.ru.params]
|
[languages.ru.params]
|
||||||
writtenby = "Сисадмин Линк"
|
writtenby = "Сисадмин Линк"
|
||||||
|
@ -118,3 +121,7 @@ DefaultContentLanguage = "ru"
|
||||||
identifier = "uptime"
|
identifier = "uptime"
|
||||||
name = "[Uptime]"
|
name = "[Uptime]"
|
||||||
url = "https://up.sadium.cyou"
|
url = "https://up.sadium.cyou"
|
||||||
|
[[languages.ru.menu.main]]
|
||||||
|
identifier = "uptime"
|
||||||
|
name = "[Uptime]"
|
||||||
|
url = "https://up.sadium.cyou"
|
|
@ -1,40 +1,57 @@
|
||||||
{{- $pctx := . -}}
|
{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}}
|
||||||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
{{- $authorName := "" }}
|
||||||
{{- $pages := slice -}}
|
{{- with site.Params.author }}
|
||||||
{{- if or $.IsHome $.IsSection -}}
|
{{- if reflect.IsMap . }}
|
||||||
{{- $pages = $pctx.RegularPages -}}
|
{{- with .name }}
|
||||||
{{- else -}}
|
{{- $authorName = . }}
|
||||||
{{- $pages = $pctx.Pages -}}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- else }}
|
||||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
{{- $authorName = . }}
|
||||||
{{- if ge $limit 1 -}}
|
{{- end }}
|
||||||
{{- $pages = $pages | first $limit -}}
|
{{- else }}
|
||||||
{{- end -}}
|
{{- with site.Author.name }}
|
||||||
|
{{- $authorName = . }}
|
||||||
|
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- $pctx := . }}
|
||||||
|
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
|
||||||
|
{{- $pages := slice }}
|
||||||
|
{{- if or $.IsHome $.IsSection }}
|
||||||
|
{{- $pages = $pctx.RegularPages }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $pages = $pctx.Pages }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $limit := .Site.Config.Services.RSS.Limit }}
|
||||||
|
{{- if ge $limit 1 }}
|
||||||
|
{{- $pages = $pages | first $limit }}
|
||||||
|
{{- end }}
|
||||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
{{- 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:atom="http://www.w3.org/2005/Atom">
|
||||||
<channel>
|
<channel>
|
||||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
<generator>Hugo</generator>
|
||||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
<language>{{ site.Language.LanguageCode }}</language>
|
||||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>
|
||||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
<webMaster>{{ . }}{{ with $authorName }} ({{ . }})</webMaster>{{ end }}{{ with .Site.Copyright }}
|
||||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
|
||||||
<lastBuildDate>{{ .Date.Format "02.01.2006" | safeHTML }}</lastBuildDate>{{ end }}
|
<lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||||
{{- with .OutputFormats.Get "RSS" -}}
|
{{- with .OutputFormats.Get "RSS" }}
|
||||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||||
{{- end -}}
|
{{- end }}
|
||||||
{{ range $pages }}
|
{{- range $pages }}
|
||||||
<item>
|
<item>
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
<pubDate>{{ .Date.Format "02.01.2006" | safeHTML }}</pubDate>
|
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>
|
||||||
<guid>{{ .Permalink }}</guid>
|
<guid>{{ .Permalink }}</guid>
|
||||||
<description>{{ .Content | html }}</description>
|
<description>{{ .Content | transform.XMLEscape | safeHTML }}</description>
|
||||||
<content>{{ .Content | html }}</content>
|
|
||||||
</item>
|
</item>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
<span> <a href="https://git.sadium.cyou/SadmL/sadium">Исходный код</a> ::</span>
|
<span> <a href="https://git.sadium.cyou/SadmL/sadium">Исходный код</a> ::</span>
|
||||||
<span><a href="/tos">Условия использования</a> ::</span>
|
<span><a href="/tos">Условия использования</a> ::</span>
|
||||||
<!-- <span> <a href="/posts/index.xml">RSS</a> ::</span> -->
|
<span> {{ now.Year }} </span>
|
||||||
<span> {{ now.Year }}</span>
|
<span><a href="/posts/index.xml"><img src="/img/rss.svg"></a></span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
1
static/img/rss.svg
Normal file
1
static/img/rss.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16"><path fill="#ff6165" d="M14.5 0h-13C.675 0 0 .675 0 1.5v13c0 .825.675 1.5 1.5 1.5h13c.825 0 1.5-.675 1.5-1.5v-13c0-.825-.675-1.5-1.5-1.5M4.359 12.988c-.75 0-1.359-.603-1.359-1.353a1.36 1.36 0 0 1 2.718 0c0 .75-.609 1.353-1.359 1.353M7.772 13a4.75 4.75 0 0 0-1.397-3.381A4.74 4.74 0 0 0 3 8.219V6.263c3.713 0 6.738 3.022 6.738 6.737zm3.472 0c0-4.547-3.697-8.25-8.241-8.25V2.794c5.625 0 10.203 4.581 10.203 10.206h-1.963z"/></svg>
|
After Width: | Height: | Size: 513 B |
Loading…
Reference in a new issue