Skip to content

Commit 164a940

Browse files
authored
Only build site previews for PRs (#306)
1 parent 68483d4 commit 164a940

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ doc-serve: doc/content/shortcodes.md
3131
# The following is for use on netlify
3232
# -----------------------------------
3333

34-
netlify: theme scipy main blog learn
34+
netlify-preview: theme scipy main blog learn
3535
mv scipy/public doc/public/scipy
3636
mv main/public doc/public/main
3737
mv blog/public doc/public/blog

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,18 @@ The **Scientific Python Hugo Theme** is a theme for the
77
Please see the [theme
88
documentation](https://theme.scientific-python.org), especially the
99
[get started](https://theme.scientific-python.org/getstarted/) page.
10+
11+
## Theme development
12+
13+
When making PRs against this repository, a site preview of the theme
14+
documentation will be rendered. From there, you can browse preview
15+
builds of a few other community websites: `scipy`, `main`
16+
(scientific-python.org), `blog`, and `learn`. E.g., if the preview link is
17+
18+
https://deploy-preview-301--scientific-python-hugo-theme.netlify.app/
19+
20+
browse to
21+
22+
https://deploy-preview-301--scientific-python-hugo-theme.netlify.app/blog
23+
24+
to see how the blog rendered.

doc/netlify.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
DART_SASS_VERSION = "1.69.4"
55
DART_SASS_URL = "https://github.com/sass/dart-sass/releases/download/"
66

7+
[context.production.environment]
8+
BUILD_TARGET = "theme"
9+
10+
[context.deploy-preview.environment]
11+
BUILD_TARGET = "netlify-preview"
12+
13+
[context.deploy-preview]
14+
ignore = "false"
15+
716
[build]
817
base = "doc"
918
publish = "public"
@@ -14,11 +23,8 @@
1423
rm ${DART_SASS_TARBALL} && \
1524
export PATH=/opt/build/repo/doc/dart-sass:$PATH && \
1625
(cd ../.. ; ln -s repo scientific-python-hugo-theme) && \
17-
(cd .. ; make theme) \
26+
(cd .. ; make ${BUILD_TARGET}) \
1827
"""
1928

20-
[context.deploy-preview]
21-
ignore = "false"
22-
2329
[[plugins]]
2430
package = "netlify-plugin-checklinks"

0 commit comments

Comments
 (0)