-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add multiversioned documentation (#344)
Documentation is now published on the `gh-pages` branch. The branch will have a folder `docs` containing the following structure: - `./docs` the copy from the `main` docs, but only used for the `index.html` page to do the multi-version routing. - `./docs/main` the copy from the `main` branch docs folder - `./docs/beta` the copy from the `beta` branch docs folder Closes #332
- Loading branch information
Showing
16 changed files
with
128 additions
and
59 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,44 @@ | ||
name: Github Pages | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- beta | ||
paths: | ||
- '.github/workflows/pages.yml' | ||
- 'docs/**' | ||
|
||
env: | ||
# Publish the main documentation in 'docs/main' folder, and the beta in 'docs/beta' | ||
# Routing and version selection is handled in the main documentation. | ||
DESTINATION_DIR: ${{ github.ref == 'refs/heads/main' && 'docs/main' || 'docs/beta' }} | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Deploy index.html | ||
uses: peaceiris/actions-gh-pages@v4 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs | ||
destination_dir: docs | ||
# Subfolders docs/main and docs/beta will contain the actual versioned documentation. | ||
# This is just to have the rooting properly done at the root. | ||
keep_files: true | ||
|
||
- name: Deploy versioned documentation | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs | ||
destination_dir: ${{ env.DESTINATION_DIR }} | ||
keep_files: false |
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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
<meta name="description" content="Description"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css"> | ||
<link rel="stylesheet" href="assets/style.css"> | ||
<link rel="icon" type="image/x-icon" href="assets/img/favicon.ico"> | ||
<style> | ||
:root { | ||
|
@@ -18,42 +19,70 @@ | |
<body> | ||
<div id="app"></div> | ||
<script> | ||
console.log("Loading docs/index.html") | ||
window.$docsify = { | ||
name: 'sablier', | ||
name: '<a id="home-link" class="app-name-link">Sablier</a><div>' + | ||
'<select id="version-selector" class="sidebar-version-select" name="version">' + | ||
'<option value="main">main</value>' + | ||
'<option value="beta">beta</value>' + | ||
'</select></div>', | ||
// disable automatic linking to avoid navigating when clicking on select | ||
nameLink: false, | ||
repo: 'https://github.com/acouvreur/sablier', | ||
notFoundPage: true, | ||
loadSidebar: true, | ||
relativePath: true, | ||
alias: { | ||
'/.*/_sidebar.md': '/_sidebar.md' | ||
// Uncomment lines below for local development. | ||
// '/main/': 'README.md', | ||
// '/main/(.*)': '$1', | ||
'/beta/.*/_sidebar.md': '/beta/_sidebar.md', | ||
'/main/.*/_sidebar.md': '/main/_sidebar.md', | ||
}, | ||
auto2top : true, | ||
maxLevel : 3, | ||
subMaxLevel: 3, | ||
namespaces: [ | ||
{ | ||
id: "version", | ||
values: ["main", "beta"], | ||
default: "main", | ||
optional: true, | ||
selector: "#version-selector", | ||
} | ||
], | ||
tabs: { | ||
persist : true, // default | ||
sync : true, // default | ||
theme : 'classic', // default | ||
tabComments: true, // default | ||
tabHeadings: true // default | ||
}, | ||
search: { | ||
paths: 'auto', | ||
hideOtherSidebarContent: true, | ||
depth: 3, | ||
pathNamespaces: ['/main', '/beta'] | ||
} | ||
} | ||
</script> | ||
<!-- Docsify v4 --> | ||
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1"></script> | ||
<script src="//cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/npm/docsify-tabs@1"></script> | ||
<script src="//unpkg.com/prismjs/components/prism-go.min.js"></script> | ||
<script src="//unpkg.com/prismjs/components/prism-yaml.min.js"></script> | ||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script> | ||
<script src="//unpkg.com/prismjs/components/prism-docker.min.js"></script> | ||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script> | ||
|
||
<!-- plugins --> | ||
<script src="//unpkg.com/[email protected]/dist/docsify-namespaced.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script> | ||
<script src="https://unpkg.com/docsify-copy-code@2"></script> | ||
<script src="//unpkg.com/docsify-copy-code@2"></script> | ||
<script src="//cdn.jsdelivr.net/npm/docsify-edit-on-github"></script> | ||
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script> | ||
<script src="//unpkg.com/docsify-plantuml/dist/docsify-plantuml.min.js"></script> | ||
</body> | ||
</html> |
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
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
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
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
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
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