Source Control


Approaches

Presidium content can be managed in various ways depending on your project needs. Content may be hosted in:

  • A dedicated repo that only contains documentation
  • A sub-folder of an existing repo

A dedicated repo is simpler to configure and easier to manage independently. Managing content within in a sub directory inside the source code repo keeps everything in one place and makes it easier to update the documents while changing the code.

Sub Folder

Presidium can exist within a sub-folder of an existing source code repository, for example, /docs.

Getting Presidium

The easiest way to incorporate Presidium into your project is to run the wizard from your project root:

presidium init

And specify Project Name as docs, so that, Presidium creates and empty Presidium site under docs/ folder.

The contents of your docs/ folder should look something like this:

config.yaml
go.mod
content/
static

Add the following to your project’s .gitignore file:

docs/public

From this point on, you can follow instructions in the Getting Started section. The only difference is that your documentation root is /docs.

Sub Module

If you want to store your documentation in a separate repository or share documentation between projects you can use submodules. Use the following steps to set up a submodule.

  1. Create a new repository for you module.
  2. Create a config.yml file and add the following
    module:
      mounts:
        - source: content
          target: content
    
  3. Create a content directory and add your markdown files. E.g.
    ├── config.yml
    └── content
        └── glossary
            ├── _index.md
            └── link.md
    
  4. Commit and push your changes
  5. To use your submodule, add it to the imports section of your project’s config.yml file. E.g.
    module:
      imports:
      - path: <REPO_URL_OF_SUBMODULE>
        mounts:
        - source: content
          target: content