Getting the repository
To get the repository on your local machine open a terminal in folder of your computer. Your home
folder is usually a good choice. Then run the following commands:
git clone https://github.com/NicholasCorniaOrpheus/decastrophizing-failure-through-playfulness.git
A copy of the GitHub repository will now be available.
# Get in the GitHub directory
cd ./decastrophizing-failure-through-playfulness
#Set the default branch to gh-pages
git checkout --orphan gh-pages
Test if you can commit changes:
# Add local changes
git add .
# Commit message
git commit --allow-empty -m "Test"
# Push the changes back to the repository
git push origin gh-pages
MkDocs installation
The website's content is compiled using the MkDocs Python module.
- Install the prerequisites (for Mac users using Homebrew), using pip and python3:
# Mac users:
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# Install Python 3
brew install python
python --version
Normally the terminal should return Python 3.x version.
- Install pip on Mac:
#Download the pip package
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# Install pip for python3
python3 get-pip.py
pip3 --version
- Install MkDocs and other dependencies
pip3 install mkdocs
pip3 install mkdocs-autorefs
pip3 install mkdocs-roamlinks-plugin
pip3 install mkdocs-material
Routine script
Make sure you are working with an updated version of the repository. You can pull the latest version by running the command:
git pull
Item pages, in Markdown format, will be available at the docs
folder.
You can modify the context of an item using Sublime Text, or create a new one copying the prototype.md
page in a new file.
To push the changes back to the repository run the following commands in terminal:
git add .
# commit with current date message
git commit -m date '+%Y-%m-%d'
# push to gh-pages branch
git push origin gh-pages
Alternatively, you can build and preview the website using mkdocs
, by positioning yourself in the directory where the .yml
configuration file is:
# Show preview website
mkdocs serve
# Build website in HTML in directory `site`
mkdocs build
# Commit changes to GitHub Pages
mkdocs gh-deploy
Markdown cheatsheet
name | syntax | result |
---|---|---|
italic | _text_ |
text |
bold | **text** |
text |
hyperlink | [text](url) |
text |
citation | text[^1]. [^1]: citation. |
text [^1]. [^1]: citation. |
internal link | [text](./page_name.md) |
text |
... |