forked from prefix-dev/pixi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: automate adding install scripts to the docs (prefix-dev#1302)
Triggered by tip from @beenje
- Loading branch information
1 parent
1a1fcbe
commit 42c9c8a
Showing
5 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from pathlib import Path | ||
from mkdocs.structure.files import File, Files | ||
from mkdocs.config.defaults import MkDocsConfig | ||
|
||
INSTALL_SCRIPTS = [Path(__file__).parent / "install.sh", Path(__file__).parent / "install.ps1"] | ||
|
||
|
||
def on_files(files: Files, config: MkDocsConfig): | ||
"""Copy the install scripts to the site.""" | ||
for script in INSTALL_SCRIPTS: | ||
files.append( | ||
File( | ||
path=script.name, | ||
src_dir=script.parent, | ||
dest_dir=f"{config.site_dir}", | ||
use_directory_urls=config.use_directory_urls, | ||
) | ||
) | ||
return files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
# Version: v0.20.1 | ||
|
||
__wrap__() { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,7 @@ nav: | |
|
||
hooks: | ||
- schema/docs_hooks.py | ||
- install/docs_hooks.py | ||
|
||
plugins: | ||
- redirects: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters