Skip to content

Commit

Permalink
Handle .htaccess files when pushing to cantera.org and document contents
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Oct 9, 2023
1 parent 8a2761f commit 10eedf2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ jobs:
run: |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
--filter='P /doc-versions.json' --filter='P /dev'
--filter='P /doc-versions.json' --filter='P /dev' --filter='P /stable'
--filter='P /robots.txt' --filter='P .htaccess' \
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
- name: Upload the docs
if: env.DEPLOY == 'true' && endsWith(github.ref, 'testing')
Expand All @@ -116,4 +117,6 @@ jobs:
run: |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
--filter='P /doc-versions.json' --filter='P /dev' --filter='P /stable'
--filter='P /robots.txt' --filter='P .htaccess' \
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,32 @@ site is built using the [Nikola](https://getnikola.com) static site generator.
* `IC engine example </examples/python/reactors/ic_engine.py.html>`__
* To link to a label in the YAML API docs:
* :ref:`three-body <sec-yaml-three-body>`

## Apache configuration
To allow the version switcher to work smoothly between Cantera =< 3.0 and Cantera >= 3.1
(where the directory structure changed significantly), we rely on several `mod_rewrite`
rules, implemented in `.htaccess` files:

* `/dev/.htaccess`:
```conf
RewriteBase "/dev/"
RewriteRule "^cython/(.+)" "python/$1" [R]
```

* `/documentation/.htaccess`:
```conf
RewriteBase "/documentation/"
RewriteRule "^dev/sphinx/html/cython/(.*)" "../dev/python/$1" [R]
RewriteRule "^docs-3.0/sphinx/html/python/(.*)" "docs-3.0/sphinx/html/cython/$1" [R]
RewriteRule "^dev/sphinx/html/(.+)" "../dev/$1" [R]
```

* `/stable/.htaccess`:
```conf
RewriteBase "/stable/"
RewriteRule "^cxx(.*)" "../documentation/docs-3.0/doxygen/html/$1"
RewriteRule "^(.*)" "../documentation/docs-3.0/sphinx/html/$1"
```

0 comments on commit 10eedf2

Please sign in to comment.