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

Symlink on built website to support /docs/ links #80

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Build and Deploy to Netlify
on:
push:
branches:
- main
- cason/docs-symlink
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This MUST be reverted when merging.

workflow_dispatch:
schedule:
- cron: "0 0 * * *"
Expand Down Expand Up @@ -36,6 +36,9 @@ jobs:
run: |
chmod a+wx .
bundle exec jekyll build --disable-disk-cache -V
# Create _pages/version/docs link
- name: Add symbolic links
run: make symlinks
# Deploy the _site folder to Netlify CometBFT documentation website
- name: Deploy to Netlify
uses: nwtgck/[email protected]
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ build:
@rm -rf _site/build
.PHONY: build

symlinks:
@if [ ! -d "_pages" ]; then echo "Directory _pages does not exist. Please run \"make fetch\" before running this command"; exit 1; fi
@while read -r branch output_path visible ; do \
[ -L _site/$${output_path}/docs ] || ln -vs . _site/$${output_path}/docs ; \
done < VERSIONS
@if [ "${LOCAL_DOCS_REPO}" ]; then \
[ -L_site/dev/docs ] || ln -vs . _site/dev/docs ; \
fi

# Creates _data/versions.yml, which is built from the VERSIONS file, in order
# to provide information about versions to Jekyll during the site build
# process. This assists in constructing the dropdown version selector menu.
Expand Down