-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert docs from Sphinx to Hugo #1347
base: main
Are you sure you want to change the base?
Conversation
790ab31
to
c547809
Compare
Thanks for all this work Readthedocs.io has the ability to serve different versions of the documentation with a version picker - is this something we could reproduce? If not, maybe we should think about merging the docs into the latest (we haven't deprecated much over the years) |
github pages also do that (and readthedocs.io can also do it with the right DNS config) |
@ciaranmcnulty Yes, this is (somewhat) possible. See jaegertracing/documentation#79. Kubernetes is also using Hugo (https://github.com/kubernetes/website/blob/master/config.toml). I'll try to add a version-picker this week. |
5413e91
to
8030b18
Compare
The Sphinx build was broken for some time now, Hugo has the advantage of only needing a single binary, which makes building the docs much easier. In order to build publish the docs, a GitHub Action was added. This action pushes the docs to the `gh-pages` branch so it can be served by GitHub. Resolves phpspec#1225
@ciaranmcnulty I added a simple version picker. Can be viewed here: https://jaylinski.github.io/phpspec/v7/manual/introduction/ This works by having a folder for each major release and is similar to how jaegertracing (https://github.com/jaegertracing/documentation) handle their Hugo docs. It would probably make sense to also create a "next" version, which can later be "released" as v8. |
@jaylinski what steps would be needed to deploy this onto GitHub pages, on a subdomain of phpspec.net for testing? |
|
@ciaranmcnulty If you need more information, feel free to ask. If you don't want to go with Hugo: an alternative would be to use the markdown-files I already converted and publish those with GitBook or something similar. |
Not abandoning, just no time to look at it lately :/ If someone can set up a mirror that's totally working just under another domain name that'd make it an easy merge :) |
@ciaranmcnulty My mirror is here: https://jaylinski.github.io/phpspec/ If you want it under https://phpspec.github.io/phpspec/, I will change the domain in the Hugo config. After that, all you have to do is activate GitHub pages in https://github.com/phpspec/phpspec/settings and merge the PR. If you want, you can give me temporary maintainer permissions and I'll set it up. :) |
Since 6 months have passed since my last comment, I wanted to check in with you. Would be nice to get this merged and published so developers could have an up-to-date documentation. |
Since another 6 months have passed since my last comment, I wanted to check in with you. Would be nice to get this merged and published so developers could have an up-to-date documentation. |
Description
This PR converts the docs from Sphinx to Hugo (https://gohugo.io/).
The Sphinx build was broken for some time now (#1225) and the issue
is obviously not easy to track down. I chose Hugo because it has the advantage
of only needing a single binary, which makes building the docs very easy.
In order to build and publish the docs, a GitHub Action
was added. This action pushes the docs to the
gh-pages
branch so it can be served by GitHub Pages. An example
can be viewed here: https://github.com/jaylinski/phpspec/runs/431772750
The file-format was changed from rst to markdown (converted with pandoc), because it is a format most devs are familiar with.
A preview of the converted docs can be viewed here: https://jaylinski.github.io/phpspec/
Follow up from #1296.
What implications does this change have?
Positive effects
New:
5 requests / 28.90 KB / 25.88 KB transferred / Finish: 459 ms / DOMContentLoaded: 182 ms / load: 460 ms
Old:
31 requests / 435.32 kB / 258.37 kB transferred / Finish: 1.84 s / DOMContentLoaded: 828 ms / load: 1.56 s
Downsides
What do I as a maintainer have to do to get this to work?
phpspec.net
URL to the GitHub pageAn alternative is deploying the docs to Netlify, which has the benefit of getting a free https certificate for the domain.
What was my motivation to do this?
I wanted to try out GitHub Actions and saw this as a fitting opportunity. In hindsight I should have probably picked a static site generator specifically made for documentation, like GitBook, VuePress, Sculpin or some in https://github.com/myles/awesome-static-generators#documentation.