redtape

simple tiny document generator


Keywords
github, markdown, documentation, quick, small, simple
License
MIT
Install
pip install redtape==1.2

Documentation

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

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

Read how to add a blog post.

Adding an application to the applications page (under /applications)

How to add an application.

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.

Update the features page (under /features)

How to update the features page.

Create or update the comparison pages (under /comparison)

How to update the comparison pages.

Update the release list page (under /release-list)

How to update the release list page.

Update the projects page (under /handbook/engineering/projects)

How to update the projects page.

Press releases page

How to add a press release page.

PDF files

How to work with PDFs.

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, release 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. /release-list/index.html) usually have two Middleman keywords:

  1. proxy

    This tells Middleman to output a static file based on the provided template.

  2. ignore

    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 the www-gitlab-com project or gitlab-com group.
  • The generation of the direction, wishlist and release list 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.

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