Skip to content

Commit

Permalink
docs: Split script into build and publish scripts
Browse files Browse the repository at this point in the history
This way it is possible to only build the documentation locally.
  • Loading branch information
AntonioND committed Nov 23, 2024
1 parent 91257f2 commit 21d7169
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
13 changes: 1 addition & 12 deletions docs/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

# This script must be called from the docs/ folder of the sdk repository.
#
# Make sure that you have a folder called "blocksds-docs" at the same level as
# your sdk repository folder.
# This script depends on having hugo in your system.

set -e
set -x
Expand Down Expand Up @@ -41,13 +40,3 @@ pushd ../libs/maxmod
make docs
popd
mv ../libs/maxmod/docs/html public/maxmod

rm -rf ../../blocksds-docs/*
mv -v public/* ../../blocksds-docs/

cd ../../blocksds-docs/

touch .nojekyll
git add .
git commit -m"`date`"
git push origin master
16 changes: 16 additions & 0 deletions docs/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# This script must be called from the docs/ folder of the sdk repository.
#
# Make sure that you have a folder called "blocksds-docs" at the same level as
# your sdk repository folder.

rm -rf ../../blocksds-docs/*
mv -v public/* ../../blocksds-docs/

cd ../../blocksds-docs/

touch .nojekyll
git add .
git commit -m"`date`"
git push origin master
7 changes: 4 additions & 3 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ all repositories of BlocksDS. Note that this sets the base URL of the
documentation to `https://blocksds.github.io/docs/`, so this script isn't useful
for non-maintainers.
Then, it updates the folder `blocksds-docs` (which should contain the
[docs repository](https://github.com/blocksds/docs), it creates a new commit,
and pushes it.
Then, maintainers can call `publish-docs.sh` to update the folder
`blocksds-docs` (which should contain the
[docs repository](https://github.com/blocksds/docs). It creates a new commit
with the current documentation and pushes it as a new commit.

0 comments on commit 21d7169

Please sign in to comment.