Edit this website locally

On this page

Introduction

This is a guide on what you'll need to install and run on your machine so you can make edits locally. This is quicker than in the web interface and allows you a better overview and preview when making complex changes.

1. Help is available for team members

If you work for GitLab Inc. we don't expect you to figure this out by yourself. If you have questions ask anyone for help, you're more likely to have success with:

2. Start using GitLab

  1. Here's where you can find step-by-step guides on the basics of working with Git and GitLab. You'll need those later.
  2. Create your SSH Keys.
  3. For more information about using Git and GitLab see GitLab University.

3. Install Git

  1. Open a terminal.
  2. Check your Git version by executing: git --version.
  3. If Git is not installed, you should be prompted to install it. Follow this guide to installing Git and linking your account to Git.

4. Install RVM

  1. Visit https://rvm.io.
  2. In a terminal, execute: curl -sSL https://get.rvm.io | bash -s stable.
  3. Close terminal.
  4. Open a new terminal to load the new environment.

5. Install Ruby and Bundler

  1. In a terminal, execute: rvm install 2.4.4 to install Ruby (enter your system password if prompted).
  2. Execute: rvm use 2.4.4 --default to set your default Ruby to 2.4.4.
  3. Execute: ruby --version to verify Ruby is installed. You should see: ruby 2.4.4p296 (2018-03-28 revision 63013).
  4. Execute: gem install bundler to install Bundler.

6. Clone the source of the website and install its dependencies

  1. If you set up SSH keys previously, in terminal execute: git clone git@gitlab.com:gitlab-com/www-gitlab-com.git to clone the website. If you prefer using https, then execute: git clone https://gitlab.com/gitlab-com/www-gitlab-com.git, but note that if you've activated 2FA on your GitLab.com account, you'll need to take some additional steps to set up personal access tokens. If you ever want to switch between SSH and https, execute git remote remove origin, followed by git remote add origin [..] where the [..] is the part that starts with git@ for SSH, or with https: for https.
  2. Execute: cd www-gitlab-com to change to the www-gitlab-com directory.
  3. Execute: bundle install to install all gem dependencies.

7. Prevent newlines from causing all following lines in a file to be tagged as changed

This is especially a problem for anyone running a Mac OSX operating system. The command to 'tame' git is git config --global core.autocrlf input - execute it.

8. Preview website changes locally

  1. In a terminal, execute: bundle exec middleman.
  2. Visit http://localhost:4567/ in your browser.
  3. You will need to install a text editor to edit the site locally. We recommend Sublime Text 3 or Atom. Use command / ctrl P to quickly open the file you need.
  4. Refresh your browser to see your changes.

Until this is automated in CI, a quick way to see if there are any invalid links inside a page is the following.

  1. Install the check-my-links extension in Chrome (no other browsers support unfortunately).
  2. Open the page you wish to preview (see previous step).
  3. Click the newly installed extension in the upper right corner of Chrome.

A pop-up window will open and tell you how many links, if any, are invalid. Fix any invalid links and ideally any warnings, commit and push your changes, and test again.

All internal links (links leading to other parts of the website) should be relative.

10. Start contributing

Most pages that you might want to edit are written in markdown Kramdown. Read through our Markdown Guide to understand its syntax and create new content.

Instructions on how to update the website are in the readme of www-gitlab-com.

11. Add yourself to the Team Page

We are happy to have you join our company and to include you in our team page! Ask anyone in the company for help if you need it. Choose the method below that feels most comfortable and have the following information handy:

Add on GitLab.com (Web IDE)

  1. Go to the GitLab.com / www-gitlab-com project.
  2. On the project page, click on the button labeled Web IDE near the middle of the page next to History and Find File buttons.
  3. In the file browser, navigate to source/images/team.
  4. Click the icon next to the team directory and choose upload file and choose the photo you prepared in step 2.
  5. Next, navigate to in the file browser data/team.yml and click on it to open the editor.
  6. Search for a placeholder entry with your initials and update your profile information. Copy/paste another team member's entry if you don't have a placeholder.
    • Change name to your FirstName LastName and slug to your name without spaces.
    • Verify your title.
    • Verify reports_to lists your manager using the slug value from their team page entry.
    • Add the filename of your profile picture.
    • Add your Twitter and GitLab handles without the leading @.
    • Add your own story. Use other team member's stories as a reference.

      Important: Do not use the tab character and respect the spaces between lines otherwise the page format will break.

  7. Once you have finished this, click the Commit button in the bottom left. It should say something like 2 unstaged and 0 staged changes. This will bring up a sidebar with an Unstaged and Staged area.
  8. Check the file to ensure your updates are what you expect. If they are, click the check mark next to the filename to "stage" these changes.
  9. Once you have verified all of the edits, enter a short commit message including what you've changed. Choose Create a new branch and merge request. Choose a branch name of your choosing, usually in the format of YOURINITIALS-team-page or similar. Then click commit once more.
  10. Fill out the merge request details and assign it to your Talent Operations Specialist or People Ops.

Add on GitLab.com (web interface)

  1. Go to the GitLab.com / www-gitlab-com project.
  2. Click on "Files" (under "Repository" on the left-hand side menu).
  3. Click on source, then images, then team.
  4. At the top of the page click + and choose Upload file to upload your picture. It should be added to www-gitlab-com/source/images/team/yournameinlowercase.EXT.
  5. Commit these changes with a specific commit message add FirstName LastName to team page and a unique branch name that you will use in the next step.
  6. Create a merge request in GitLab.com with the branch that you created with your picture.
  7. Go back to the GitLab.com project. Find the branch dropdown menu at the top of your screen (default value is "master") and find the branch that you previously created to add your picture (they are in alphabetical order).
  8. Information displayed on Team page is pulled from a data file. You can find it by clicking on each of the following items: Files, data/, and then team.yml.
  9. When you are in team.yml, click on “edit” on the top right side of your screen.
  10. Search for a placeholder entry with your initials and update your profile information. Copy/paste another team member's entry if you don't have a placeholder.
    • Change name to your FirstName LastName and slug to your name without spaces.
    • Verify your title.
    • Verify reports_to lists your manager using the slug value from their team page entry.
    • Add the filename of your profile picture.
    • Add your Twitter and GitLab handles without the leading @.
    • Add your own story. Use other team member's stories as a reference.

      Important: Do not use the tab character and respect the spaces between lines otherwise the page format will break.

  11. After you added your information, add a comment to your commit and click on “Commit Changes”.
  12. Go to your previously created merge request and assign it to your Talent Operations Specialist or People Ops.

Add Locally (using the terminal)

  1. Download Git, following the start using git documentation.
  2. Follow the steps to create and add your SSH keys.
  3. Clone the www-gitlab-com project through your shell, following the command line commands documentation.
  4. Create and checkout a new branch for the changes you will be making.
  5. Add your picture to the source/images/team/ directory in the repository and git add it.
  6. Open data/team.yml in your favorite editor.
  7. Search for a placeholder entry with your initials and update your profile information. Copy/paste another team member's entry if you don't have a placeholder.
    • Change name to your FirstName LastName and slug to your name without spaces.
    • Verify your title.
    • Verify reports_to lists your manager using the slug value from their team page entry.
    • Add the filename of your profile picture.
    • Add your Twitter and GitLab handles without the leading @.
    • Add your own story. Use other team member's stories as a reference.

      Important: Do not use the tab character and respect the spaces between lines otherwise the page format will break.

  8. Save changes to data/team.yml and git add it.
  9. To see your changes locally, follow the directions in README.md.
  10. After validating your changes, commit your changes with a comment and push your branch.
  11. Create a Merge Request in GitLab.com with the branch that you created and assign it to your Talent Operations Specialist or People Ops.

Add your pet(s) to the Team Pets Page

Using what you learned in the steps above, consider adding your pet to the Team Pets page. You can follow these instructions for adding them via the Web IDE.

  1. Again, find the picture that you'd like to add to the team pets page, and update the picture's name to the following format: petname.jpg or petname.png. Ensure the picture size is around 400x400 (it must be square).
  2. Go to the GitLab.com / www-gitlab-com project.
  3. On the project page, you will see a Web IDE button near the middle of the page next to History and Find File buttons.
  4. In the file browser, navigate to source/images/team/pets.
  5. Click the + icon next to the team directory and choose upload file and choose the photo you prepared in step 1.
  6. Next, navigate to in the file browser data/pets.yml and click on it to open the editor.
  7. Add your pet by following the format of the existing pets on the page (you can copy and paste their lines of code, even). Ensure that you include your pet's name, your name, and the image you uploaded in step 1.
  8. Once you have finished this, click the Commit button in the bottom left. It should say something like 2 unstaged and 0 staged changes. This will bring up a sidebar with an Unstaged and Staged area.
  9. Check the file to ensure your updates are what you expect. If they are, click the check mark next to the filename to "stage" these changes.
  10. Once you have verified all of the edits, click commit once more. Here, enter a short commit message including what you've changed. Choose Create a new branch and merge request. Choose a branch name of your choosing.
  11. Fill out the merge request details and assign it to People Ops for review (the recommended assignee would be the Talent Operations Specialist who helped you with onboarding).

12. Edit the Handbook

WebIDE, using the browser

The Web Integrated Development Environment (IDE) is used to make changes within the browser. This method requires no setup.

  1. Find the handbook page to edit.
  2. Click on the Edit this page button at the bottom of the page.
  3. On the page, you should see the relevant file in the repository displayed. Click on the Web IDE button on the right side.
  4. Edit the page using MarkDown. You can preview your changes (but links will not work).
    • Note: You can edit other pages by browsing through the filelist on the left side in the Web IDE.
  5. When done, click on the Commit... button on the bottom left. You will see the differences between the original file and your changes.
  6. Add a commit message. The message should be as brief as possible, since it has a character limit. You can add more detail in the description in a subsequent step.
  7. Choose the option to create a new branch and create merge request. For your branch, use a descriptive name with hyphens, so that you can find it again later, but it's temporary so don't worry too much about the exact name.
  8. Submit and you will be taken to the merge request (MR) page.
  9. Feel free to add a more detailed message in the description box. For the options, check Remove source branch and squash commits.
  10. Assign the MR to the Handbook Content Manager (or as instructed) for general handbook changes. If the content changes are specific to your team, assign the MR to your manager.

Locally, using the terminal

  1. If you haven't already, follow steps 1-5 in the "Add yourself to the Team Page"'s "Add Locally (using the terminal)" section above. (This step is necessary as the handbook lives in the same repository as the rest of GitLab.com). If you're following this guide in order and have already added yourself to the team page, instead go back to the main branch (via git checkout master) and there create a new branch for your handbook edits.
  2. The handbook lives under source/handbook. For the most part, you can locate the specific item to edit via that item's URL. For instance, this page is /handbook/git-page-update/ and its source lives in source/handbook/git-page-update/index.html.md.
  3. Edit away! See the "Start Contributing" section, above, for details about the Markdown that most pages are written in.
  4. Preview your changes locally by following the directions in README.md. Keep in mind that the local server won't auto-reload when you change a page, so you'll need to restart it to see what you've done.
  5. Once you've made your changes and verified they appear the way you want them to, commit them with a comment and push your branch.
  6. As above, Create a Merge Request in the www-gitlab-com project. If you're onboarding, don't forget to assign it to your manager.

Example video

Where should content go?

GitLab has a lot of places you can put web content including the website, blog, docs, and the handbook. Here's an overview of where you should create a merge request to add content.

  1. blog: The blog is a great place to start. If you don't know where to put content, then write a blog post! Great blogs can always be then copied or modified for the website, docs, and handbook later. Blog posts are especially good for news, annoucements, and current trends because blog posts are tied to a specific date.
  2. website: This is the main marketing site for GitLab and where folks will tend to go first to find out information about GitLab (the product and the company). The website contains a broad set of content from product pages to customer case studies. The website is the best place for evergreen articles such as topic and solution pages since it's not tied to specific date.
  3. docs: The docs are where are all technical information about GitLab self-managed and GitLab.com belongs. If the intended audience for the content is a user of GitLab then it should be in the docs. The docs are great place for both refernce docs (what are the configurable settings for a feature, e.g. what can you do with issues) and narrative docs (how to do x with y, e.g. how to set up HA on AWS).
  4. handbook: The handbook is for any content that needs to be used by GitLabbers to do thier job. If you put content on the blog, website, and docs, but you think it would be helpful for GitLabbers to do thier job then link to the content from the handbook.

Sometimes the lines are blurry and it can seem as though there are multiple places that would be a good fit. For example, "how to" articles make great blog posts, but could be more discoverable to users if they are in the docs. Just pick one. It's better to create content somehwere than nowhere. When in doubt, start with the blog.