Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/queensferryme/hugo-theme-texify.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQueensferry <queensferry.me@gmail.com>2022-04-01 05:41:16 +0300
committerQueensferry <queensferry.me@gmail.com>2022-04-01 08:06:58 +0300
commit9ee2d2b098e5852f4edbbaa951a21e554661d025 (patch)
tree385e95b10c7eb3186d244763f20fae7130fcfd1e
parent0ced0811c942a48f761a1fc1420e93a1cad07bb9 (diff)
refactor: extract `_default/baseof.html`
-rw-r--r--layouts/_default/baseof.html82
-rw-r--r--layouts/_default/list.html57
-rw-r--r--layouts/_default/single.html121
-rw-r--r--layouts/index.html95
-rw-r--r--layouts/partials/foot.html7
-rw-r--r--layouts/partials/head.html56
-rw-r--r--theme.toml4
7 files changed, 202 insertions, 220 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..f2a543b
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+
+ <!-- author -->
+ <meta name="author" content="{{ .Site.Author.name }}">
+
+ <!-- description -->
+ {{ if .Description }}
+ <meta name="description" content="{{ .Description }}">
+ {{ else if and .IsPage .Summary }}
+ <meta name="description" content="{{ .Summary }}">
+ {{ else }}
+ <meta name="description" content="{{ .Site.Params.description }}">
+ {{ end }}
+
+ <!-- favicon -->
+ <link rel="icon" href="{{ .Site.Params.favicon }}">
+
+ <!-- keywords -->
+ {{ if .Keywords }}
+ <meta name="keywords" content="{{ range $key, $value := .Keywords }} {{ $value }} {{ end }}">
+ {{ else }}
+ <meta name="keywords" content="{{ range $key, $value := .Site.Params.keywords }} {{ $value }} {{ end }}">
+ {{ end }}
+
+ <!-- mathjax -->
+ {{ if .Site.Params.enableMathjax }}
+ {{ partial "mathjax.html" . }}
+ {{ end }}
+
+ <!-- permalink -->
+ <link rel="canonical" href="{{ .Permalink }}">
+
+ <!-- rss -->
+ {{ range .AlternativeOutputFormats -}}
+ {{ printf `
+ <link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+ {{ end -}}
+
+ <!-- style -->
+ <link media="screen" rel="stylesheet" href='{{ "css/common.css" | absURL }}'>
+ <link media="screen" rel="stylesheet" href='{{ "css/content.css" | absURL }}'>
+ <link media="screen" rel="stylesheet" href='{{ "css/highlight.css" | absURL }}'>
+
+ <!-- title -->
+ {{ if .IsHome }}
+ <title>{{ .Site.Title }}</title>
+ {{ else }}
+ <title>{{ .Title }} - {{ .Site.Title }}</title>
+ {{ end }}
+
+ <!-- twitter -->
+ <meta name="twitter:card" content="summary" />
+ <meta name="twitter:title" content="{{ .Title }}" />
+ <meta name="twitter:description" content="{{ .Summary }}" />
+
+ {{ block "head" . }}{{ end }}
+</head>
+
+<body>
+ <div id="wrapper">
+ {{ partial "header.html" . }}
+ {{ block "main" . }}{{ end }}
+ {{ partial "footer.html" . }}
+ </div>
+
+ <!-- custom css -->
+ {{ range .Site.Params.customCSS }}
+ <link media="screen" rel="stylesheet" href="{{ . | absURL }}" />
+ {{ end }}
+
+ <!-- google analytics -->
+ {{ template "_internal/google_analytics_async.html" . }}
+
+</body>
+
+</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index fc238db..1d25f9b 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,37 +1,26 @@
-<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}">
+{{ define "head" }}
+<link rel="stylesheet" href='{{ "css/list.css" | absURL }}'>
+{{ end }}
-<head>
- {{ partial "head.html" . }}
- <link rel="stylesheet" href='{{ "css/list.css" | absURL }}'>
-</head>
-
-<body>
- <div id="wrapper">
- {{ partial "header.html" . }}
- <main id="main" class="archive">
- {{ $pages := cond (eq .Section "tags") .Data.Pages .Site.RegularPages }}
- {{ $pages := where $pages "Type" "==" "post" }}
- {{ range $pages.GroupByDate "2006-01" }}
- <div class="post-group">
- <h2>{{ dateFormat "January 2006" (printf "%s-01" .Key) }}</h2>
- <ul>
- {{ range .Pages }}
- <li>
- <a class="link" href={{ .RelPermalink }}>{{ .Title }}</a>
- <time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time>
- </li>
- {{ end }}
- </ul>
- </div>
+{{ define "main" }}
+<main id="main" class="archive">
+ {{ $pages := cond (eq .Section "tags") .Data.Pages .Site.RegularPages }}
+ {{ $pages := where $pages "Type" "==" "post" }}
+ {{ range $pages.GroupByDate "2006-01" }}
+ <div class="post-group">
+ <h2>{{ dateFormat "January 2006" (printf "%s-01" .Key) }}</h2>
+ <ul>
+ {{ range .Pages }}
+ <li>
+ <a class="link" href={{ .RelPermalink }}>{{ .Title }}</a>
+ <time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time>
+ </li>
{{ end }}
- <div class="post-group">
- <h2>...</h2>
- </div>
- </main>
- {{ partial "footer.html" . }}
+ </ul>
</div>
- {{ partial "foot.html" . }}
-</body>
-
-</html>
+ {{ end }}
+ <div class="post-group">
+ <h2>...</h2>
+ </div>
+</main>
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index f8360bf..cba61e9 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,70 +1,55 @@
-<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}">
+{{ define "head" }}
+<link rel="stylesheet" href='{{ "css/single.css" | absURL }}'>
+{{ end }}
-<head>
- {{ partial "head.html" . }}
- <link rel="stylesheet" href='{{ "css/single.css" | absURL }}'>
-</head>
-
-<body>
- <div id="wrapper">
- {{ partial "header.html" . }}
- <main id="main" class="post">
- <!-- sections -->
- {{ if ne .Section "post" }}
- <div class="content">
- {{ .Content }}
- </div>
- {{ else }}
- <!-- post -->
- <h1>{{ .Title }}</h1>
- {{ if ne .Params.tags nil }}
- <div>
- <b>Keywords: </b>
- {{ range .Params.tags }}
- <a class="link" href='{{ "tags" | absURL }}/{{ . | urlize }}'>#{{ . }}</a>
- {{ end }}
- </div>
- {{ end }}
- <div class="content">
- {{ if .Site.Params.enableHanEmph }}
- {{ .Content | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }}
- {{ else }}
- {{ .Content }}
- {{ end }}
- </div>
- <div class="paginator">
- {{ if .PrevInSection }}
- <a class="link" href="{{ .PrevInSection.Permalink }}">← prev</a>
- {{ else }}
- <a></a>
- {{ end }}
- {{ if .NextInSection }}
- <a class="link" href="{{ .NextInSection.Permalink }}">next →</a>
- {{ else }}
- <a></a>
- {{ end }}
- </div>
- <div class="comment">
- <!-- disqus -->
- {{ template "_internal/disqus.html" . }}
- <!-- utterances -->
- {{ if .Site.Params.utterances.enable }}
- <script src="https://utteranc.es/client.js"
- repo="{{ .Site.Params.utterances.repo }}"
- issue-term="{{ .Site.Params.utterances.issue_term }}"
- label="{{ .Site.Params.utterances.label }}"
- theme="{{ .Site.Params.utterances.theme }}"
- crossorigin="anonymous"
- async>
- </script>
- {{ end }}
- </div>
- {{ end }}
- </main>
- {{ partial "footer.html" . }}
+{{ define "main" }}
+<main id="main" class="post">
+ <!-- sections -->
+ {{ if ne .Section "post" }}
+ <div class="content">
+ {{ .Content }}
</div>
- {{ partial "foot.html" . }}
-</body>
-
-</html>
+ {{ else }}
+ <!-- post -->
+ <h1>{{ .Title }}</h1>
+ {{ if ne .Params.tags nil }}
+ <div>
+ <b>Keywords: </b>
+ {{ range .Params.tags }}
+ <a class="link" href='{{ "tags" | absURL }}/{{ . | urlize }}'>#{{ . }}</a>
+ {{ end }}
+ </div>
+ {{ end }}
+ <div class="content">
+ {{ if .Site.Params.enableHanEmph }}
+ {{ .Content | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }}
+ {{ else }}
+ {{ .Content }}
+ {{ end }}
+ </div>
+ <div class="paginator">
+ {{ if .PrevInSection }}
+ <a class="link" href="{{ .PrevInSection.Permalink }}">← prev</a>
+ {{ else }}
+ <a></a>
+ {{ end }}
+ {{ if .NextInSection }}
+ <a class="link" href="{{ .NextInSection.Permalink }}">next →</a>
+ {{ else }}
+ <a></a>
+ {{ end }}
+ </div>
+ <div class="comment">
+ <!-- disqus -->
+ {{ template "_internal/disqus.html" . }}
+ <!-- utterances -->
+ {{ if .Site.Params.utterances.enable }}
+ <script src="https://utteranc.es/client.js" repo="{{ .Site.Params.utterances.repo }}"
+ issue-term="{{ .Site.Params.utterances.issue_term }}" label="{{ .Site.Params.utterances.label }}"
+ theme="{{ .Site.Params.utterances.theme }}" crossorigin="anonymous" async>
+ </script>
+ {{ end }}
+ </div>
+ {{ end }}
+</main>
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index ed1111a..d910dea 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,57 +1,46 @@
-<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}">
+{{ define "head" }}
+<link rel="stylesheet" href='{{ "css/index.css" | absURL }}'>
+{{ end }}
-<head>
- {{ partial "head.html" . }}
- <link rel="stylesheet" href='{{ "css/index.css" | absURL }}'>
-</head>
-
-<body>
- <div id="wrapper">
- {{ partial "header.html" . }}
- <main id="main" class="index">
- {{ $paginator := .Paginate (where .Site.RegularPages "Type" "==" "post") }}
- {{ range $paginator.Pages }}
- <div class="post">
- <h2>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- <time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time>
- </h2>
- {{ if ne .Params.tags nil }}
- <div>
- <b>Keywords: </b>
- {{ range .Params.tags }}
- <a class="link" href='{{ "tags" | absURL }}/{{ . | urlize }}'>#{{ . }}</a>
- {{ end }}
- </div>
- {{ end }}
- <div class="content">
- {{ if .Site.Params.enableHanEmph }}
- {{ .Summary | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }}
- {{ else }}
- {{ .Summary }}
- {{ end }}
- </div>
- </div>
+{{ define "main" }}
+<main id="main" class="index">
+ {{ $paginator := .Paginate (where .Site.RegularPages "Type" "==" "post") }}
+ {{ range $paginator.Pages }}
+ <div class="post">
+ <h2>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time>
+ </h2>
+ {{ if ne .Params.tags nil }}
+ <div>
+ <b>Keywords: </b>
+ {{ range .Params.tags }}
+ <a class="link" href='{{ "tags" | absURL }}/{{ . | urlize }}'>#{{ . }}</a>
{{ end }}
- {{ if or $paginator.HasPrev $paginator.HasNext}}
- <div class="paginator">
- {{ if $paginator.HasPrev }}
- <a class="link" href="{{ $paginator.Prev.URL }}">← prev</a>
- {{ else }}
- <a></a>
- {{ end }}
- {{ if $paginator.HasNext }}
- <a class="link" href="{{ $paginator.Next.URL }}">next →</a>
- {{ else }}
- <a></a>
- {{ end }}
- </div>
+ </div>
+ {{ end }}
+ <div class="content">
+ {{ if .Site.Params.enableHanEmph }}
+ {{ .Summary | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }}
+ {{ else }}
+ {{ .Summary }}
{{ end }}
- </main>
- {{ partial "footer.html" . }}
+ </div>
</div>
- {{ partial "foot.html" . }}
-</body>
-
-</html>
+ {{ end }}
+ {{ if or $paginator.HasPrev $paginator.HasNext}}
+ <div class="paginator">
+ {{ if $paginator.HasPrev }}
+ <a class="link" href="{{ $paginator.Prev.URL }}">← prev</a>
+ {{ else }}
+ <a></a>
+ {{ end }}
+ {{ if $paginator.HasNext }}
+ <a class="link" href="{{ $paginator.Next.URL }}">next →</a>
+ {{ else }}
+ <a></a>
+ {{ end }}
+ </div>
+ {{ end }}
+</main>
+{{ end }}
diff --git a/layouts/partials/foot.html b/layouts/partials/foot.html
deleted file mode 100644
index f77f2aa..0000000
--- a/layouts/partials/foot.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- custom css -->
-{{ range .Site.Params.customCSS }}
-<link media="screen" rel="stylesheet" href="{{ . | absURL }}" />
-{{ end }}
-
-<!-- google analytics -->
-{{ template "_internal/google_analytics_async.html" . }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
deleted file mode 100644
index 0486ae3..0000000
--- a/layouts/partials/head.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<meta charset="UTF-8">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<meta http-equiv="X-UA-Compatible" content="ie=edge">
-
-<!-- author -->
-<meta name="author" content="{{ .Site.Author.name }}">
-
-<!-- description -->
-{{ if .Description }}
-<meta name="description" content="{{ .Description }}">
-{{ else if and .IsPage .Summary }}
-<meta name="description" content="{{ .Summary }}">
-{{ else }}
-<meta name="description" content="{{ .Site.Params.description }}">
-{{ end }}
-
-<!-- favicon -->
-<link rel="icon" href="{{ .Site.Params.favicon }}">
-
-<!-- keywords -->
-{{ if .Keywords }}
-<meta name="keywords" content="{{ range $key, $value := .Keywords }} {{ $value }} {{ end }}">
-{{ else }}
-<meta name="keywords" content="{{ range $key, $value := .Site.Params.keywords }} {{ $value }} {{ end }}">
-{{ end }}
-
-<!-- mathjax -->
-{{ if .Site.Params.enableMathjax }}
-{{ partial "mathjax.html" . }}
-{{ end }}
-
-<!-- permalink -->
-<link rel="canonical" href="{{ .Permalink }}">
-
-<!-- rss -->
-{{ range .AlternativeOutputFormats -}}
- {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
-{{ end -}}
-
-<!-- site title -->
-{{ if .IsHome }}
-<title>{{ .Site.Title }}</title>
-{{ else }}
-<title>{{ .Title }} - {{ .Site.Title }}</title>
-{{ end }}
-
-<!-- style -->
-<link media="screen" rel="stylesheet" href='{{ "css/common.css" | absURL }}'>
-<link media="screen" rel="stylesheet" href='{{ "css/content.css" | absURL }}'>
-<link media="screen" rel="stylesheet" href='{{ "css/highlight.css" | absURL }}'>
-
-<!-- twitter -->
-<meta name="twitter:card" content="summary" />
-<meta name="twitter:title" content="{{ .Title }}" />
-<meta name="twitter:description" content="{{ .Summary }}" />
-
diff --git a/theme.toml b/theme.toml
index 1c5abfb..c03ddb5 100644
--- a/theme.toml
+++ b/theme.toml
@@ -8,5 +8,5 @@ features = ["blog"]
min_version = "0.60"
[author]
- name = "Queensferry"
- homepage = "https://github.com/queensferryme/"
+name = "Queensferry"
+homepage = "https://github.com/queensferryme/"