From db4d28b6425f7f19a9dbd20aee1a9ce30e483c94 Mon Sep 17 00:00:00 2001 From: liuboaibc Date: Thu, 13 Aug 2020 12:59:30 +0800 Subject: [PATCH] update content page --- layouts/blogs/single.html | 46 +------------------------------ layouts/conferences/single.html | 46 +------------------------------ layouts/news/single.html | 46 +------------------------------ layouts/partials/content.html | 49 +++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 135 deletions(-) create mode 100644 layouts/partials/content.html diff --git a/layouts/blogs/single.html b/layouts/blogs/single.html index f1ea43ff7..f4508cda7 100644 --- a/layouts/blogs/single.html +++ b/layouts/blogs/single.html @@ -1,45 +1 @@ - - -{{- partial "head.html" . -}} - -{{ $style := resources.Get "scss/content.scss" | toCSS | minify | fingerprint }} - - -{{ $style := resources.Get "scss/markdown.scss" | toCSS | minify | fingerprint }} - - - -{{- partial "header.html" . -}} -
-
- -
-
{{ .Params.author }}
-
{{ i18n "Published on" }}:{{ string .Params.createTime }}
-

{{ .Title }}

- -
-
- {{ .Content }} -
-
- -
-
-
{{ i18n "Table of Contents" }}
-
{{ .TableOfContents }}
-
-
-
-{{- partial "footer.html" . -}} - - - - \ No newline at end of file +{{ partial "content.html" (dict "context" . "parent" "blogs" "text" "Technology Blogs") }} diff --git a/layouts/conferences/single.html b/layouts/conferences/single.html index ab6a45c04..24fb85b6a 100644 --- a/layouts/conferences/single.html +++ b/layouts/conferences/single.html @@ -1,45 +1 @@ - - -{{- partial "head.html" . -}} - -{{ $style := resources.Get "scss/content.scss" | toCSS | minify | fingerprint }} - - -{{ $style := resources.Get "scss/markdown.scss" | toCSS | minify | fingerprint }} - - - -{{- partial "header.html" . -}} -
-
- -
-
{{ .Params.author }}
-
{{ i18n "Published on" }}:{{ string .Params.createTime }}
-

{{ .Title }}

- -
-
- {{ .Content }} -
-
- -
-
-
{{ i18n "Table of Contents" }}
-
{{ .TableOfContents }}
-
-
-
-{{- partial "footer.html" . -}} - - - - \ No newline at end of file +{{ partial "content.html" (dict "context" . "parent" "conferences" "text" "KubeCon & QCon") }} diff --git a/layouts/news/single.html b/layouts/news/single.html index cee37d2ba..5c2a2495c 100644 --- a/layouts/news/single.html +++ b/layouts/news/single.html @@ -1,45 +1 @@ - - -{{- partial "head.html" . -}} - -{{ $style := resources.Get "scss/content.scss" | toCSS | minify | fingerprint }} - - -{{ $style := resources.Get "scss/markdown.scss" | toCSS | minify | fingerprint }} - - - -{{- partial "header.html" . -}} -
-
- -
-
{{ .Params.author }}
-
{{ i18n "Published on" }}:{{ string .Params.createTime }}
-

{{ .Title }}

- -
-
- {{ .Content }} -
-
- -
-
-
{{ i18n "Table of Contents" }}
-
{{ .TableOfContents }}
-
-
-
-{{- partial "footer.html" . -}} - - - - \ No newline at end of file +{{ partial "content.html" (dict "context" . "parent" "news" "text" "news") }} \ No newline at end of file diff --git a/layouts/partials/content.html b/layouts/partials/content.html new file mode 100644 index 000000000..84b43b24a --- /dev/null +++ b/layouts/partials/content.html @@ -0,0 +1,49 @@ +{{ $context := .context }} +{{ $parent := .parent }} +{{ $text := .text }} + + +{{- partial "head.html" . -}} + +{{ $style := resources.Get "scss/content.scss" | toCSS | minify | fingerprint }} + + +{{ $style := resources.Get "scss/markdown.scss" | toCSS | minify | fingerprint }} + + + + {{ partial "header.html" $context }} +
+
+ +
+
{{ $context.Params.author }}
+
{{ i18n "Published on" }}:{{ string $context.Params.createTime }}
+

{{ $context.Title }}

+ +
+
+ {{ $context.Content }} +
+
+ +
+
+
{{ i18n "Table of Contents" }}
+
{{ $context.TableOfContents }}
+
+
+
+ {{ partial "footer.html" $context }} + + + + \ No newline at end of file