Go to file
Aaron Carlino 8ffc3eeb5b
WIP: Add userhelp to new site (#216)
* Docs/userguide switching

* Initial commit of userdocs merge

* Remove service worker, fix rendering

* Remove limited sources

* UX improvements per Paul design

* Tweak version select for FF

* Fix mobile view

* Final tweaks to UI

* Tweaks to search bar, clean up conflicts

* Fix icons

* Hide search if no API key
2019-12-19 11:54:23 +13:00
.vscode Fix html in header IDs 2019-11-14 15:05:03 +13:00
docker Add docker support for development environment 2019-11-20 12:03:17 +13:00
src WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
static Major CSS purge, update branding 2019-11-15 16:04:03 +13:00
.env.development Store context in site metadata 2019-12-17 14:04:09 +13:00
.gitignore Store context in site metadata 2019-12-17 14:04:09 +13:00
.prettierrc Initial commit 2019-11-08 15:40:20 +13:00
README.md WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
gatsby-browser.js WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
gatsby-config.js WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
gatsby-node.js WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
gatsby-ssr.js WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
netlify.toml Redirect doc - docs 2019-11-15 14:07:18 +13:00
package.json WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
sources-docs.js WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
sources-user.js WIP: Add userhelp to new site (#216) 2019-12-19 11:54:23 +13:00
tsconfig.json Initial commit 2019-11-08 15:40:20 +13:00
tslint.json Initial commit 2019-11-08 15:40:20 +13:00
yarn.lock Netlify plugin, programmatic redirects 2019-12-16 13:53:53 +13:00

README.md

Netlify Status

doc.silverstripe.org

This repository contains the source code powering the Silverstripe CMS developer documentation website and userhelp website.

This application is build on Gatsby, a static site generator based on React. It sources content from the framework repository for each major release.

This repository does NOT contain the most current documentation.

The documentation files are written in the markdown format and the most current versions of these files and are not stored here. Instead, they are stored in a docs folder alongside the framework source code in each framework repository. For example, the documentation markdown files for the master branch of the SilverStripe framework are stored in https://github.com/silverstripe/silverstripe-framework/tree/master/docs.

Installation

To set up a local instance of doc.silverstripe.org:

  • Clone this repository to an empty directory
   git clone https://github.com/silverstripe/doc.silverstripe.org path/to/ssdocs

Docker install

No local NodeJS nor gatsby-cli is required for this option.

  • Make sure docker and docker-compose are installed and docker daemon is running
  • Simply use ./docker/run to run gatsby commands
    • ./docker/run build would be equal to run gatsby build within a container
    • ./docker/run develop -p 8000 would run gatsby develop -p 8000 within a container.

Native install

Building

To test a static build of the site, first create a production environment file.

cp .env.development .env.production

Then, run the build.

gatsby build
gatsby serve

These commands will give you an exact representation of how the site will run on a production server, with statically generated html files and server-side rendering.

Toggling between docs and userhelp

Whether the application uses the docs.silverstripe.org content or userhelp.silverstripe.org is determined by the environment variable, DOCS_CONTEXT. You can set this in the .env.development file, or use one of the script shortcuts:

yarn dev-docs
yarn dev-user
yarn build-docs
yarn build-user

Developing

From within path/to/ssdocs, run the command

gatsby develop

to instantiate a development server. This will consume all of the markdown files in both major release branches and allow you to browse the documentation site on http://localhost:8000 by default (see the Gatsby docs for instructions on customising the port).

Authoring

You can make changes directly to the source markdown files and get live updates in the development server without having to rebuild the app or even refresh the browser. The clones of the silverstripe/framework repositories are in the .cache/gatsby-source-git folder in the root of this project. There are subfolders for 3/ and 4/, respective to their branch names. You can edit the files in docs/en from there.

Just don't forget to merge your changes upstream once you're done. Building the gatsby app will not preserve your content changes, since the remote repositories are the source of truth.

Deploying content changes

Once your contribution has been merged into the master branch, it will be deployed to production via a Github action in the repository that holds the markdown files (e.g. silverstripe/silverstripe-framework for docs).

Deploying app changes

Once your change is merged in to the master branch of this repository, it will be deployed to production.

Contribution

To contribute an improvement to the https://docs.silverstripe.org or https://userhelp.silverstripe.org functionality or theme, submit a pull request on the GitHub project. Any approved pull requests will make their way onto the https://docs.silverstripe.org or https://userhelp.silverstripe.org sites in the next release.

If you wish to edit the documentation content, submit a pull request on the framework Github project or the userhelp documentation repository or corresponding module.