This commit is contained in:
Aldo Funes 2025-03-11 11:30:54 +00:00
parent 140b052dc0
commit 56d3356ded
No known key found for this signature in database
4 changed files with 8 additions and 5 deletions

View File

@ -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
}

View File

@ -1,5 +1,8 @@
+++
title = "Infrastructure as code"
[extra]
social_media_card = "img/social_cards/blog_infrastructure_as_code.jpg"
+++
```rust

View File

@ -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 "$@"

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB