Skip to content
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

Docs website: convert to using Jekyll #141

Merged
merged 2 commits into from
May 30, 2020

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented May 30, 2020

The initial homepage was set up in HTML as it (temporarily) had to be hosted elsewhere.

The intention was always to use GH Pages for hosting the site and to use Jekyll to generate the homepage content based on the README of the project.

To allow for that to happen, some changes were needed which are contained in this PR.

  1. Add a Gemfile pointing enabling the GH Pages gem, including enabling a new GH flavoured markdown interpreter.
  2. Add a _config.yml file.
    • Enable the new GH flavoured markdown interpreter.
    • Set the theme.
    • Enable a variety of plugins.
    • Add the repository and github keys to allow for local testing.
    • Add a range of keys with information for the theme and SEO plugin.
    • Explicitly exclude a number of files from being included in the generated site.
  3. The initial homepage was already based on the GH Pages Jekyll minimal theme.
    To allow the site to take full advantage of that, most copied in files from the theme can be removed as they will automatically be added now, as well as updated when needed.
  4. A .gitignore file is put in place to ignore the typical Gem related files as well as the Jekyll output in _site from being committed.
  5. A .nojekyll file is put in place in the phpdoc subdirectory to prevent Jekyll trying to parse the PHPDocumentor generated documentation.
  6. The CSS customizations have been moved from the (theme generated) style.css file to style.scss.
    This makes it crystal clear what the customizations are and what comes from the theme.
    The Jekyll build will combine the CSS into one style.css file for the generated site.
  7. The theme _default.html layout has been copied in from the theme and minimal adjustments have been made to:
    • Overrule the syntax highlighting styles by setting a separate stylesheet for those.
    • Add the "Read the docs" button in the left column.
    • Add the "Install using Composer" section in the left column.
    • Add the Twitter share button in the left column.
  8. Add a robots.txt file pointing to the plugin generated XML sitemap fo search engines.
  9. Replace the index.html file with an index.md file which contains the same basic contents as the README.md file.
    Includes making a few small adjustments to the README.md file.
    This should now allow for doing a plain copy & paste of the README content into the docs/index.md just before each release to update the homepage to the latest content.
    Note: there is a "readme to index" plugin available, but that does not allow for the readme and the docs being in different directories.
    A feature request to allow for that has been opened.

Once this is merged, to update the website means:

  1. Running PHPDocumentor.
  2. Copy & pasting the content from the README.md file to docs/index.md (and double-checking the few remaining differences are intact).
  3. Once those changes have been merged and develop has been merged into master, the website should be updated.

The website can be viewed locally by running:

bundle update
bundle exec jekyll serve

and then visiting http://localhost:4000/ to see the result.


Travis: add a build check for the GH Pages site

This should check on each PR and merge to master whether the GH pages site can be build without errors.

jrfnl added 2 commits May 30, 2020 20:25
The initial homepage was set up in HTML as it (temporarily) had to be hosted elsewhere.

The intention was always to use GH Pages for hosting the site and to use Jekyll to generate the homepage content based on the `README` of the project.

To allow for that to happen, some changes were needed which are contained in this PR.

1. Add a `Gemfile` pointing enabling the GH Pages gem, including enabling a new GH flavoured markdown interpreter.
2. Add a `_config.yml` file.
    - Enable the new GH flavoured markdown interpreter.
    - Set the theme.
    - Enable a variety of plugins.
    - Add the `repository` and `github` keys to allow for local testing.
    - Add a range of keys with information for the theme and SEO plugin.
    - Explicitly exclude a number of files from being included in the generated site.
3. The initial homepage was already based on the GH Pages Jekyll `minimal` theme.
    To allow the site to take full advantage of that, most copied in files from the theme can be removed as they will automatically be added now, as well as updated when needed.
4. A `.gitignore` file is put in place to ignore the typical Gem related files as well as the Jekyll output in `_site` from being committed.
5. A `.nojekyll` file is put in place in the `phpdoc` subdirectory to prevent Jekyll trying to parse the PHPDocumentor generated documentation.
6. The CSS customizations have been moved from the (theme generated) `style.css` file to `style.scss`.
    This makes it crystal clear what the customizations are and what comes from the theme.
    The Jekyll build will combine the CSS into one `style.css` file for the generated site.
7. The theme `_default.html` layout has been copied in from the theme and minimal adjustments have been made to:
    - Overrule the syntax highlighting styles by setting a separate stylesheet for those.
    - Add the "Read the docs" button in the left column.
    - Add the "Install using Composer" section in the left column.
    - Add the Twitter share button in the left column.
8. Add a `robots.txt` file pointing to the plugin generated XML sitemap fo search engines.
9. Replace the `index.html` file with an `index.md` file which contains the same basic contents as the `README.md` file.
    Includes making a few small adjustments to the `README.md` file.
    This should now allow for doing a plain copy & paste of the README content into the `docs/index.md` just before each release to update the homepage to the latest content.
    Note: there is a "readme to index" plugin available, but that does not allow for the readme and the docs being in different directories.
    A [feature request](benbalter/jekyll-readme-index#19) to allow for that has been opened.

Once this is merged, to update the website means:
1. Running PHPDocumentor.
2. Copy & pasting the content from the `README.md` file to `docs/index.md` (and double-checking the few remaining differences are intact).
3. Once those changes have been merged and `develop` has been merged into `master`, the website should be updated.

The website can be viewed locally by running:
```bash
bundle update
bundle exec jekyll serve
```
and then visiting http://localhost:4000/ to see the result.
Adding a stage to check on each PR and merge to `master` whether the GH pages site can be build without errors.
@jrfnl jrfnl added this to the 1.0.0-alpha3 milestone May 30, 2020
@jrfnl jrfnl merged commit c4a63d9 into develop May 30, 2020
@jrfnl jrfnl deleted the docs-site/convert-to-using-ghpages-jekyll branch May 30, 2020 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant