Skip to content

Commit 57a0a98

Browse files
committed
restored the mistakenly auto-formatted lines
1 parent 6073e57 commit 57a0a98

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

create_post.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

33
# Calculate the next Tuesday (or today if it's Tuesday)
4-
current_weekday=$(date +%w) # 0=Sun ... 6=Sat
5-
days_to_tuesday=$(((2 - current_weekday + 7) % 7))
4+
current_weekday=$(date +%w) # 0=Sun ... 6=Sat
5+
days_to_tuesday=$(( (2 - current_weekday + 7) % 7 ))
66

77
# Add the calculated days (compatible with both macOS and Linux)
88
if date -v +0d &>/dev/null; then
@@ -13,10 +13,9 @@ else
1313
tuesday=$(date -d "+${days_to_tuesday} days" +%Y-%m-%d)
1414
fi
1515

16-
year=${tuesday%%-*} # 2026
17-
month=${tuesday#*-}
18-
month=${month%-*} # 02
19-
day=${tuesday##*-} # 24
16+
year=${tuesday%%-*} # 2026
17+
month=${tuesday#*-}; month=${month%-*} # 02
18+
day=${tuesday##*-} # 24
2019

2120
# Define paths
2221
folder_path="docs/posts/$year/$month/$day"
@@ -26,7 +25,7 @@ file_path="$folder_path/index.md"
2625
mkdir -p "$folder_path"
2726

2827
# YAML frontmatter
29-
cat <<EOF >"$file_path"
28+
cat << EOF > "$file_path"
3029
---
3130
title: "Your Blog Post Title"
3231
date: $tuesday
@@ -54,4 +53,3 @@ echo ""
5453
echo "Reminder: Use existing categories and tags when possible."
5554

5655
python "./docs/find_tags_categories.py"
57-

0 commit comments

Comments
 (0)