Skip to content

Commit

Permalink
Added schedule posts support for localized posts
Browse files Browse the repository at this point in the history
Signed-off-by: George Araújo <[email protected]>
  • Loading branch information
george-gca committed Sep 9, 2024
1 parent 07692b6 commit 5ca14d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/schedule-posts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ jobs:
id: date
run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Check for drafts and move to posts
- name: Check for scheduled posts and move to posts
run: |
echo "Today is $TODAY"
shopt -s nullglob
for file in _scheduled/${TODAY}-*.md; do
for file in _scheduled/**/${TODAY}-*.md; do
echo "Found scheduled: $file"
mv "$file" "_posts/"
echo "Moved $file to _posts/"
parent_dir="$(dirname "$file")"
language_dir="$(basename "$parent_dir")"
mv "$file" "_posts/$language_dir/"
echo "Moved $file to _posts/$language_dir/"
done

- name: Commit and push changes
Expand Down
8 changes: 4 additions & 4 deletions CUSTOMIZE.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,19 @@ You can customize the fonts, spacing, and more by editing [\_sass/\_base.scss](_

## Scheduled Posts

al-folio contains a workflow which automatically publishes all posts scheduled at a specific day, at the end of the day (23:30). By default the action is disabled, and to enable it you need to go to `.github/workflows/` and find the file called `schedule-posts.txt`. This is the workflow file. For GitHub to recognize it as one (or to enable the action), you need to rename it to `schedule-posts.yml`.
`al-folio` contains a workflow which automatically publishes all posts scheduled at a specific day, at the end of the day (23:30). By default the action is disabled, and to enable it you need to go to `.github/workflows/` and find the file called `schedule-posts.txt`. This is the workflow file. For GitHub to recognize it as one (or to enable the action), you need to rename it to `schedule-posts.yml`.

In order to use this you need to save all of your "Completed" blog posts which are scheduled to be uploaded on a specific date, in a folder named `_scheduled/` in the root directory.

> Incomplete posts should be saved in `_drafts/`

### Name Format

In this folder you need to store your file in the same format as you would in `_posts/`
In this folder you need to store your file in the same format as you would in `_posts/`, including the language directory.

example file: `2024-08-26-This file will be uploaded on 26 August.md`
> Example file name: `2024-08-26-This file will be uploaded on 26 August.md`

### Important Notes:
### Important Notes

- The scheduler uploads posts everyday at 🕛 23:30 UTC
- It will only upload posts at 23:30 UTC of their respective scheduled days, It's not uploaded in 23:59 in case there are a lot of files as the scheduler must finish before 00:00
Expand Down

0 comments on commit 5ca14d5

Please sign in to comment.