zzzzzzxXxzzzzzz / cht-docs

Documentation site for the Community Health Tookit

Home Page:https://docs.communityhealthtoolkit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation for the Community Health Toolkit

CHT Documentation Site Build

About

This repo contains documentation for the Community Health Toolkit (CHT), and how to build digital health applications with CHT Core. This repository powers the CHT documentation site at docs.communityhealthtoolkit.org.

The documentation is built using Markdown pages, which can be converted into a navigable website using a static-site-generator. The Hugo static-site-generator is being used with the Docsy theme. To maintain portability, content should be written in plain Markdown with limited use of HTML, custom shortcodes, and modifications to the theme. Contributions should align with the documentation style guide.

Build dependencies

The documentation site uses Hugo, and specifically uses features found in the extended version of Hugo, v0.76.0 and later. See .tool-versions for the currently used version

asdf is the recommended way to manage hugo and golang versions for local development.

After installing it run:

asdf plugin add golang
asdf plugin add hugo

Installing Hugo Manually

If using asdf fails you can try installing Hugo manually. To install, follow the installation instructions for your Operating System, and be sure to get the extended version. Most users will be able to simply install using their native package manager like brew, apt or snap.

Building the Documentation

  1. Clone the cht-docs repo
  2. From the command line, navigate to the local directory where you cloned the repo
  3. Type hugo server
  4. Preview your site in your browser at: http://localhost:1313/
  5. As you make changes to the site, your browser will automatically reload your local dev site so you can easily and quickly see your changes.

MacOS users getting errors when running hugo server, please see our Troubleshooting guide.

Link Checking [Optional]

We validate that all links on the docs site work (do not 404) using a tool called Muffet along with Actions. If you're creating a lot of new links, or editing a lot of existing links, you may optionally run Muffet locally before pushing your commits. Running Muffet locally can save time by exposing broken links before pushing a build since you can avoid waiting for the Action to run, finding you have a broken link, fixing it, and pushing a new change.

  1. Install Go as a prerequisite
  2. Install Muffet: go get -u github.com/raviqqe/muffet
    • If using asdf you need to reshim (asdf reshim golang)
  3. Ensure you've run hugo server so your local docs instance is reachable at http://localhost:1313/
  4. Test the links with the muffet.sh script. If you're in the root of this repo, that'd be: ./.github/scripts/muffet.sh

It should take about 60 seconds depending on your Internet connection. If Muffet returns no output, you have no broken links, congrats!

Note: The muffet.sh script here is the identical script we run on GitHub. If you simply run muffet http://localhost:1313 you will hit GitHub's rate limiting and get lots of 429's. Our script intentionally reduces concurrency and excludes some repetitive GitHub URLs.

Continuous Deployment

All changes to main branch run a GitHub action to first check for any broken links (per above) and then deploy to the documentation site: docs.communityhealthtoolkit.org

Upgrading dependencies

Hugo

The version of Hugo used to deploy the site is specified in .tool-versions.

(Note there is also a minimum version of Hugo required to deploy the site specified via module.hugoVersion in the config.toml file.)

See the Hugo Release Notes for documentation regarding what has changed in the new versions.

Docsy

The current version of Docsy is pinned in the go.mod file. To upgrade to a new version of Docsy, use the hugo mod get command as described in the Docsy documentation.

See the Docsy CHANGELOG for documentation regarding what has changed in the new versions.

About

Documentation site for the Community Health Tookit

https://docs.communityhealthtoolkit.org


Languages

Language:HTML 87.0%Language:SCSS 7.3%Language:Shell 5.7%