-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Added a script for streamlined creation of a blog folder and …
…its corresponding index.md file. (#80) * ✨ feat: Added a script for streamlined creation of a blog folder and its corresponding index.md file. Execute the command pnpm run createblog YOURDIRNAME from the root directory in your terminal to quickly create a folder under /user/blogs, along with an accompanying index.md file. * ✨ feat: Added a script for streamlined creation of a blog folder and its corresponding index.md file. ✨ feat: Added a script for streamlined creation of a blog folder and its corresponding index.md file.
- Loading branch information
1 parent
d6814ba
commit c91a291
Showing
6 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@kwchang0831/svelte-qwer': minor | ||
--- | ||
|
||
✨ feat: Added a script for streamlined creation of a blog folder and its corresponding index.md file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"adapter": "svelte", | ||
"esmImports": true, | ||
"$schema": "https://unpkg.com/typesafe-i18n@5.26.2/schema/typesafe-i18n.json" | ||
} | ||
"adapter": "svelte", | ||
"esmImports": true, | ||
"$schema": "https://unpkg.com/typesafe-i18n@5.26.2/schema/typesafe-i18n.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
BASE_PATH="./user/blogs" | ||
|
||
# Check if a directory name is provided | ||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <directory-name>" | ||
exit 1 | ||
fi | ||
|
||
# Every time you enter pnpm run createblog YourDirName, | ||
# a folder will be created for you based on the following configuration, | ||
# along with a default content for index.md. | ||
# You are free to edit the information as needed. | ||
|
||
DIRECTORY="$BASE_PATH/$1" | ||
MD_TEMPLATE="--- | ||
title: | ||
description: | ||
summary: | ||
cover: ./cover.jpg | ||
coverCaption: Photo by | ||
coverStyle: 'IN' | ||
series_tag: | ||
series_title: | ||
tag: | ||
- [JavaSript] | ||
---" | ||
|
||
# Ensure base path exists | ||
if [ ! -d "$BASE_PATH" ]; then | ||
mkdir -p "$BASE_PATH" | ||
fi | ||
|
||
# Check if directory exists | ||
if [ -d "$DIRECTORY" ]; then | ||
echo "Directory $DIRECTORY already exists!" | ||
else | ||
mkdir "$DIRECTORY" | ||
echo "$MD_TEMPLATE" > "$DIRECTORY/index.md" | ||
echo "Directory $DIRECTORY and index.md created successfully!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters