Skip to content

Commit a19ead1

Browse files
committed
fix: move CNAME into main branch
Closes #5
1 parent 7bafbb6 commit a19ead1

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scratchapi.org

docs/hooks.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# These are run when the docs are built and after building. See plugins/mkdocs-simple-hooks in mkdocs.yml
2+
3+
import shutil
4+
from pathlib import Path
5+
6+
7+
def on_pre_build(*args, **kwargs):
8+
print("RUNNING ON_PRE_BUILD")
9+
# shutil.copy("README.md", "docs/gh-readme.md")
10+
11+
12+
def on_post_build(config: dict, *args, **kwargs):
13+
print("RUNNING ON_POST_BUILD")
14+
15+
site_dir = Path(config['site_dir'])
16+
17+
def copy(src: Path, dst: Path):
18+
dst = site_dir / str(dst)
19+
dst.parent.mkdir(parents=True, exist_ok=True)
20+
shutil.copy(src, dst)
21+
22+
copy(Path("CNAME"), Path("CNAME"))

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ plugins:
4646
- search
4747
- glightbox
4848
- meta
49+
- mkdocs-simple-hooks:
50+
hooks:
51+
on_pre_build: "docs.hooks:on_pre_build"
52+
on_post_build: "docs.hooks:on_post_build"
53+
4954
# - macros
5055
# - include-markdown
5156

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ mkdocs-material
22
mkdocs-material[imaging]
33
mkdocs-glightbox
44
mkdocs-rss-plugin
5+
mkdocs-simple-hooks
56
# pacman -S mingw-w64-ucrt-x86_64-cairo
67
# pacman -S mingw-w64-ucrt-x86_64-pngquant

0 commit comments

Comments
 (0)