浏览代码

Update rss & footer

Track3 6 年之前
父节点
当前提交
a9c201dc2e
共有 6 个文件被更改,包括 43 次插入6 次删除
  1. 4 1
      config.toml
  2. 6 3
      layouts/_default/baseof.html
  3. 2 2
      layouts/partials/footer.html
  4. 27 0
      layouts/posts/rss.xml
  5. 0 0
      static/css/style.css
  6. 4 0
      static/scss/style.scss

+ 4 - 1
config.toml

@@ -2,9 +2,9 @@ baseURL = "https://www.xxxlbox.com"
 languageCode = "zh-cn"
 DefaultContentLanguage = "zh"
 title = "Track3's Blog"
+copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
 
 enableGitInfo = true
-
 pygmentsCodefences  = true
 pygmentsUseClasses  = true
 hasCJKLanguage = true
@@ -12,6 +12,9 @@ hasCJKLanguage = true
 [blackfriday]
 hrefTargetBlank = true
 
+[author]
+  name = "Track3"
+
 [taxonomies]
   tag = "tags"
   category = ""

+ 6 - 3
layouts/_default/baseof.html

@@ -17,13 +17,16 @@
 	<link rel="dns-prefetch" href="https://ojirvqiyr.qnssl.com/">
 	<link rel="dns-prefetch" href="//cdn1.lncld.net">
 	<link rel="dns-prefetch" href="//unpkg.com">
+	{{ range .AlternativeOutputFormats -}}
+  	{{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }}
+	{{ end -}}
 	<link rel="stylesheet" href="{{ "css/style.css" | absURL }}">
 </head>
 
 <body id="page">
-	{{- block "header" . }}{{- end }}
-	{{- block "main" . }}{{- end }}
-	{{- block "footer" . }}{{- end }}
+	{{ block "header" . -}}{{ end -}}
+	{{ block "main" . -}}{{ end -}}
+	{{ block "footer" . -}}{{ end -}}
 	<script src="{{ "js/main.min.js" | absURL }}"></script>
 	<script>
 		var _hmt = _hmt || [];

+ 2 - 2
layouts/partials/footer.html

@@ -1,6 +1,6 @@
 	<footer id="site-footer">
 		<div id="copyright">
-			<p>&copy; 2018 {{ .Site.Params.author }}</p>
-			<p>Made with Hugo</p>
+			<p>&copy; 2018 <a href="https://www.xxxlbox.com">{{ .Site.Author.name }}</a> &#183; <a href="https://creativecommons.org/licenses/by-nc/4.0/deed.zh">CC BY-NC 4.0</a></p>
+			<p>Made with <a href="https://gohugo.io/">Hugo</a> &#183; <a href="http://www.miitbeian.gov.cn" target="_blank" title="rss">鄂ICP备16022650号-1</a> &#183; <a href="https://www.xxxlbox.com/posts/index.xml"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a></p>
 		</div>
 	</footer>

+ 27 - 0
layouts/posts/rss.xml

@@ -0,0 +1,27 @@
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+  <channel>
+    <title>{{ if eq  .Title  .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
+    <link>{{ .Permalink }}</link>
+    <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 }}
+    <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
+    <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
+    <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{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 }}
+    {{ with .OutputFormats.Get "RSS" -}}
+        {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
+    {{ end -}}
+    {{ range .Data.Pages }}
+    <item>
+      <title>{{ .Title }}</title>
+      <link>{{ .Permalink }}</link>
+      <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
+      {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
+      <guid>{{ .Permalink }}</guid>
+      <description>{{ .Summary | html }}</description>
+      <content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content>
+    </item>
+    {{ end }}
+  </channel>
+</rss>

文件差异内容过多而无法显示
+ 0 - 0
static/css/style.css


+ 4 - 0
static/scss/style.scss

@@ -185,6 +185,10 @@ hr {
   }
 }
 
+#copyright a {
+  border: none;
+}
+
 // Spotlight
 //
 #spotlight {

部分文件因为文件数量过多而无法显示