Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: doc-serve shortcode-docs docs scipy main blog learn tools serve-dev
.PHONY: doc-serve shortcode-docs netlify-preview preview-theme theme docs scipy main blog learn tools serve-dev
.DEFAULT_GOAL := doc-serve

GH_ORG = scientific-python
Expand Down Expand Up @@ -32,12 +32,16 @@ doc-serve: doc/content/shortcodes.md
# The following is for use on netlify
# -----------------------------------

netlify-preview: theme scipy main blog learn tools
netlify-preview: preview-theme theme scipy main blog learn tools
mv scipy/public doc/public/scipy
mv main/public doc/public/main
mv blog/public doc/public/blog
mv learn/public doc/public/learn
mv tools/public doc/public/tools
git restore doc/content/_index.md

preview-theme:
python tools/add_preview_links.py

theme: doc/content/shortcodes.md
(cd doc ; hugo --themesDir="../..")
Expand Down
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,3 @@ The **Scientific Python Hugo Theme** is a theme for the
Please see the [theme
documentation](https://theme.scientific-python.org), especially the
[get started](https://theme.scientific-python.org/getstarted/) page.

## Theme development

When making PRs against this repository, a site preview of the theme
documentation will be rendered. From there, you can browse preview
builds of a few other community websites: `scipy`, `main`
(scientific-python.org), `blog`, and `learn`. E.g., if the preview link is

https://deploy-preview-301--scientific-python-hugo-theme.netlify.app/

browse to

https://deploy-preview-301--scientific-python-hugo-theme.netlify.app/blog

to see how the blog rendered.
14 changes: 14 additions & 0 deletions tools/add_preview_links.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
filename = "doc/content/_index.md"
preview_links = """
{{< admonition attention >}}
See scientific python, [blog](blog), learn, [tools](tools), scipy, and numpy.
{{< /admonition >}}
"""

with open(filename, "r") as f:
index = f.readlines()

with open(filename, "w") as f:
index.insert(3, preview_links)
index = "".join(index)
f.write(index)