<commit_before>---
title: Hosting Presidium in project /docs folder
author: torabisu
roles: Developer
---

Presidium does not have to be hosted in a repository of its own.  It can exist within your software project in a sub folder, e.g. `/docs`

This recipe will show you how to accomplish this.

# Getting Presidium

The easiest way to incorpate Presidium into your project is to get the latest
archived version from [https://github.com/SPANDigital/presidium-template/archive/master.zip](https://github.com/SPANDigital/presidium-template/archive/master.zip) and
uncompressing it into your projects empty /docs folder.  If you wish to clone the project instead
just make sure you remove the .git folder from docs/ as we want your application repo to manage
the docs/ folder and not the presidium template repo.

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

```bash
LICENSE
NOTICE
README.md
_config.yml
content/
dist/
media/
package.json
```

Now you can follow the [Getting Started Guide]

# Splitting Away From Master

Firstly you need to ignore the published folder from within your projects master branch:

```bash
$ echo "docs/node_modules/" >> .gitignore
$ echo "docs/.jekyll/" >> .gitignore
$ echo "docs/dist/site" >> .gitignore
```

Next we can set up the gh-pages branch:

```bash
$ git checkout --orphan gh-pages
$ git reset --hard
$ git commit --allow-empty -m "Initializing gh-pages branch"
$ git push origin gh-pages
$ git checkout master
```

This creates a new branch called gh-pages, and it will be managed totally separate
from your existing tree.

We can how book out the gh-pages branch into the dist/sites folder:

```bash
$ rm -rf docs/dist/site
$ git worktree add -B gh-pages docs/dist/site origin/gh-pages
```

# Reference

[https://gohugo.io/tutorials/github-pages-blog/](https://gohugo.io/tutorials/github-pages-blog/)<commit_msg>Simplifying the recipe, presidium gh-pages command handles all the complexity for us :-)<commit_after>---
title: Hosting Presidium in project /docs folder
author: torabisu
roles: Developer
---

Presidium does not have to be hosted in a repository of its own.  It can exist within your software project in a 
sub folder, e.g. `/docs`

# Single Repository

## Getting Presidium

The easiest way to incorpate Presidium into your project is to get the latest archived version from [https://github.com/SPANDigital/presidium-template/archive/master.zip](https://github.com/SPANDigital/presidium-template/archive/master.zip) and uncompressing it into your projects empty /docs folder.  If you wish to clone the project instead
just make sure you remove the .git folder from docs/ as we want your application repo to manage
the docs/ folder and not the presidium template repo.

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

```bash
LICENSE
NOTICE
README.md
_config.yml
content/
dist/
media/
package.json
```

Add the following to your project's `.gitignore` file:

```bash
$ echo "docs/node_modules/" >> .gitignore
$ echo "docs/.jekyll/" >> .gitignore
$ echo "docs/dist/" >> .gitignore
```

From this point onwards you can follow the getting started guide, where your documentation root is simply in `/docs`

# Separate Repositories

## git submodule
{'fraction_non_alphanumeric': 0.08883405305367058, 'fraction_numerical': 0.0, 'mean_word_length': 4.123222748815166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3015321', 'n_tokens_mistral': 986, 'n_tokens_neox': 919, 'n_words': 416}