diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 215cb9f..6209645 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,7 +1,5 @@ #!/usr/bin/env bash -. ./static/code/social-cards-zola - ################################################################################### # This script is run by git before a commit is made. # # To use it, copy it to .git/hooks/pre-commit and make it executable. # @@ -71,7 +69,7 @@ function has_body_changes() { # Function to update the social media card for a post or section. function generate_and_commit_card { local file=$1 - social_media_card=$(social-cards-zola -o static/img/social_cards -b http://127.0.0.1:1111 -u -p -i "$file") || { + social_media_card=$(./static/code/social-cards-zola -o static/img/social_cards -b http://127.0.0.1:1111 -u -p -i "$file") || { echo "Failed to update social media card for $file" exit 1 } diff --git a/content/blog/infrastructure_as_code.md b/content/blog/infrastructure-as-code.md similarity index 74% rename from content/blog/infrastructure_as_code.md rename to content/blog/infrastructure-as-code.md index 9402015..c3f123b 100644 --- a/content/blog/infrastructure_as_code.md +++ b/content/blog/infrastructure-as-code.md @@ -1,5 +1,8 @@ +++ title = "Infrastructure as code" + +[extra] +social_media_card = "img/social_cards/blog_infrastructure_as_code.jpg" +++ ```rust diff --git a/static/code/social-cards-zola b/static/code/social-cards-zola index 7f42054..bd92625 100755 --- a/static/code/social-cards-zola +++ b/static/code/social-cards-zola @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#set -eo pipefail +set -eo pipefail # This script takes a markdown post, crafts the corresponding URL, checks if it's accessible, # takes a screenshot, and saves it to a specified location. @@ -176,7 +176,7 @@ function update_front_matter { mv "$temp_awk" "$md_file_path" } -function social-cards-zola() { +function main() { while [[ "$#" -gt 0 ]]; do case "$1" in -h|--help) @@ -224,3 +224,5 @@ function social-cards-zola() { echo "$image_filename" fi } + +main "$@" \ No newline at end of file diff --git a/static/img/social_cards/blog_infrastructure_as_code.jpg b/static/img/social_cards/blog_infrastructure_as_code.jpg new file mode 100644 index 0000000..b0fc588 Binary files /dev/null and b/static/img/social_cards/blog_infrastructure_as_code.jpg differ