1
0
Fork 0

Update layouts

This commit is contained in:
nanxiaobei 2019-08-20 04:12:49 +08:00
parent 165ad9b6fa
commit 68a57bbb47
4 changed files with 18 additions and 24 deletions

View file

@ -8,7 +8,7 @@
</header> </header>
{{ end }} {{ end }}
{{ $paginator := .Paginate (where .Pages ".Params.type" "!=" "page") }} {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
{{ if gt $paginator.TotalPages 0 }} {{ if gt $paginator.TotalPages 0 }}
{{ range $index, $page := $paginator.Pages }} {{ range $index, $page := $paginator.Pages }}
@ -20,7 +20,7 @@
<p>{{ .Summary | plainify | htmlUnescape }}...</p> <p>{{ .Summary | plainify | htmlUnescape }}...</p>
</section> </section>
<footer class="entry-footer"> <footer class="entry-footer">
<time>{{ .Date.Format (.Site.Params.dateFormat | default "2006.1.2") }}</time> <time>{{ .Date.Format "January 2, 2006" }}</time>
</footer> </footer>
<a class="entry-link" href="{{ .Permalink }}"></a> <a class="entry-link" href="{{ .Permalink }}"></a>
</article> </article>

View file

@ -6,19 +6,19 @@
<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 (.Site.Params.dateFormat | default "2006.1.2") -}} {{- .Date.Format "January 2, 2006" -}}
</div> </div>
</header> </header>
<div class="post-content">{{ .Content }}</div> <div class="post-content">{{ .Content }}</div>
{{ if .Params.tags }}
<footer class="post-footer"> <footer class="post-footer">
{{ if .Params.tags }}
<ul class="post-tags"> <ul class="post-tags">
{{ range .Params.tags }} {{ range .Params.tags }}
<li><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">{{ . }}</a></li> <li><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">{{ . }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
{{ end }}
</footer> </footer>
{{ 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 }}

View file

@ -22,11 +22,11 @@
<meta name="author" content="{{ .Site.Params.author }}"> <meta name="author" content="{{ .Site.Params.author }}">
{{ end -}} {{ end -}}
<!-- Styles --> <!-- Styles -->
<link href="{{ "css/github-gist.min.css" | absURL }}" rel="stylesheet"> <link href="{{ "an-old-hope.min.css" | absURL }}" rel="stylesheet">
<link href="{{ "css/style.css" | absURL }}" rel="stylesheet"> <link href="{{ "style.css" | absURL }}" rel="stylesheet">
<!-- Favicons --> <!-- Favicons -->
<link rel="apple-touch-icon" href="{{ "img/apple-touch-icon.png" | absURL }}"> <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}">
<link rel="icon" href="{{ "img/favicon.ico" | absURL }}"> <link rel="icon" href="{{ "favicon.ico" | absURL }}">
<!-- Generator --> <!-- Generator -->
{{ hugo.Generator }} {{ hugo.Generator }}
<!-- RSS --> <!-- RSS -->
@ -35,30 +35,24 @@
{{ 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" . }}
{{ end }} {{ end }}
{{ partial "header-include.html" . }}
</head> </head>
<body class="{{if eq .Kind `page` }}single{{else}}list{{ if .IsHome }} home{{ end }}{{end}}"> <body class="{{if eq .Kind `page` }}single{{else}}list{{ if .IsHome }} home{{ end }}{{end}}">
<header class="header"> <header class="header">
<div class="wrap"> <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 }}
<button class="menu-toggle" type="button"></button> <ul class="menu">
{{ range .Site.Menus.main }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
{{ end }} {{ end }}
</div> </nav>
</header> </header>
{{ if .Site.Menus.main }}
<nav class="nav">
<ul class="menu">
{{ range .Site.Menus.main }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</nav>
{{ end }}
<main class="main"> <main class="main">