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
58 changes: 43 additions & 15 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,65 @@ on:
- master
paths:
- 'site/**'
- 'CHANGES'
- 'Makefile'
- '.github/workflows/pages.yml'
pull_request:
paths:
- 'site/**'
- 'CHANGES'
- 'Makefile'
- '.github/workflows/pages.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# One deployment at a time; a queued run waits instead of cancelling
# the one in progress.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build site
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v6
with:
python-version: '3.14'

# site/ is copied as is, and the changelog page is rendered from
# CHANGES with docutils.
- name: Build site
run: |
python -m pip install docutils
make site

- uses: actions/upload-pages-artifact@v5
with:
path: _site

deploy:
name: Deploy site
needs: build
# Pull requests only build the site: the github-pages environment
# takes deployments from master only.
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v7
# One deployment at a time; a queued run waits instead of cancelling
# the one in progress.
concurrency:
group: pages
cancel-in-progress: false

steps:
- uses: actions/configure-pages@v6

# The files in site/ are served as is, there is no build step.
- uses: actions/upload-pages-artifact@v5
with:
path: site

- id: deployment
uses: actions/deploy-pages@v5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env-dev
/TODO
/build/
/dist/
/_site/
/bin/
/include/
/lib/
Expand Down
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ Version 0.11.1
--------------
- Disallow prefix overridden by .npmrc. See `# 98`_, `# 100`_, `# 103`_

.. _# 98: https://github.com/ekalinin/nodeenv/issue/98
.. _# 98: https://github.com/ekalinin/nodeenv/issues/98
.. _# 100: https://github.com/ekalinin/nodeenv/pull/100
.. _# 103: https://github.com/ekalinin/nodeenv/pull/103

Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: default deploy deploy-github deploy-pypi update-pypi clean env
.PHONY: default deploy deploy-github deploy-pypi update-pypi clean env site
PYTHON=python3
TEST_ENV=env
DEV_TEST_ENV=env-dev
Expand Down Expand Up @@ -57,6 +57,17 @@ coverage: env-dev
coverage report -m && \
coverage html

# site/ with the changelog page rendered from CHANGES. rst2html5 comes
# from docutils and is taken from PATH, as CI has no env-dev. Single
# backticks in CHANGES mean code, so they are rendered as literals; the
# two lines added for that put the reported line numbers two ahead.
site:
@rm -rf _site
@cp -R site _site
@(printf '.. default-role:: literal\n\n'; cat CHANGES) | \
rst2html5 --halt=warning --no-raw --no-file-insertion \
--template=site/changes.html - _site/changes.html

contributors:
@echo "Nodeenv is written and maintained by Eugene Kalinin." > AUTHORS
@echo "" >> AUTHORS
Expand Down
39 changes: 39 additions & 0 deletions site/changes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<meta name="description"
content="Changes in each nodeenv release.">
<title>%(title)s</title>
<link rel="canonical" href="https://ekalinin.github.io/nodeenv/changes.html">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header class="topbar">
<div class="wrap topbar-inner">
<a class="wordmark" href="./">node<span>env</span></a>
<nav aria-label="Project">
<a href="https://github.com/ekalinin/nodeenv">GitHub</a>
<a href="https://pypi.org/project/nodeenv/">PyPI</a>
<a href="changes.html">Changes</a>
</nav>
</div>
</header>

<main class="wrap changelog">
<h1>%(title)s</h1>
%(body)s
</main>

<footer class="footer">
<div class="wrap">
<p>
nodeenv is maintained by
<a href="https://github.com/ekalinin">ekalinin</a>.
</p>
</div>
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<nav aria-label="Project">
<a href="https://github.com/ekalinin/nodeenv">GitHub</a>
<a href="https://pypi.org/project/nodeenv/">PyPI</a>
<a href="https://github.com/ekalinin/nodeenv/blob/master/CHANGES"
<a href="changes.html"
>Changes</a>
</nav>
</div>
Expand Down Expand Up @@ -169,7 +169,7 @@ <h2 id="more">Read more</h2>
>Configuration</a></li>
<li><a href="https://github.com/ekalinin/nodeenv/wiki/Who-Uses-Nodeenv"
>Who uses nodeenv</a></li>
<li><a href="https://github.com/ekalinin/nodeenv/blob/master/CHANGES"
<li><a href="changes.html"
>Changelog</a></li>
<li><a href="https://github.com/ekalinin/nodeenv/blob/master/LICENSE"
>BSD license</a></li>
Expand Down
34 changes: 33 additions & 1 deletion site/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* nodeenv landing page. No build step: this file is served as is. */
/* nodeenv landing and changelog pages. make site copies this file as is. */

:root {
color-scheme: light dark;
Expand Down Expand Up @@ -299,6 +299,38 @@ p {
}
}

/* Changelog. docutils renders code as span.literal, not as code. */

.changelog {
padding-top: clamp(2rem, 6vw, 4rem);
}

.changelog > section {
padding: 1.75rem 0;
}

.changelog ul {
margin: 0;
padding-left: 1.25rem;
}

.changelog li > p {
margin-bottom: 0.5rem;
}

.literal {
padding: 0.1em 0.3em;
border-radius: 4px;
background: var(--surface);
font-family: var(--mono);
font-size: 0.875em;
}

/* docutils puts tokens with a hyphen, such as --prebuilt, in span.pre. */
.literal .pre {
white-space: nowrap;
}

/* Links and footer */

.more {
Expand Down
Loading