1
0
Fork 0

update html format

This commit is contained in:
nanxiaobei 2020-03-09 23:56:47 +08:00
parent 47ee6db428
commit ae2b0c9d96
3 changed files with 34 additions and 34 deletions

View file

@ -1,3 +1,3 @@
{{ partial "header.html" . }} {{- partial "header.html" . }}
<div class="not-found">404</div> <div class="not-found">404</div>
{{ partial "footer.html" . }} {{- partial "footer.html" . }}

View file

@ -1,28 +1,28 @@
{{ partial "header.html" . }} {{- partial "header.html" . }}
<article class="post-single"> <article class="post-single">
<header class="post-header"> <header class="post-header">
<h1 class="post-title">{{ .Title }}</h1> <h1 class="post-title">{{ .Title }}</h1>
<div class="post-meta"> <div class="post-meta">
{{- if or .Params.author .Site.Params.author -}} {{- if or .Params.author .Site.Params.author }}
{{ .Params.author | default .Site.Params.author }} · {{ end }} {{- .Params.author | default .Site.Params.author }} · {{ end }}
{{- .Date.Format "January 2, 2006" -}} {{- .Date.Format "January 2, 2006" -}}
</div> </div>
</header> </header>
<div class="post-content">{{ .Content }}</div> <div class="post-content">{{ .Content }}</div>
{{ if .Params.tags }} {{- if .Params.tags }}
<footer class="post-footer"> <footer class="post-footer">
<ul class="post-tags"> <ul class="post-tags">
{{ range .Params.tags }} {{- range .Params.tags }}
{{ $href := print (absURL "tags/") (urlize .) }} {{- $href := print (absURL "tags/") (urlize .) }}
<li><a href="{{ $href }}">{{ . }}</a></li> <li><a href="{{ $href }}">{{ . }}</a></li>
{{ end }} {{- end }}
</ul> </ul>
</footer> </footer>
{{ end }} {{- end }}
<!-- Comments area start --> <!-- Comments area start -->
{{ if not (eq .Params.comments false) }} {{- if not (eq .Params.comments false) }}
{{ if .Site.DisqusShortname }} {{- if .Site.DisqusShortname }}
<div id="disqus_thread"></div> <div id="disqus_thread"></div>
<script> <script>
var disqus_shortname = '{{ .Site.DisqusShortname }}'; var disqus_shortname = '{{ .Site.DisqusShortname }}';
@ -38,8 +38,8 @@
<a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript> </noscript>
<!-- Comments area end --> <!-- Comments area end -->
{{ end }} {{- end }}
{{ end }} {{- end }}
</article> </article>
{{ partial "footer.html" . }} {{- partial "footer.html" . }}

View file

@ -7,20 +7,20 @@
<!-- Title --> <!-- Title -->
<title> <title>
{{- if not .IsHome }} {{- if not .IsHome }}
{{- if eq .Kind "page" }}{{ .Title }} {{- if eq .Kind "page" }}{{ .Title }}{{ else if .Data.Term }}{{ .Data.Term }}{{ else }}Tags{{ end }}
{{- else if eq .Data.Singular "tag" }}{{ .Data.Term }} {{- print " - " }}
{{- else }}Posts {{- end }}
{{- end }} - {{ end }}
{{- .Site.Title -}} {{- .Site.Title -}}
</title> </title>
<!-- Meta --> <!-- Meta -->
{{- if eq .Kind "page" }} {{- if eq .Kind "page" }}
<meta name="description" content="{{ .Summary }}"> <meta name="description" content="{{ .Summary }}">
<meta name="author" content="{{ .Params.author | default .Site.Params.author }}"> <meta name="author" content="{{ .Params.author | default .Site.Params.author }}">
{{ else }} {{- else }}
<meta name="description" content="{{ .Site.Params.description }}"> <meta name="description" content="{{ .Site.Params.description }}">
<meta name="author" content="{{ .Site.Params.author }}"> <meta name="author" content="{{ .Site.Params.author }}">
{{ end -}} {{- end }}
<!-- Styles --> <!-- Styles -->
<link href="{{ "an-old-hope.min.css" | absURL }}" rel="stylesheet"> <link href="{{ "an-old-hope.min.css" | absURL }}" rel="stylesheet">
<link href="{{ "style.css" | absURL }}" rel="stylesheet"> <link href="{{ "style.css" | absURL }}" rel="stylesheet">
@ -28,14 +28,14 @@
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}"> <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}">
<link rel="icon" href="{{ "favicon.ico" | absURL }}"> <link rel="icon" href="{{ "favicon.ico" | absURL }}">
<!-- Generator --> <!-- Generator -->
{{ hugo.Generator }} {{- hugo.Generator }}
<!-- RSS --> <!-- RSS -->
<link rel="alternate" type="application/atom+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }}"> <link rel="alternate" type="application/atom+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }}">
<!-- Misc --> <!-- Misc -->
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} {{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
{{ template "_internal/google_analytics_async.html" . }} {{- template "_internal/google_analytics_async.html" . }}
{{ template "_internal/opengraph.html" . }} {{- template "_internal/opengraph.html" . }}
{{ end }} {{- end }}
<!-- Script --> <!-- Script -->
<script> <script>
function setTheme() { function setTheme() {
@ -86,20 +86,20 @@
</script> </script>
<header class="header"> <header class="header">
<nav class="nav"> <nav class="nav">
{{ if .IsHome }} {{- if .IsHome }}
<h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1> <h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1>
{{ else }} {{- else }}
<p class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></p> <p class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></p>
{{ end }} {{- end }}
{{ if .Site.Menus.main }} {{- if .Site.Menus.main }}
<ul class="menu"> <ul class="menu">
{{ range .Site.Menus.main }} {{- range .Site.Menus.main }}
<li> <li>
<a href="{{ .URL }}">{{ .Name }}</a> <a href="{{ .URL }}">{{ .Name }}</a>
</li> </li>
{{ end }} {{- end }}
</ul> </ul>
{{ end }} {{- end }}
</nav> </nav>
</header> </header>
<main class="main"> <main class="main">