Anwar Hahn (2022-06-09)
References
- https://github.com/pyenv/pyenv
- https://www.mkdocs.org/getting-started/
- https://firebase.google.com/docs/hosting
- https://github.com/squidfunk/mkdocs-material
Create a static site using markdown in the next 15 minutes.
This is interactive so everyone can follow along!
- Make a directory to hold our files. Change into that directory.
mkdir ssg-tech-talk && cd ssg-tech-talk
- Make a virtual environment for python. You may need to run
deactivate
first.
mkvirtualenv ssg-tech-talk --python=/Users/anwarhahn/.pyenv/versions/3.7.2/bin/python
- Install
mkdocs
andmkdocs-material
.
pip install mkdocs
pip install mkdocs-material
- Create a git repo.
git init
echo "site/" >> .gitignore
- Create a new project.
mkdocs new my-project
cd my-project
- Serve the page locally. And check the results.
mkdocs serve
-
Use
CTRL+C
to stop the server. -
Commit our changes.
git add ..
git commit -m "initial commit"
- Let's build our static site.
mkdocs build
-
Poke around in the
site/
directory. -
Install the Firebase CLI. https://firebase.google.com/docs/cli#mac-linux-npm
npm install -g firebase-tools
- Login and test the Firebase CLI. https://firebase.google.com/docs/cli#sign-in-test-cli
firebase login
? Allow Firebase to collect CLI usage and error reporting information? No
- Initialize the firebase project. https://firebase.google.com/docs/cli#initialize_a_firebase_project
cd ..
firebase init
❯◯ Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
❯ Create a new project
? Please specify a unique project id (warning: cannot be modified afterward) [6-30 characters]:
() ssg-tech-talk
- If you run into an error then go to https://console.firebase.google.com/
And then run
firebase init
- Deploy
mkdocs build && firebase deploy
- Change the theme https://github.com/squidfunk/mkdocs-material
pip install mkdocs-material
- Add the following lines to
mkdocs.yml
:
theme:
name: material
- Review the other settings in
mkdocs.yml
. - Consider adding a
Makefile
. - Add some new pages and change the navigation layout.
- Add some additional CSS.