feat: new style and faster
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
{{ $cdn_url := ""}}
|
||||
{{ if eq ( getenv "HUGO_ENV" ) "production" }}
|
||||
{{ with .Site.Params.cdn_url }}
|
||||
{{ $cdn_url = .}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ .Scratch.Set "cdn_url" $cdn_url }}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
@@ -13,6 +5,8 @@
|
||||
<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 }}">
|
||||
</head>
|
||||
<body class="">
|
||||
<div class="wrapper">
|
||||
@@ -24,5 +18,6 @@
|
||||
</main>
|
||||
{{ partial "footer.html" . }}
|
||||
</div>
|
||||
{{ partial "js.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
22
layouts/_default/section.html
Normal file
22
layouts/_default/section.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{ define "title" }}{{ T "posts" }} - {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
{{ $data := .Data }}
|
||||
<div class="post-warp archive">
|
||||
<h2 class="post-title" style="text-align:right;padding-bottom:2em">
|
||||
{{ 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" . }}
|
||||
</div>
|
||||
{{end }}
|
||||
10
layouts/_default/single.html
Normal file
10
layouts/_default/single.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="post-warp">
|
||||
<h2 class="post-title" style="text-align:right;padding-bottom:2em">{{ .Title }}</h2>
|
||||
<div class="post-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
{{end }}
|
||||
Reference in New Issue
Block a user