From 804d1e484d8cbbb14552cddc81302fca6e09326c Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sun, 31 Dec 2023 13:05:10 +0800 Subject: [PATCH] :truck: Feat: migrate offline page to build-in page remove offline type and layput --- archetypes/offline.md | 9 -------- docs | 2 +- hugo.toml | 10 +++++++- .../{page/offline.html => index.offline.html} | 0 layouts/offline/single.html | 23 ------------------- layouts/partials/init/global.html | 1 + 6 files changed, 11 insertions(+), 34 deletions(-) delete mode 100644 archetypes/offline.md rename layouts/{page/offline.html => index.offline.html} (100%) delete mode 100644 layouts/offline/single.html diff --git a/archetypes/offline.md b/archetypes/offline.md deleted file mode 100644 index 73fd738cc..000000000 --- a/archetypes/offline.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -layout: offline -description: '{{ T "offlineTitle" }} | {{ .Site.Title }}' -keywords: - - PWA - - {{ T "offlineTitle" }} ---- - - diff --git a/docs b/docs index fda1a078d..19740c371 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit fda1a078d3e15d3193f7a35acebfab5aaf9e54ca +Subproject commit 19740c371950563a14a9312d31312424d73cde5e diff --git a/hugo.toml b/hugo.toml index 8bf98e11b..50e037326 100644 --- a/hugo.toml +++ b/hugo.toml @@ -233,6 +233,14 @@ enableEmoji = true isPlainText = false isHTML = true permalinkable = true + # FixIt 0.3.0 | NEW Options to make output /offline/index.html file + [offline] + path = "offline" + baseName = "index" + mediaType = "text/html" + isPlainText = false + isHTML = true + permalinkable = true # ------------------------------------------------------------------------------------- # Customizing Output Formats @@ -240,7 +248,7 @@ enableEmoji = true # ------------------------------------------------------------------------------------- [outputs] - home = ["HTML", "RSS", "JSON", "BaiduUrls", "archives"] + home = ["HTML", "RSS", "JSON", "BaiduUrls", "archives", "offline"] page = ["HTML", "MarkDown"] section = ["HTML", "RSS"] taxonomy = ["HTML"] diff --git a/layouts/page/offline.html b/layouts/index.offline.html similarity index 100% rename from layouts/page/offline.html rename to layouts/index.offline.html diff --git a/layouts/offline/single.html b/layouts/offline/single.html deleted file mode 100644 index 3b80ffc50..000000000 --- a/layouts/offline/single.html +++ /dev/null @@ -1,23 +0,0 @@ -{{- /* TODO remove this template */ -}} -{{- warnf "The `type:offline` in front matter is deprecated. Use `layout:offline` instead.\n" -}} -{{- warnf "Front matter 参数 `type:offline` 已弃用。请改用 `layout:offline`。" -}} -{{- define "title" -}} - {{- T "offlineTitle" -}} - {{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}} -{{- end -}} - -{{- define "content" -}} -
-
-

{{- T "offlineTitle" -}}

-

- - ERROR_INTERNET_DISCONNECTED -

-
-

{{- T "offlineText" -}}

-
-{{- end -}} diff --git a/layouts/partials/init/global.html b/layouts/partials/init/global.html index c587bb2ea..4a3319bbe 100644 --- a/layouts/partials/init/global.html +++ b/layouts/partials/init/global.html @@ -8,4 +8,5 @@ {{- /* Set site home relative permalink */ -}} {{- $homeRelPermalink := .Site.Home.RelPermalink -}} {{- $homeRelPermalink = strings.TrimSuffix "archives/" $homeRelPermalink -}} +{{- $homeRelPermalink = strings.TrimSuffix "offline/" $homeRelPermalink -}} {{- .Scratch.Set "homeRelPermalink" $homeRelPermalink -}}