From 845834baa6841d79ff737ef810a0270d02d21856 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Thu, 17 Sep 2020 19:47:03 +0200 Subject: [PATCH] refactor(footer): add footer/include.html To include HTML code for style and script --- layouts/_default/baseof.html | 4 +--- .../footer/{style.html => components/custom-font.html} | 0 layouts/partials/footer/{ => components}/script.html | 4 ++-- layouts/partials/footer/include.html | 3 +++ 4 files changed, 6 insertions(+), 5 deletions(-) rename layouts/partials/footer/{style.html => components/custom-font.html} (100%) rename layouts/partials/footer/{ => components}/script.html (70%) create mode 100644 layouts/partials/footer/include.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index bf3d511..1151e4e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,8 +9,6 @@ {{- block "right-sidebar" . -}}{{ end }} - {{ partial "footer/script.html" . }} - {{ partial "footer/style.html" . }} - {{ partial "footer/custom.html" . }} + {{ partial "footer/include.html" . }} diff --git a/layouts/partials/footer/style.html b/layouts/partials/footer/components/custom-font.html similarity index 100% rename from layouts/partials/footer/style.html rename to layouts/partials/footer/components/custom-font.html diff --git a/layouts/partials/footer/script.html b/layouts/partials/footer/components/script.html similarity index 70% rename from layouts/partials/footer/script.html rename to layouts/partials/footer/components/script.html index dbcaf48..08e357b 100644 --- a/layouts/partials/footer/script.html +++ b/layouts/partials/footer/components/script.html @@ -1,7 +1,7 @@ -{{ $opts := dict "minify" hugo.IsProduction }} -{{ $script := resources.Get "ts/main.ts" | js.Build $opts }} +{{- $opts := dict "minify" hugo.IsProduction -}} +{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}} \ No newline at end of file diff --git a/layouts/partials/footer/include.html b/layouts/partials/footer/include.html new file mode 100644 index 0000000..4b50a88 --- /dev/null +++ b/layouts/partials/footer/include.html @@ -0,0 +1,3 @@ +{{ partialCached "footer/components/script.html" . }} +{{ partialCached "footer/components/custom-font.html" . }} +{{ partial "footer/custom.html" . }} \ No newline at end of file