feat: new index and style update

This commit is contained in:
Dillon
2019-08-19 01:36:52 +08:00
parent 6981f1e285
commit ee7c7549b5
29 changed files with 801 additions and 707 deletions

View File

@@ -5,9 +5,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ partial "head.html" . }}
{{ $style := resources.Get "css/style.scss" | resources.ToCSS | resources.Minify}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">
</head>
<body class="">
<div class="wrapper">
@@ -18,7 +15,7 @@
</div>
</main>
{{ partial "footer.html" . }}
{{ partial "scripts.html" . }}
</div>
{{ partial "js.html" . }}
</body>
</html>
</html>

View File

@@ -1,22 +1,22 @@
{{ define "title" }}{{ T "posts" }} - {{ .Site.Title }}{{ end }}
{{ define "title" }}{{ T "posts" }} - {{ .Site.Title }}{{ end -}}
{{ define "content" }}
{{ $data := .Data }}
{{ define "content" -}}
{{ $data := .Data -}}
<div class="post-warp archive">
<h2 class="post-title" style="text-align:right;padding-bottom:2em">
<h2 class="post-title">
{{ printf "- %s -" (T "posts") }}
</h2>
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<h3>{{ .Key }}</h3>
{{ range .Pages }}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
<span class="archive-item-date">
{{ .Date.Format (.Site.Params.dateFormatToUse | default "01-02") }}
</span>
</article>
{{ end }} {{ end }}
{{ partial "paginator.html" . }}
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
<h3>{{ .Key }}</h3>
{{- range .Pages -}}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
<span class="archive-item-date">
{{- .Date.Format (.Site.Params.dateFormatToUse | default "01-02") -}}
</span>
</article>
{{- end -}}
{{- end -}}
{{- partial "paginator.html" . -}}
</div>
{{end }}
{{- end }}

View File

@@ -0,0 +1,55 @@
<article class="post" itemscope itemtype="http://schema.org/Article">
{{ $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
{{ $author := .Site.Author.name }}
{{ if isset .Params "author" }}
{{ $author = .Site.Author.name }}
{{ end }}
<!--featured_image-->
{{ with .Params.featured_image }}
{{ $image := $.Params.featured_image_preview | default . }}
<div class="featured_image_preview">
<img src=/images/loading.svg data-sizes=auto data-src={{ $image }} alt="featured image" class="lazyload">
</div>
{{ end }}
<!-- end featured_image-->
<header class="post-header">
<h1 class="post-title post-list-title" itemprop="name headline">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h1>
</header>
<div class="post-meta">
<a class="author" href="{{.Site.BaseURL }}" rel="author"><i class="fas fa-user-circle"></i>&nbsp;{{ $author }}&nbsp;</a>
{{ T "publish" }}<span class="post-time">&nbsp;<time datetime={{ $publish_date }}>{{ $publish_date }}</time>&nbsp;</span>
{{ with .Params.categories -}}
<span class="post-category">
{{ T "included" }}
{{ range . }}
{{- $name := . -}}
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
<i class="far fa-folder"></i>&nbsp;<a href="{{ .Permalink }}">{{ $name }}</a>&nbsp;
{{ end -}}
{{ end }}
</span>
{{- end }}
</div>
<div class="post-content">
{{ if .Params.show_description }}
<p>{{ . }}</p>
{{ else }}
{{ .Summary }}
{{ end }}
</div>
<div class="post-footer">
<a href="{{ .Permalink }}">{{ T "readmore" }}</a>
{{ with .Params.tags }}
<div class="post-tags">
{{ range . }}
<span class="tag">
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/">&nbsp;<i class="fas fa-tag"></i>&nbsp;{{ . }}</a>
</span>
{{ end }}
</div>
{{ end }}
</div>
</article>