Template)ΒΆ
Note: Currently, the generate_webpages.yaml contains placeholder values that must be replaced with paths and settings specific to your vault. Until these are updated, the workflow will fail.
WARNING: Once generated and copied the token cannot be retrieved again.
In event of key loss, generating a new key is the best course of action.
Control + P to open the Command Palette in obsidian and type Git:
Enter the remote URL as follows:
https://<USERNAME>:<PERSONAL_ACCESS_TOKEN>@github.com/<REPO_OWNER>/<REPO>.git
In folders, (if on windows) find the folder that contains your obsidian vault and find the
Before we edit the following files, let me briefly explain their purpose:
The first file is a GitHub Action workflow that runs automatically whenever a commit is pushed to the main branch. Its primary role is to copy specific files and folders from your repository into a docs
directory, which is then used to build and deploy a static site to the gh-pages
branch. This site is powered by MkDocs, a tool that converts Markdown files into static HTML pages.
The second file is another GitHub Action, however this one needs no changes whatsoever, as it's sole purpose is entirely GitHub related. It triggers a site rebuild and is only necessary for testing purposes.
Reminder 1: If your repository is set to public when created, all contents of your Obsidian vault will be openly accessible to anyone on the internet.
Reminder 2: Any files copied during this workflow will be publicly available via the gh-pages branch URL unless explicitly excluded in your mkdocs.yaml configuration.
Examples of how to handle folders and directories for copying to the site
Additional Tips:
git config --global core.longpaths true
(Allows long paths allowing for more elaborate organisation of folders and resources)
(This allows Git to handle paths longer than 260 characters, which is a common issue on Windows systems.)In the event of
FileNameTooLong
error see: FileNameTooLong Obsidian Error (Windows) Fix
git config --global core.autocrlf true
(CRLF (Carriage Return + Line Feed) being the Windows form of the Linux LF (Line Feed) denoting the end of line points in files.)
CRLF & LFSometimes when using Git on multiple devices while using the
Obsidian Sync
you may get anUnrelated Histories
error, the solution to this is:git pull origin main --allow-unrelated-histories