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

github.com/wlh320/hugo-theme-hulga.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzilch40 <wlh233@live.com>2020-11-21 15:52:30 +0300
committerzilch40 <wlh233@live.com>2020-11-21 15:52:30 +0300
commit111b9d34e6a5fd6da3a0365bc579d90c9923e5f6 (patch)
tree06592d36597fb3d3eea67d91c51b9550e4406ca5
parent0e32031aeacddd30e1573e2ddac5ce2752a4f8d8 (diff)
change url to absURL
-rw-r--r--README.md2
-rw-r--r--i18n/en.toml3
-rw-r--r--i18n/zh-cn.toml5
-rw-r--r--layouts/404.html7
-rw-r--r--layouts/_default/taxonomy.html8
-rw-r--r--layouts/_default/term.html9
-rw-r--r--layouts/partials/anchor.html2
-rw-r--r--layouts/partials/backtotop.html2
-rw-r--r--layouts/partials/highlight.html6
-rw-r--r--layouts/partials/math.html6
-rw-r--r--layouts/partials/post-header.html7
-rw-r--r--layouts/partials/posts.html11
-rw-r--r--layouts/partials/pwa.html2
-rw-r--r--layouts/partials/toc.html4
14 files changed, 40 insertions, 34 deletions
diff --git a/README.md b/README.md
index 6c92986..88bbda6 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
build `hugoBasicExample` without any config of this theme
-![screenshot](./images/screenshot.png)
+![screenshot](https://github.com/wlh320/hugo-theme-hulga/blob/main/images/screenshot.png)
## Demo
diff --git a/i18n/en.toml b/i18n/en.toml
index 788bc1b..ac4d355 100644
--- a/i18n/en.toml
+++ b/i18n/en.toml
@@ -15,3 +15,6 @@ other = "There are {{ .Count }} articles in this blog"
[archives]
other = "Archives"
+
+[404-info]
+other = "Page not found, please check the URL" \ No newline at end of file
diff --git a/i18n/zh-cn.toml b/i18n/zh-cn.toml
index 9afedbe..a2c3f5a 100644
--- a/i18n/zh-cn.toml
+++ b/i18n/zh-cn.toml
@@ -14,4 +14,7 @@ other = "下一页"
other = "本博客共 {{ .Count }} 篇博文"
[archives]
-other = "归档" \ No newline at end of file
+other = "归档"
+
+[404-info]
+other = "页面未找到,请检查 URL " \ No newline at end of file
diff --git a/layouts/404.html b/layouts/404.html
index a8bb465..d6499a9 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -20,12 +20,7 @@
<p>404 Page Not Found</p>
</div>
<div class="message-body">
- 没找到该页面,请检查 url 或 <a href="/">返回首页</a>
+ <p>{{ i18n "404-info" }}</p>
</div>
</article>
-<style>
- .subtitle a {
- text-decoration: underline;
- }
-</style>
{{ end }}
diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html
index 23de21f..be9aa69 100644
--- a/layouts/_default/taxonomy.html
+++ b/layouts/_default/taxonomy.html
@@ -14,10 +14,11 @@
</header>
<div class="card-content">
<div class="content is-medium">
+ {{- $ctx := . -}}
{{ range .Site.Taxonomies.categories.ByCount }}
<div class="container" style="margin-bottom: 0.5rem">
- <a href="{{ "/categories/" | relLangURL }}{{ .Name | urlize }}">{{ .Name }}</a>
- <span class="tag is-pulled-right">
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/categories/" | relLangURL }}{{ .Name | urlize }}">{{ .Name }}</a>
+ <span class="tag is-medium is-pulled-right">
{{ .Count }}
</span>
</div>
@@ -37,10 +38,11 @@
</header>
<div class="card-content">
<div class="field is-grouped is-grouped-multiline">
+ {{- $ctx := . -}}
{{ range .Site.Taxonomies.tags.ByCount }}
<div class="control">
<div class="tags has-addons">
- <a class="tag is-medium" href="{{ "/tags/" | relLangURL }}{{ .Name | urlize }}/">{{ .Name }}</a>
+ <a class="tag is-medium" href="{{$ctx.Site.BaseURL}}{{ "/tags/" | relLangURL }}{{ .Name | urlize }}/">{{ .Name }}</a>
<span class="tag is-medium is-primary">
{{ .Count }}
</span>
diff --git a/layouts/_default/term.html b/layouts/_default/term.html
index 714d848..e081039 100644
--- a/layouts/_default/term.html
+++ b/layouts/_default/term.html
@@ -1,5 +1,6 @@
{{ define "main" }}
{{- partial "header.html" . -}}
+{{- $ctx := . -}}
<section class="section">
<div class="container">
<div class="columns">
@@ -8,14 +9,14 @@
{{ if eq .Data.Singular "category" }}
<nav class="breadcrumb is-centered is-medium" aria-label="breadcrumbs">
<ul>
- <li><a href="/categories">{{- i18n "categories" -}}</a></li>
+ <li><a href={{"categories" | absURL}}>{{- i18n "categories" -}}</a></li>
<li class="is-active"><a href="#">{{ .Data.Term }}</a></li>
</ul>
</nav>
{{ else if eq .Data.Singular "tag" }}
<nav class="breadcrumb is-centered is-medium" aria-label="breadcrumbs">
<ul>
- <li><a href="/tags">{{- i18n "tags" -}}</a></li>
+ <li><a href="{{"tags" | absURL }}">{{- i18n "tags" -}}</a></li>
<li class="is-active"><a href="#">{{ .Data.Term }}</a></li>
</ul>
</nav>
@@ -28,7 +29,7 @@
<div class="post-box-tags">
{{ range .}}
<span class="post-tag post-box-tag">
- <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">#{{ . }}</a>
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/tags/" | relLangURL }}{{ . | urlize }}">#{{ . }}</a>
</span>
{{ end }}
</div>
@@ -41,7 +42,7 @@
{{ with .Params.Categories }} ・
{{ range .}}
<span class="post-tag post-box-category">
- <a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
</span>
{{ end }}
{{ end }}
diff --git a/layouts/partials/anchor.html b/layouts/partials/anchor.html
index 038babd..8e2f36a 100644
--- a/layouts/partials/anchor.html
+++ b/layouts/partials/anchor.html
@@ -1,4 +1,4 @@
-<script src="/js/anchor.min.js"></script>
+<script src={{ "js/anchor.min.js" | absURL }}></script>
<script>
anchors.options = {
placement: 'left',
diff --git a/layouts/partials/backtotop.html b/layouts/partials/backtotop.html
index 47c5657..f4616b8 100644
--- a/layouts/partials/backtotop.html
+++ b/layouts/partials/backtotop.html
@@ -1,4 +1,4 @@
-<script src="/js/vanilla-back-to-top.min.js"></script>
+<script src={{ "js/vanilla-back-to-top.min.js" | absURL }}></script>
<script>
addBackToTop({
diameter: 42,
diff --git a/layouts/partials/highlight.html b/layouts/partials/highlight.html
index b7bbc76..c10cfca 100644
--- a/layouts/partials/highlight.html
+++ b/layouts/partials/highlight.html
@@ -6,11 +6,11 @@
link.href = url;
}
{{ if .Site.Params.darkMedia }}
- var darkcss = '/css/monokai.css'
+ var darkcss = {{"css/monokai.css" | absURL}}
{{ else }}
- var darkcss = '/css/monokailight.css'
+ var darkcss = {{"css/monokailight.css" | absURL}}
{{ end }}
- var lightcss = '/css/monokailight.css'
+ var lightcss = {{"css/monokailight.css" | absURL}}
// load syntax css
if (window.matchMedia('(prefers-color-scheme)').media === 'not all') {
// alert('Browser doesn\'t support dark mode');
diff --git a/layouts/partials/math.html b/layouts/partials/math.html
index 02a521c..3d83a63 100644
--- a/layouts/partials/math.html
+++ b/layouts/partials/math.html
@@ -1,6 +1,6 @@
-<link rel="stylesheet" href="/css/katex.min.css">
-<script defer src="/js/katex.min.js"></script>
-<script defer src="/js/auto-render.min.js"></script>
+<link rel="stylesheet" href={{"css/katex.min.css" | absURL}}>
+<script defer src={{"js/katex.min.js" | absURL}}></script>
+<script defer src={{ "js/auto-render.min.js" | absURL }}></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
renderMathInElement(document.body, {
diff --git a/layouts/partials/post-header.html b/layouts/partials/post-header.html
index d156c78..f820eaf 100644
--- a/layouts/partials/post-header.html
+++ b/layouts/partials/post-header.html
@@ -1,4 +1,4 @@
-<section class="hero is-primary shadow-hero {{ if .Site.Params.heroBold}} is-bold {{ end }}">
+<section class="hero is-primary shadow-hero {{ if .Site.Params.heroBold }} is-bold {{ end }}">
<div class="hero-head">
{{ partial "nav.html" . }}
</div>
@@ -11,10 +11,11 @@
{{- if isset .Params "date" -}}
<time class="post-meta">{{ .Date.Format "2006/01/02" }}</time>
{{- end -}}
+ {{- $ctx := . -}}
{{ with .Params.Categories }} ・
{{ range .}}
<span class="post-tag post-meta">
- <a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
</span>
{{ end }}
{{ end }}
@@ -27,7 +28,7 @@
<div class="tagbox post-meta">
{{ range . }}
<span class="post-tag">
- <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">#{{ . }}</a>
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/tags/" | relLangURL }}{{ . | urlize }}">#{{ . }}</a>
</span>
{{ end }}
</div>
diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html
index e9bf35d..f1addb0 100644
--- a/layouts/partials/posts.html
+++ b/layouts/partials/posts.html
@@ -1,3 +1,4 @@
+{{- $ctx := . -}}
<section class="section post-box-section">
<div class="container">
<div class="columns">
@@ -12,20 +13,20 @@
<div class="post-box-tags">
{{ range .}}
<span class="post-tag post-box-tag">
- <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">#{{ . }}</a>
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/tags/" | relLangURL }}{{ . | urlize}}">#{{ . }}</a>
</span>
{{ end }}
</div>
{{ end }}
<div class="post-box-title">
- <a href="{{.Permalink }}" class="title is-size-5">{{ .Title }}</a>
+ <a href="{{ .Permalink }}" class="title is-size-5">{{ .Title }}</a>
</div>
<div class="post-box-meta">
{{ .Date.Format "2006/01/02" }}
{{ with .Params.Categories }} ・
{{ range .}}
<span class="post-tag post-box-category">
- <a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
</span>
{{ end }}
{{ end }}
@@ -49,7 +50,7 @@
<div class="content">
{{ range .Site.Taxonomies.categories.ByCount }}
<div class="container" style="margin-bottom: 0.5rem">
- <a href="{{ "/categories/" | relLangURL }}{{ .Name | urlize }}">{{ .Name }}</a>
+ <a href="{{ $ctx.Site.BaseURL }}{{ "/categories/" | relLangURL }}{{ .Name | urlize }}">{{ .Name }}</a>
<span class="tag is-pulled-right">
{{ .Count }}
</span>
@@ -73,7 +74,7 @@
{{ range .Site.Taxonomies.tags.ByCount }}
<div class="control">
<div class="tags has-addons">
- <a class="tag" href="{{ "/tags/" | relLangURL }}{{ .Name | urlize }}/">{{ .Name }}</a>
+ <a class="tag" href="{{ $ctx.Site.BaseURL }}{{ "/tags/" | relLangURL }}{{ .Name | urlize }}/">{{ .Name }}</a>
<span class="tag counter-tag">
{{ .Count }}
</span>
diff --git a/layouts/partials/pwa.html b/layouts/partials/pwa.html
index 0884273..b0dd861 100644
--- a/layouts/partials/pwa.html
+++ b/layouts/partials/pwa.html
@@ -1,3 +1,3 @@
{{ $pwafile := resources.Get "js/pwa.js" }}
{{ $pwa := $pwafile | resources.ExecuteAsTemplate "js/pwa.js" . | resources.Minify }}
-<script src="{{ $pwa.Permalink | relURL }}"></script>
+<script src="{{ $pwa.Permalink | absURL }}"></script>
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index 2a5c87c..edf46ad 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -1,8 +1,8 @@
{{ $options := (dict "outputStyle" "compressed" "includePaths" (slice "sass")) }}
{{ $tocScss := resources.Get "css/toc.scss" }}
{{ $toc := $tocScss | resources.ExecuteAsTemplate "css/toc.scss" . | resources.ToCSS $options | resources.Minify }}
-<link rel="stylesheet" type="text/css" href="{{ $toc.Permalink | relURL }}">
-<script src="/js/tocbot.min.js"></script>
+<link rel="stylesheet" type="text/css" href="{{ $toc.Permalink | absURL }}">
+<script src={{ "js/tocbot.min.js" | absURL }}></script>
{{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default false }}
<script>
tocbot.init({