From 73748a364e2903c4c63fe0c01b252e383883a3f9 Mon Sep 17 00:00:00 2001 From: uluumbch Date: Sat, 8 May 2021 04:49:12 +0700 Subject: [PATCH] add reading time feature --- assets/icons/date.svg | 9 ++++ assets/jsconfig.json | 16 ++++---- layouts/partials/article-list/compact.html | 41 +++++++++---------- .../partials/article/components/details.html | 13 ++++-- 4 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 assets/icons/date.svg diff --git a/assets/icons/date.svg b/assets/icons/date.svg new file mode 100644 index 0000000..ed92a90 --- /dev/null +++ b/assets/icons/date.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/assets/jsconfig.json b/assets/jsconfig.json index 9321136..377218c 100644 --- a/assets/jsconfig.json +++ b/assets/jsconfig.json @@ -1,10 +1,10 @@ { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "*": [ - "*" - ] - }, - } + "compilerOptions": { + "baseUrl": ".", + "paths": { + "*": [ + "*" + ] + } + } } \ No newline at end of file diff --git a/layouts/partials/article-list/compact.html b/layouts/partials/article-list/compact.html index 0f5a216..ebdc8bd 100644 --- a/layouts/partials/article-list/compact.html +++ b/layouts/partials/article-list/compact.html @@ -6,34 +6,31 @@ {{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}} {{ if $image.exists }} -
- {{ if $image.resource }} - {{- $Permalink := $image.resource.RelPermalink -}} - {{- $Width := $image.resource.Width -}} - {{- $Height := $image.resource.Height -}} +
+ {{ if $image.resource }} + {{- $Permalink := $image.resource.RelPermalink -}} + {{- $Width := $image.resource.Width -}} + {{- $Height := $image.resource.Height -}} - {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} - {{- $thumbnail := $image.resource.Fill "120x120" -}} - {{- $Permalink = $thumbnail.RelPermalink -}} - {{- $Width = $thumbnail.Width -}} - {{- $Height = $thumbnail.Height -}} - {{- end -}} - - - {{ else }} - Featured image of post {{ .Title }} - {{ end }} -
+ {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} + {{- $thumbnail := $image.resource.Fill "120x120" -}} + {{- $Permalink = $thumbnail.RelPermalink -}} + {{- $Width = $thumbnail.Width -}} + {{- $Height = $thumbnail.Height -}} + {{- end -}} + + + {{ else }} + Featured image of post {{ .Title }} + {{ end }} +
{{ end }} \ No newline at end of file diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html index 5c5397b..377e10a 100644 --- a/layouts/partials/article/components/details.html +++ b/layouts/partials/article/components/details.html @@ -2,9 +2,10 @@ {{ if .Params.categories }}
{{ range (.GetTerms "categories") }} - - {{ .LinkTitle }} - + + {{ .LinkTitle }} + {{ end }}
{{ end }} @@ -23,9 +24,13 @@ {{- if not .Date.IsZero -}} {{- end -}}