File tree Expand file tree Collapse file tree 4 files changed +29
-0
lines changed
Expand file tree Collapse file tree 4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ scratchapi.org
Original file line number Diff line number Diff line change 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" ))
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ mkdocs-material
22mkdocs-material [imaging ]
33mkdocs-glightbox
44mkdocs-rss-plugin
5+ mkdocs-simple-hooks
56# pacman -S mingw-w64-ucrt-x86_64-cairo
67# pacman -S mingw-w64-ucrt-x86_64-pngquant
You can’t perform that action at this time.
0 commit comments