Skip to content

Commit

Permalink
feat(CI): Move to cloudflare for deployment (#25)
Browse files Browse the repository at this point in the history
* feat(HUGO): set new path to docs dir

* feat(HUGO): move hugo config to root of dir

* feat(HUGO): move hugo config to root of dir

* feat(CI): add build script for cloudflare pages

* feat(CI): remove github hugo workflow [CI Skip]
  • Loading branch information
MagneticNeedle authored Nov 6, 2023
1 parent 8b30470 commit e102876
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 87 deletions.
83 changes: 0 additions & 83 deletions .github/workflows/gh-pages.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Generated files by hugo
public/
hugo/public/
hugo/resources/_gen/
hugo/assets/jsconfig.json
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md

This file was deleted.

69 changes: 69 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
First off, thanks for taking the time to contribute! 🎉🎉

This file contains a few guidelines on how to contribute to the community made portal docs hosted at [docs.bfportal.gg](https://docs.bfportal.gg)

These are not rules but just some suggestion, so feel free to propose any change in the project

{{< toc >}}

## Architecture of the docs

The project is split into two parts:

- The docs themselves, written in markdown and located in the `docs` folder
- The website, built with [Geekdocs](https://geekdocs.de/) and located in the `hugo` folder

---

The **docs** are also split into two parts:

- The docs that are hand-written and located in the **`docs`** folder
- The docs that are generated using the **`portal_blocks_documentation`** module.

- The process to generate new docs for portal blocks is pretty much automated

- The official documentation for each block is retrieved and saved to the **`docs/portal_blocks/<block_name>/docs/official.md`** folder

- Any changes to this file **will be overwritten** when the docs are regenerated

- The **`docs/portal_blocks/<block_name>/docs/extra.md`** file is where you can add extra information about the block
- This file will **not be overwritten** when the docs are regenerated

## Contributing to the docs

To contribute to the docs to need to:

- Setup hugo on your machine, you can follow the [official guide](https://gohugo.io/installation/)
- Clone this repo (requires [git](https://git-scm.com/))
```shell
git clone https://github.com/battlefield-portal-community/portal-docs
```
- Change directory to the `hugo` folder and run
```shell
hugo server -D
```
- Now depending on the type of doc you want to contribute to:
- If you want to contribute to the

- ### Hand written Docs

- If You want to add a new tutorial/guide run,
```shell
hugo new content [guide|tutorial]/<name_of_tutorial_or_guide>
```
- then you should be able to find the file in **`docs/[guides|tutorials]/<name_of_tutorial_or_guide>/_index.md`**

- ### Portal Blocks Documentation
- If you wish to add extra information to the portal blocks documentation
- In **`docs/portal_blocks/`** Find the block which you want to add information to.
- In that folder You will see two things.
- `index.md` which is the root of the block documentation
- A folder called `docs` which contains the documentation for the block
- In the Docs folder find/create a file called `extra.md` and add the extra information there.
- All the new information will be added to the bottom of the block documentation page.

## TODOs (PRs welcome :D )

- [x] Add a section on how to contribute to the docs
- [ ] Add a section on how to contribute to the website
- [ ] Add a section on how to contribute to the `portal_blocks_documentation` module
9 changes: 9 additions & 0 deletions cloudflare_pages_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

if [ "$CF_PAGES_BRANCH" == "main" ]; then

poetry run gen-docs && hugo --themesDir hugo/themes --logLevel info

else
hugo --themesDir hugo/themes --logLevel info
fi
30 changes: 27 additions & 3 deletions hugo/config.toml → config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,36 @@ disablePathToLower = true
tag = "tags"

[[module.mounts]]
source = "../docs/"
source = "hugo/archetypes"
target = "archetypes"

[[module.mounts]]
source = "hugo/assets"
target = "assets"

[[module.mounts]]
source = "hugo/data"
target = "data"

[[module.mounts]]
source = "hugo/i18n"
target = "i18n"

[[module.mounts]]
source = "hugo/layouts"
target = "layouts"

[[module.mounts]]
source = "hugo/static"
target = "static"

[[module.mounts]]
source = "docs/"
target = "./content/"
excludeFiles = ["portal_blocks/**"]

[[module.mounts]]
source = "../docs/portal_blocks"
source = "docs/portal_blocks"
target = "./content/portal-builder/rules-editor/block-reference"

[params]
Expand All @@ -41,4 +65,4 @@ target = "./content/portal-builder/rules-editor/block-reference"
geekdocNextPrev = true
geekdocSearchShowParent = true
geekdocMenuBundle = true
geekdocAnchor = true
geekdocAnchor = true
Empty file removed hugo/.hugo_build.lock
Empty file.

0 comments on commit e102876

Please sign in to comment.