From 176ec48ceadf3721a06dd524997267920c8e59cc Mon Sep 17 00:00:00 2001 From: Yassine Zouggari Date: Tue, 3 Dec 2024 23:01:38 +0100 Subject: [PATCH] Check if page.description is empty before trying to use it The article.html template, when the sharing button is enabled, uses the description of the page to generate the share link. However the end user may not want descriptions. If a page description is empty, the following error is thrown: ``` Error: Failed to build the site Error: Failed to render page '/home...index.md' Error: Reason: Failed to render 'article.html' Error: Reason: Filter call 'urlencode' failed Error: Reason: Filter `urlencode` was called on an incorrect value: got `null` but expected a String ``` We now check if the description is not empty before passing it to urlencode, and don't use it if it is not set --- templates/article.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/article.html b/templates/article.html index 1d8fa67..89489be 100644 --- a/templates/article.html +++ b/templates/article.html @@ -116,7 +116,7 @@ {%- endif -%} {%- if config.extra.show_share_button -%} - + {%- endif -%} {%- if config.extra.issues_url -%}