From a699d102be04005c405a722a6314cba0ac84b6c3 Mon Sep 17 00:00:00 2001 From: Nanush7 <59543882+Nanush7@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:36:47 -0300 Subject: [PATCH 1/2] Fix pagetitle for minutes and motions --- bin/build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index 924fcf5a..e1e4f004 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -21,8 +21,14 @@ convert_to_pdf() { pdf_path="${file%.md}.pdf" html_path="${file%.md}.html" - # Use first header as the document title; remove all # characters and whitespace from the beginning - document_title=$(head -n 1 "$file" | sed -E "s/^#+\s*//") + if [[ "$file" =~ build/documents/(motions|minutes)/(([a-zA-Z0-9.\-]|[[:blank:]])+)\.md ]]; then + # We need this for minutes and motions to have the correct document title. Otherwise it uses "{.text-center}" + # or "SUBMISSION OF PROPOSED MOTION". + document_title=${BASH_REMATCH[2]} + else + # Use first header as the document title; remove all # characters and whitespace from the beginning + document_title=$(head -n 1 "$file" | sed -E "s/^#+\s*//") + fi # Absolute path to the custom stylesheet custom_stylesheet="./assets/$1-style.css" custom_stylesheet_path=$(realpath "$custom_stylesheet") From 0b60dc77ab5dcd59beaf38ebfa271aa0a0873122 Mon Sep 17 00:00:00 2001 From: Nanush7 <59543882+Nanush7@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:59:23 -0300 Subject: [PATCH 2/2] Add underscore to regex --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index e1e4f004..f5afe340 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -21,7 +21,7 @@ convert_to_pdf() { pdf_path="${file%.md}.pdf" html_path="${file%.md}.html" - if [[ "$file" =~ build/documents/(motions|minutes)/(([a-zA-Z0-9.\-]|[[:blank:]])+)\.md ]]; then + if [[ "$file" =~ build/documents/(motions|minutes)/(([a-zA-Z0-9._\-]|[[:blank:]])+)\.md ]]; then # We need this for minutes and motions to have the correct document title. Otherwise it uses "{.text-center}" # or "SUBMISSION OF PROPOSED MOTION". document_title=${BASH_REMATCH[2]}