test
This commit is contained in:
parent
140b052dc0
commit
56d3356ded
@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
. ./static/code/social-cards-zola
|
|
||||||
|
|
||||||
###################################################################################
|
###################################################################################
|
||||||
# This script is run by git before a commit is made. #
|
# 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. #
|
# 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 to update the social media card for a post or section.
|
||||||
function generate_and_commit_card {
|
function generate_and_commit_card {
|
||||||
local file=$1
|
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"
|
echo "Failed to update social media card for $file"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
+++
|
+++
|
||||||
title = "Infrastructure as code"
|
title = "Infrastructure as code"
|
||||||
|
|
||||||
|
[extra]
|
||||||
|
social_media_card = "img/social_cards/blog_infrastructure_as_code.jpg"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
```rust
|
```rust
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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,
|
# 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.
|
# takes a screenshot, and saves it to a specified location.
|
||||||
@ -176,7 +176,7 @@ function update_front_matter {
|
|||||||
mv "$temp_awk" "$md_file_path"
|
mv "$temp_awk" "$md_file_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
function social-cards-zola() {
|
function main() {
|
||||||
while [[ "$#" -gt 0 ]]; do
|
while [[ "$#" -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h|--help)
|
-h|--help)
|
||||||
@ -224,3 +224,5 @@ function social-cards-zola() {
|
|||||||
echo "$image_filename"
|
echo "$image_filename"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main "$@"
|
BIN
static/img/social_cards/blog_infrastructure_as_code.jpg
Normal file
BIN
static/img/social_cards/blog_infrastructure_as_code.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
Loading…
x
Reference in New Issue
Block a user