From 850e8f380e09e15350a03c95d73a57230dafde38 Mon Sep 17 00:00:00 2001 From: Dillon Date: Sat, 22 Feb 2020 01:14:01 +0800 Subject: [PATCH] fix(summary): use description as summary when summary is empty --- .circleci/config.yml | 17 ++++------------- layouts/_default/summary.html | 6 +++++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed875665..b13f3452 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,6 @@ version: 2.1 jobs: build-check: - parameters: - example-site-path: - type: string - theme-path: - type: string docker: - image: cibuilds/hugo:0.62 working_directory: ~/LoveIt @@ -13,14 +8,10 @@ jobs: - checkout - run: git submodule sync - run: git submodule update --init - - run: - command: | - cd << parameters.example-site-path >> && pwd - HUGO_ENV=production hugo --themesDir << parameters.theme-path >> -v --gc - htmlproofer public --check-html --allow-hash-href --empty-alt-ignore --disable-external + - run: HUGO_ENV=production hugo --source=exampleSite -v --gc + - run: htmlproofer exampleSite/public --check-html --allow-hash-href --empty-alt-ignore --disable-external + workflows: build-check-exampleSite: jobs: - - build-check: - example-site-path: exampleSite - theme-path: ../.. + - build-check diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index d13273e5..5df72113 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -44,7 +44,11 @@ {{- /* Summary content */ -}}
- {{- partial "single/content.html" .Summary -}} + {{- with .Summary -}} + {{- partial "single/content.html" . -}} + {{- else -}} + {{- .Description | safeHTML -}} + {{- end -}}
{{- /* Footer */ -}}