labstack / echox

Echo cookbook and website
https://echo.labstack.com
MIT License
408 stars 285 forks source link

support to serve documentation from github pages #194

Closed aldas closed 3 years ago

aldas commented 3 years ago

Commit history is a mess but should be OK when merge is done with squash.

This adds support to serve documentation from github pages

To enable pages:

  1. On repository first page open Settings from top menu
  2. Scroll to GitHub Pages
  3. For Source choose gh-pages and / (root)

NB: actions need to be commited atleast once to master before. Then on next commit to master publishing will happen automatically

For example my fork is served here: https://aldas.github.io/echox/

Additional changes:

  1. added 'go mod' support. deleted vendor folders.
  2. added github actions support
  3. removed maintainers block from some pages
aldas commented 3 years ago

@lammel could you review when you have the time

aldas commented 3 years ago

We should merge to make it available as github page to point the current docs page also to the new github pages based docs then.

I have not tested that part myself but when different domain is used the publish workflow needs to be changed as hugo needs be told of actual base url hugo -D --baseURL $BASE_URL. This is needed as some of the links in docs are not relative and depend on base url.

https://github.com/labstack/echox/pull/194/files#diff-e81e13daadd1745de51d8b8d85fce1fcd9be355732b64d60a6b56e18c28388caR24

Github docs about custom domain: https://docs.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site

I think we should approach it this way:

  1. merge changes to master
  2. see if github pages are ok
  3. change base url to https://echo.labstack.com/ and commit
  4. do DNS changes from https://docs.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site
lammel commented 3 years ago

Then let's proceed that way.

aldas commented 3 years ago

@lammel seems to be working http://labstack.github.io/echox/

lammel commented 3 years ago

Looks good!

@vishr We either move to https://labstack.github.io/echox/ or you update DNS for echo.labstack.com according to https://docs.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site (basically change to CNAME to labstack.github.ui). I'd prefer to keep the current domain for docs, as the search engines know these already.

vishr commented 3 years ago

@aldas @lammel I am working on this. Looks like CNAME was used in the past and now I am getting error during setup. Have opened a ticket with GitHub - waiting on it...

aldas commented 3 years ago

@vishr there is one step that needs to be done after CNAME is set.

https://github.com/labstack/echox/blob/6cb0e35ba8d9dc4af507d47b425d33c1e543f63a/.github/workflows/publish.yaml#L24

needs to be changed to export BASE_URL=https://echo.labstack.com/

vishr commented 3 years ago

CNAME was released, the website is now served by GitHub pages.

Thanks Guys @aldas @lammel

Will do a virtual meeting one day 🍺