Use exclude plugin to allow symlinking instead of copying (#330)
* install mkdocs-exclude * add to config * change doc * update scripts * update docs to use scripts * move sitemap link * use scripts
This commit is contained in:
parent
f5ac07ead6
commit
5584455577
|
@ -25,16 +25,11 @@ jobs:
|
|||
run: |
|
||||
sudo apt update
|
||||
sudo apt install sshpass
|
||||
pip install mkdocs mkdocs-ezlinks-plugin
|
||||
bash ./bin/mkdocs-install.sh
|
||||
|
||||
- name: Generate static pages using mkdocs
|
||||
run: |
|
||||
shopt -s extglob
|
||||
cd mkdocs
|
||||
mkdir docs
|
||||
cp -r ../!(mkdocs) docs
|
||||
cp style.css docs
|
||||
mkdocs build
|
||||
bash ./bin/mkdocs-run.sh
|
||||
|
||||
- name: Set SSH variables
|
||||
env:
|
||||
|
|
|
@ -32,10 +32,9 @@ You need to set up an access token in your repository secrets for Actions.
|
|||
|
||||
The easiest way to test Wiki3 is locally. You could also set up a webserver and your repository secrets to let the workflow upload it for you, but here I'll just explain how to test locally.
|
||||
|
||||
The full instructions for installing MkDocs can be found [here](https://www.mkdocs.org/user-guide/installation/), but the short version is to run `pip install mkdocs`.
|
||||
You will also need the EzLinks plugin, which you can install with `pip install mkdocs-ezlinks-plugin`.
|
||||
The full instructions for installing MkDocs can be found [here](https://www.mkdocs.org/user-guide/installation/), but there is also a script included in the repo that will install it for you.
|
||||
Run `bash ./bin/mkdocs-install.sh` if you have a Debian/apt-based system. If not, read the script to find which python packages you need to install.
|
||||
|
||||
Once MkDocs is installed, you can now generate the site.
|
||||
I do this with a one-liner, run from the root directory of the repo:
|
||||
`cd mkdocs; rm -r docs site; mkdir docs; cp -r ../!(mkdocs) docs; cp style.css docs; mkdocs build; cd ..`
|
||||
MkDocs expects the Markdown documentation files to be in a "docs" subdirectory, so we create it and move everything to it, and then we can go ahead and build the site.
|
||||
There is a script included to do this as well.
|
||||
Run `bash ./bin/mkdocs-run.sh`, and the site files will then be found at ./mkdocs/site
|
||||
|
|
4
Home.md
4
Home.md
|
@ -69,4 +69,6 @@ So you are thinking of doing an engine control project. You have stopped by the
|
|||
|
||||
### [![Miata rusEFI Racecar!](https://user-images.githubusercontent.com/5051341/80621997-bf7bf000-8a0d-11ea-998e-48fc3accba59.png)](https://www.youtube.com/embed/3xz66oR95F8?start=8 "Miata rusEFI Racecar!")
|
||||
|
||||
### [![BMW V12 with dual ETB!](https://user-images.githubusercontent.com/5051341/80622501-809a6a00-8a0e-11ea-8efc-b575def1d132.png)](https://www.youtube.com/embed/TGf8IMwRuIY "BMW V12 with dual ETB!")
|
||||
### [![BMW V12 with dual ETB!](https://user-images.githubusercontent.com/5051341/80622501-809a6a00-8a0e-11ea-8efc-b575def1d132.png)](https://www.youtube.com/embed/TGf8IMwRuIY "BMW V12 with dual ETB!")
|
||||
|
||||
[Sitemap](sitemap.xml)
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo apt update
|
||||
sudo apt install ncftp
|
||||
|
||||
# sudo apt install python-pip for 'pip'
|
||||
sudo apt install python3-pip
|
||||
|
||||
# pip did not work for in my case?
|
||||
pip install mkdocs mkdocs-ezlinks-plugin
|
||||
pip install mkdocs mkdocs-ezlinks-plugin mkdocs-exclude
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
shopt -s extglob
|
||||
cd mkdocs
|
||||
mkdir docs
|
||||
cp -r ../!(mkdocs) docs
|
||||
mkdocs build
|
||||
ln -s .. docs
|
||||
cp style.css ..
|
||||
mkdocs build --strict
|
||||
cd ..
|
||||
rm style.css
|
||||
|
|
|
@ -9,6 +9,10 @@ plugins:
|
|||
- search
|
||||
- ezlinks:
|
||||
wikilinks: true
|
||||
- exclude:
|
||||
glob:
|
||||
- mkdocs/*
|
||||
|
||||
markdown_extensions:
|
||||
- sane_lists
|
||||
- md_in_html
|
||||
|
@ -83,4 +87,3 @@ nav:
|
|||
- 'Misc':
|
||||
- 'How to convert from carburetor to EFI': how-to-convert-from-carburetor-to-EFI.md
|
||||
- 'Do I need a wideband oxygen sensor?': do-i-need-wideband-oxygen-sensor.md
|
||||
- 'Sitemap': sitemap.xml
|
||||
|
|
Loading…
Reference in New Issue