From b346679cc7a7d1d2188f1325dbab117f8ed4300f Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Tue, 28 Dec 2021 21:30:45 +0800 Subject: [PATCH] :bug: Fix: Check if content is empty beforing passing --- CHANGELOG.md | 1 + layouts/partials/function/content.html | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0057d3a4..c8f41ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - :arrow_up: Chore: update all third-party libraries - :wrench: Chore: minify card-link background image - :wrench: Chore(i18n): change some translations +- :bug: Fix: Check if content is empty beforing passing ## v0.2.11 diff --git a/layouts/partials/function/content.html b/layouts/partials/function/content.html index f1d7ce81..838a737f 100644 --- a/layouts/partials/function/content.html +++ b/layouts/partials/function/content.html @@ -1,19 +1,23 @@ {{- $content := .Content -}} -{{- if .Ruby -}} +{{- if ne "" $content -}} + + {{- if .Ruby -}} {{- $content = partial "function/ruby.html" $content -}} -{{- end -}} + {{- end -}} -{{- if .Fraction -}} + {{- if .Fraction -}} {{- $content = partial "function/fraction.html" $content -}} -{{- end -}} + {{- end -}} -{{- if .Fontawesome -}} + {{- if .Fontawesome -}} {{- $content = partial "function/fontawesome.html" $content -}} + {{- end -}} + + {{- $content = partial "function/checkbox.html" $content -}} + + {{- $content = partial "function/escape.html" $content -}} + {{- end -}} -{{- $content = partial "function/checkbox.html" $content -}} - -{{- $content = partial "function/escape.html" $content -}} - {{- return $content -}}