Skip to content

Commit

Permalink
Update steps for publishing to mapstruct.org
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed Feb 2, 2020
1 parent 7480654 commit 482a38a
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions content/development/updating-mapstructorg.md
Expand Up @@ -30,12 +30,6 @@ git clone git@github.com:mapstruct/mapstruct.org.git
git remote rename origin upstream
{{< /prettify >}}

Set up a tracking branch for the "gh-pages" branch:

{{< prettify >}}
git fetch upstream && git branch --track gh-pages upstream/gh-pages
{{< /prettify >}}

## Local preview

Hugo comes with a built-in server for previewing the web site locally. Start it by running:
Expand Down Expand Up @@ -78,11 +72,11 @@ The [team page](/development/team) is a data-driven page. If you want to be list

## Publishing to mapstruct.org

The web site is generated by running the `hugo` command. This generates the HTML pages in the _public_ directory. The contents of that directory then needs to be synchronized with the "upstream/gh-pages" branch.

To make publication as smooth as possible, the script _scripts/publish.sh_ is taking care of the regeneration. It removes any existing contents from _public_, calls `hugo` and afterwards removes some generated files which are not needed.
The website is automatically published for every commit to master via [this GitHub Workflow](https://github.com/mapstruct/mapstruct.org/actions?query=workflow%3A%22GitHub+Pages%22).
The workflow generates the HTML with the `hugo` command in the _public_ directory.
The contents of that directory are then pushed to the "gh-pages" branch of the website repository.

For synchronizing _public_ with the local "gh-pages" branch the script creates a git worktree with the "gh-pages" branch in _public_ and commits the generated files into the "gh-pages" branch. You then only need to push that branch to upstream.
To make publication as smooth as possible, the script _scripts/generate-site.sh_ is taking care of the regeneration. It calls `hugo` and afterwards removes some generated files which are not needed.

A typical editing process will look like this (assuming you start on the master directory):

Expand All @@ -93,11 +87,9 @@ git merge upstream/master

# do your changes...

# commit; then re-generate and update gh-pages
# commit
git commit -a -m "Some website change"
./scripts/publish.sh

# deploy
git push upstream gh-pages
git push upstream master
{{< /prettify >}}

0 comments on commit 482a38a

Please sign in to comment.