From eb0acca980ba6bdd946aa02c552d22cdaca31124 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Thu, 9 May 2024 15:44:57 +0800 Subject: [PATCH] :sparkles: Feat: add unified custom template entry file `layouts/partials/custom.html` --- layouts/_default/baseof.html | 3 +++ layouts/partials/assets.html | 3 +++ layouts/partials/custom.html | 22 ++++++++++++++++++++++ layouts/partials/footer.html | 5 ++++- layouts/partials/home/profile.html | 5 ++++- layouts/partials/widgets.html | 8 ++++++-- layouts/posts/single.html | 6 +++++- 7 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 layouts/partials/custom.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 9ca82014..86841d70 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,4 +1,5 @@ {{- partial "init/index.html" . -}} +{{- partial "custom.html" . -}} @@ -14,6 +15,8 @@ {{- partial "head/meta.html" . -}} {{- partial "head/link.html" . -}} {{- partial "head/seo.html" . -}} + {{- /* Custom head */ -}} + {{- block "custom-head" . }}{{ end -}}
{{- /* Check theme isDark before body rendering */ -}} diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 93d2a5bf..abda23e7 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -306,3 +306,6 @@ {{- end -}} {{- partial "plugin/analytics.html" . -}} + +{{- /* Custom Assets */ -}} +{{- block "custom-assets" . }}{{ end -}} diff --git a/layouts/partials/custom.html b/layouts/partials/custom.html new file mode 100644 index 00000000..f73a81f3 --- /dev/null +++ b/layouts/partials/custom.html @@ -0,0 +1,22 @@ +{{- /* + In order to avoid upgrade conflicts and to easily reference theme components, + It's recommended to copy this file from the theme to your project and rewrite it. +*/ -}} + +{{- define "custom-head" -}} +{{- end -}} + +{{- define "custom-profile" -}} +{{- end -}} + +{{- define "custom-aside" -}} +{{- end -}} + +{{- define "custom-footer" -}} +{{- end -}} + +{{- define "custom-widgets" -}} +{{- end -}} + +{{- define "custom-assets" -}} +{{- end -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index dbf2f13f..0506dedf 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -3,9 +3,12 @@ {{- if ne $footerConfig.enable false -}}