This website is going to act as a portal template for every group/project that is interested of being part of the GO!Commons open source community. Every new group/project could fork this template and using a simple yml file should be enough to re-edit and create new content in combination with markdown wich allow for flexible composition of content.
Table of Contents generated with DocToc
This project uses yarn, you'll need to install this globally before you can get started.
npm install -g yarn
Then you need to install the project dependencies:
yarn install
Now you're ready to go. To run the local dev server just use the following command:
yarn start
Your website should be available at [http://localhost:8080/]
Read more at VuePress' documentation.
This project's static Pages are built by GitLab CI, following the steps
defined in .gitlab-ci.yml
:
image: node:9.11.1
pages:
cache:
paths:
- node_modules/
script:
- yarn install
- yarn build
artifacts:
paths:
- public
only:
- gl-pages
-
Set correct
base
indocs/.vuepress/config.js
.If you are deploying to
https://<USERNAME>.github.io/
, you can omitbase
as it defaults to"/"
.If you are deploying to
https://<USERNAME>.github.io/<REPO>/
, (i.e. your repository is athttps://github.com/<USERNAME>/<REPO>
), setbase
to"/<REPO>/"
. -
Inside your project, create
deploy.sh
with the following content (with highlighted lines uncommented appropriately) and run it to deploy:
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run docs:build
# navigate into the build output directory
cd docs/.vuepress/dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
# if you are deploying to https://<USERNAME>.github.io/<REPO>
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
cd -
::: tip You can also run the above script in your CI setup to enable automatic deployment on each push. :::
-
Set correct
base
indocs/.vuepress/config.js
.If you are deploying to
https://<USERNAME or GROUP>.github.io/
, you can omitbase
as it defaults to"/"
.If you are deploying to
https://<USERNAME or GROUP>.github.io/<REPO>/
, (i.e. your repository is athttps://github.com/<USERNAME>/<REPO>
), setbase
to"/<REPO>/"
. -
Create a file named
.travis.yml
in the root of your project. -
Use Github Pages deploy provider template and follow the travis documentation.
language: node_js
script:
- npm run docs:build
deploy:
provider: pages
skip-cleanup: true
local_dir: docs/.vuepress/dist
github-token: $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository
keep-history: true
on:
branch: master
This sets up a node9.11.1
environment, then uses yarn install
to install dependencies and yarn build
to build out the website to the ./public
directory.
It also caches the node_modules
directory to speed up sebsequent builds.