www-gitlab-com
This is the source for the https://about.gitlab.com/ site. For a guide on how to start editing the website using git, see the handbook page on that topic.
Local development
Read how to preview any changes locally.
Contributing
Please see the contribution guidelines
Adding yourself to the team page
Edit data/team.yml
and add a new entry for yourself (or
update the placeholder with your initials).
Images should be square, and should be uploaded to source/images/team
.
Adding a pet to the team pets page
Edit data/pets.yml
and add a new entry.
Images should be uploaded to source/images/team/pets
.
Blog posts
/applications
)
Adding an application to the applications page (under
Updating the promotion link
This link appears at the top of the homepage and can be used to promote new versions or upcoming events.
Edit data/promo.yml
to update the link
and text
properties.
/features
)
Update the features page (under How to update the features page.
/comparison
)
Create or update the comparison pages (under How to update the comparison pages.
/releases
)
Update the releases page (under How to update the releases page.
/handbook/engineering/projects
)
Update the projects page (under How to update the projects page.
Press releases page
How to add a press release page.
PDF files
Production build
Before building the static files, ensure you have a GitLab.com PRIVATE_TOKEN
environment variable setup. This is required so that Middleman can automatically
build the direction page.
bundle install
bundle exec rake build
# To also build PDFs:
bundle exec rake pdfs
The above command builds the static files and PDFs into the folder public
.
Custom Generators
There are a few custom, static generators specified in config.rb
. For
example, there are generators that produce the direction issue list,
releases list, and organization chart dynamically.
These pages cannot be viewed directly via the Middleman server (e.g. http://localhost:4567) because there are explicit rules that tell Middleman to defer the generation to other scripts. These special URLs (e.g. /releases/index.html) usually have two Middleman keywords:
-
This tells Middleman to output a static file based on the provided template.
-
This tells Middleman server not to handle this URL. The external generator will build the static files.
To preview these custom-generated pages locally, you must first rebuild the files:
bundle exec middleman build
To test out the site, you must run another Web server from the
public
directory:
(cd public; python -m SimpleHTTPServer 8000)
This will start a Web server on port 8000 (you may omit the port number). You can preview the site by pointing your browser to http://localhost:8000.
Review Apps
Thanks to the Review Apps, the www-gitlab-com
project supports live reviewing
of any website changes with every merge request. When a branch is pushed and
the pipeline is successfully run, you can see a link pointing to the live
environment in your merge request. The URL will be of the following scheme:
<branch-name>.about.gitlab.com
.
Beware that:
- To successfully deploy a Review App, the branch must exist in the
www-gitlab-com
repository. That means that branches from forks will not deploy a Review App (hence MRs from contributors). For that case, you should have at least Developer access to thewww-gitlab-com
project orgitlab-com
group. - The generation of the direction, wishlist and releases pages is omitted in branches and is run only on master. This helps to shave off some time from the build process. That means you won't be able to preview these pages with Review Apps.
Use Docker to render the website
If you don't have a proper environment available to run Middleman, you can use Docker to provide one for you locally on your machine. In order to have this working correctly, you need to have at least Git and Docker installed, and an internet connection available.
-
Clone the repository in a local folder
git clone git@gitlab.com:gitlab-com/www-gitlab-com.git
-
Create a Docker container
docker create --name middleman -v "$PWD/www-gitlab-com":/site -w /site -p 4567:4567 \ -e LC_ALL=C.UTF-8 ruby /bin/bash -c 'bundle install && bundle exec middleman'
-
Start the container
docker start middleman
-
Connect to `http://localhost:4567/
-
Change your original content as usual, and see the changes in the browser as soon as you save the new version of the file (otherwise, just restart the container)
-
When you have finished, stop the container
docker stop middleman
Note: Subsequent runs will just require
docker start middleman
.
Conclusion (please leave this at the bottom of the doc)
In case someone forgot the most important commands and is catting this file from the command line we end by listing them:
kill -kill `lsof -t -i tcp:4567`
bundle exec rake new_post
open -a "Google Chrome" http://localhost:4567
bundle exec middleman
or to execute the last two commands just run:
bin/run