Skip to content

Commit 2928157

Browse files
committed
Update post creation scripts to include descriptive title in directory structure
1 parent da338f5 commit 2928157

4 files changed

Lines changed: 26 additions & 14 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,18 @@ Two helper scripts are available for creating new blog posts:
134134

135135
1. **Bash Script** (`create_post.sh`):
136136
- Calculates next Tuesday from current date
137-
- Creates directory structure: `docs/posts/YYYY/MM/DD/`
137+
- Creates directory structure: `docs/posts/YYYY/MM/DD/YYYY-MM-DD-title-of-post/`
138138
- Generates `index.md` with proper frontmatter template
139139
- Usage: `./create_post.sh`
140+
- **Note**: Rename the created folder with a descriptive title after running
140141

141142
2. **PowerShell Script** (`create_post.ps1`):
142143
- Same functionality as bash script
143144
- For Windows users
144145
- Usage: `.\create_post.ps1`
146+
- **Note**: Rename the created folder with a descriptive title after running
145147

146-
Both scripts automatically determine the date of the next Tuesday (or current day if Tuesday) and create the appropriate directory structure.
148+
Both scripts automatically determine the date of the next Tuesday (or current day if Tuesday) and create the appropriate directory structure with a placeholder title. After running, rename the folder to include a descriptive title (e.g., `2026-01-13-ai-coding-assistants`).
147149

148150
## Development Workflows
149151

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ We provide scripts to automatically create properly formatted blog posts for the
7474

7575
These scripts will:
7676
- Calculate the date of the next Tuesday (or use today if it's Tuesday)
77-
- Create the directory structure: `docs/posts/YYYY/MM/DD/`
77+
- Create the directory structure: `docs/posts/YYYY/MM/DD/YYYY-MM-DD-title-of-post/`
7878
- Generate an `index.md` file with proper frontmatter
7979

80+
**Note**: After running the script, rename the created folder to include a descriptive title (e.g., `2026-01-13-ai-coding-assistants`). This allows multiple posts on the same day.
81+
8082
### Manual Blog Post Creation
8183

82-
1. Create a directory following the date pattern: `docs/posts/YYYY/MM/DD/`
84+
1. Create a directory following the date pattern: `docs/posts/YYYY/MM/DD/YYYY-MM-DD-title-of-post/`
85+
- Example: `docs/posts/2026/01/13/2026-01-13-ai-coding-assistants/`
86+
- The descriptive title allows for multiple posts on the same day
8387

8488
2. Create an `index.md` file with the following frontmatter:
8589
```yaml
@@ -122,7 +126,7 @@ These scripts will:
122126
├── hosts/ # Current hosts
123127
├── past-hosts/ # Past hosts
124128
├── sponsors/ # Sponsors
125-
├── posts/ # Blog posts (YYYY/MM/DD/)
129+
├── posts/ # Blog posts (YYYY/MM/DD/YYYY-MM-DD-title/)
126130
├── assets/ # Images, logos
127131
└── stylesheets/
128132
└── extra.css # Custom CSS

create_post.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ $tuesdayDate = $currentDate.AddDays($daysToTuesday)
1919
$year = $tuesdayDate.Year
2020
$month = $tuesdayDate.Month.ToString("D2")
2121
$day = $tuesdayDate.Day.ToString("D2")
22+
$date = $tuesdayDate.ToString("yyyy-MM-dd")
2223

23-
24-
25-
# Define the folder path
26-
$folderPath = "docs/posts/$year/$month/$day"
24+
# Define the folder path with descriptive title placeholder
25+
# Format: YYYY-MM-DD-title-of-post (allows multiple posts per day)
26+
$postSlug = "$date-title-of-post"
27+
$folderPath = "docs/posts/$year/$month/$day/$postSlug"
2728

2829
# Create the folder if it doesn't exist
2930
if (-Not (Test-Path -Path $folderPath)) {
@@ -35,7 +36,6 @@ $filePath = "$folderPath/index.md"
3536

3637
# Create the markdown file with YAML front matter
3738
$title = "Your Blog Post Title"
38-
$date = $tuesdayDate.ToString("yyyy-MM-dd")
3939

4040
$yamlContent = @"
4141
---
@@ -55,4 +55,6 @@ Everyone and anyone are welcome to [join](https://weeklydevchat.com/join/) as lo
5555
# Write the content to the file
5656
Set-Content -Path $filePath -Value $yamlContent
5757

58-
Write-Output "Blog post template created at $filePath"
58+
Write-Output "Blog post template created at $filePath"
59+
Write-Output "Remember to rename the folder with a descriptive title!"
60+
Write-Output "Example: Rename-Item '$folderPath' '$date-your-topic-here'"

create_post.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ year=$(date -d "$tuesday" +%Y)
1313
month=$(date -d "$tuesday" +%02m)
1414
day=$(date -d "$tuesday" +%02d)
1515

16-
# Define paths
17-
folder_path="docs/posts/$year/$month/$day"
16+
# Define paths with descriptive title placeholder
17+
# Format: YYYY-MM-DD-title-of-post (allows multiple posts per day)
18+
post_slug="${tuesday}-title-of-post"
19+
folder_path="docs/posts/$year/$month/$day/$post_slug"
1820
file_path="$folder_path/index.md"
1921

2022
# Create the directory (including parents) if it doesn't exist
@@ -36,4 +38,6 @@ Everyone and anyone are welcome to [join](https://weeklydevchat.com/join/) as lo
3638
![alt text](${tuesday}_image_filename.webp)
3739
EOF
3840

39-
echo "Blog post template created at $file_path"
41+
echo "Blog post template created at $file_path"
42+
echo "Remember to rename the folder with a descriptive title!"
43+
echo "Example: mv '$folder_path' 'docs/posts/$year/$month/$day/${tuesday}-your-topic-here'"

0 commit comments

Comments
 (0)