Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to docusaurus v3 #119

Merged
merged 7 commits into from
Feb 23, 2024
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
23 changes: 22 additions & 1 deletion website/build-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,37 @@ function createVersionedDocs() (
mkdir -p $currentWebsite/versioned_docs

# Workaround for broken links in versions 4.4.0 and before
# This is necessarcy because the way legacy versions of the documentation are built
# follows these rough steps:
#
# 1. Check out the version of the stratos repo that you are trying to build documentation for
# 2. Build the documentation with that versions revision of the website
# 3. Copy the resulting markdown and sidebar files to a version specific build directory
#
# This means that when we built documentation up to and including v4.4.0, we are using old versions
# of docusaurus, but those built documentation files are then included in the documentation
# generated by the current version of docusaurus.
# In essence, that means we have to apply the version specific workarounds every time we build
# the documentation.
# Ideally, we would change this such that versioned documentation is built on release, checked in
# as an artifact that can be modified later to accomodate changes to make it compatible with
# newer docusaurus (or whatever else) versions we upgrade to.
printf '%s\n%s\n' "$target_version" "$version" | sort -V | head -n1
if [[ $? -eq 0 ]]; then
logInner "Version is 4.4.0 or less, applying workaround for broken links"
logInner "Version is 4.4.0 or less, applying workaround for broken links and v3 upgrade"
gnu_sed=sed
if [[ "$(uname)" == "Darwin" ]]; then
gnu_sed=gsed
fi
echo $gnu_sed
# Fix links to cloud-foundry.md
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/cloud-foundry\/cloud-foundry/cloud-foundry\/cloud-foundry.md/g' {} \;
# Fix other links to cloud-foundry.md
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/](cloud-foundry)/(cloud-foundry.md)/g' {} \;
# Escape commit signing in contributers guide (v3 upgrade)
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/ Signed-off-by: Joe Smith <[email protected]>/```\nSigned-off-by: Joe Smith <[email protected]>\n```/g' {} \;
# Remove versions from sidebars (v3 upgrade)
find $checkedOutRepo/website/versioned_sidebars -type f -name "*.json" -exec ${gnu_sed} -i 's/version-[0-9]\.[0-9]\.[0-9]\///g' {} \;
fi
# End of workaround

Expand Down
2 changes: 2 additions & 0 deletions website/docs/developer/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ By making a contribution to this project, I certify that:

Then you just add a line to each git commit message:

```
Signed-off-by: Joe Smith <[email protected]>
```

Use your real name (sorry, no pseudonyms or anonymous contributions.)

Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
items: [{
type: 'docsVersionDropdown',
position: 'right',
nextVersionLabel: 'Latest',
dropdownItemsAfter: [{to: '/versions', label: 'All versions'}],
},
{
to: 'docs/introduction',
Expand Down
Loading
Loading