Getting Started:
Fork https://github.com/jackyzha0/quartz
Clone the repo
Resource:
https://quartz.jzhao.xyz/
Auto Publish:
Run sync script plus git push
Create a publish-content.sh
file.
#!/bin/bash
# Run the sync-content.sh script which is outside of this repo
. ./sync-content.sh
wait
# Add all changes to the staging area
git add content
# Check if there are any changes
if [[ -z $( git status --porcelain ) ]]; then
echo "No changes to commit. Exiting..."
exit 0
fi
# Commit the changes
commit_message = "Sync content at $( date '+%Y-%m-%d %H:%M:%S')"
git commit -m " $commit_message "
# Push the changes to the remote repository
git push
When you have a content that you want to publish, run ./publish-content.sh
.
Create sync-content.sh
file one level outside the repo. The content of the file should copy from the Obsidian folder, and replace the content in this repo.
#!/bin/bash
# Define source and target directories
SOURCE_DIR = "<folder-pathname>/public"
TARGET_DIR = "<git-root-folder>/content"
# Use rsync to replace the contents of the target directory with the source directory
rsync -a --delete " $SOURCE_DIR /" " $TARGET_DIR "
Hosting:
Resource: https://quartz.jzhao.xyz/hosting