2.0.2 • Published 4 years ago

siteleaf-updater v2.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

siteleaf-updater

NPM version Build js-standard-style CodeFactor GitHub License GitHub last commit Dependabot Status

update your index file in your Siteleaf site using your project README file

Why it is necessary

When hosting GitHub Pages, there is a common discrepancy one faces when choosing the place to host their page files.

1. Host it on the master branch

Hosting on the master branch has the advantage that files can be shared with the project (including the README). However, pages usually stand alone without a dependency to or from the project files. Hence, there might be numerous commits that cause an avoidable overhead to merges, CI, and pulls.

2. Host it on a dedicated branch

Hosting the pages on a dedicated branch (e.g., gh-pages) has the benefit that this beforementioned overhead is avoided. Separate concerns are rooted in separate trees, just as it is supposed to be. However, normally, developers only want to publish their README with a few additions. There is no integrated way or known method in GitHub to sync the README file without hooks or different workarounds. That circumstance impairs common maintenance and automation requirements.

Solution

  1. Use Siteleaf, and publish or sync to a dedicated branch on GitHub.
  2. Create a page and assign it a path (by default, index).
  3. Setup your CI to use siteleaf-updater for automated doc updates.

Parameters

CLI ParameterEnvironment VariableDefaultDescription
api_keySITELEAF_API_KEYrequiredthe siteleaf API key
api_secretSITELEAF_API_SECRETrequiredthe siteleaf API secret
siteSITE_IDrequiredthe siteleaf site id to be updated
pagePAGE_NAMEindexthe siteleaf page path to be updated
fileMD_FILEREADME.mdthe name of the Markdown file to read
publish-falsepublish the site after updating