From 746537a801bbf851248be44d0bbc7ff8dab1636f Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 29 Aug 2020 11:34:26 +0200 Subject: [PATCH] refactor(article): add components/details --- layouts/partials/article-list/default.html | 39 +------------------ .../partials/article/components/details.html | 38 ++++++++++++++++++ .../partials/article/components/header.html | 38 +----------------- 3 files changed, 40 insertions(+), 75 deletions(-) create mode 100644 layouts/partials/article/components/details.html diff --git a/layouts/partials/article-list/default.html b/layouts/partials/article-list/default.html index 84fc93b..e58ef18 100644 --- a/layouts/partials/article-list/default.html +++ b/layouts/partials/article-list/default.html @@ -12,42 +12,5 @@ {{ end }} - {{ $i := .Params.image }} - {{ $context := . }} - -
- {{ with $categories := .Params.categories }} - - {{ end }} - -

- - {{- .Title -}} - -

- - {{ with .Params.description }} -

- {{ . }} -

- {{ end }} - -
- {{ (resources.Get "icons/clock.svg").Content | safeHTML }} - -
-
+ {{ partial "article/components/details" . }} \ No newline at end of file diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html new file mode 100644 index 0000000..99c26f8 --- /dev/null +++ b/layouts/partials/article/components/details.html @@ -0,0 +1,38 @@ +{{ $i := .Params.image }} +{{ $context := . }} + +
+ {{ with $categories := .Params.categories }} + + {{ end }} + +

+ + {{- .Title -}} + +

+ + {{ with .Params.description }} +

+ {{ . }} +

+ {{ end }} + +
+ {{ (resources.Get "icons/clock.svg").Content | safeHTML }} + +
+
\ No newline at end of file diff --git a/layouts/partials/article/components/header.html b/layouts/partials/article/components/header.html index 632be2f..1bd5663 100644 --- a/layouts/partials/article/components/header.html +++ b/layouts/partials/article/components/header.html @@ -13,41 +13,5 @@ {{ end }} - {{ $i := .Params.image }} - {{ $context := . }} -
- {{ with $categories := .Params.categories }} - - {{ end }} - -

- - {{- .Title -}} - -

- - {{ with .Params.description }} -

- {{ . }} -

- {{ end }} - - -
+ {{ partial "article/components/details" . }} \ No newline at end of file