Skip to content

Add Hugo and initial content migration scripts

Sarah German requested to merge 3-add-hugo into main

What does this MR do and why?

  • Adds Hugo to the Hugo project! 😄
    • Adds make target and directions for local setup
    • Adds scaffolding for theme
    • Adds a minimal configuration file
  • Adds a script to modify markdown files at build time
  • Adds a build stage to the CI pipeline

Screenshots, screen recordings, or links to review app

How to set up and validate locally

🚨 Tip: Set this project up in a different location than your working copies of docs source projects (gitlab, gitlab-runner, etc). Using REMOVE_BEFORE_CLONE=true while testing the clone-docs-projects make target will remove local copies of upstream projects if they're in the same directory as gitlab-docs-hugo.

  1. Check out this branch.
  2. Run make setup. This should add hugo and yq to your local toolset.
  3. Pull down content repos. This step now also runs a bash script that renames files: REMOVE_BEFORE_CLONE=true make clone-docs-projects

You should see successful clone and update operations, like this:

INFO: Fetching docs content sources...
2023/12/06 15:12:00 [Info] ../gitlab-runner already exists, removing it
2023/12/06 15:12:00 [Info] Fetching runner on branch main at commit heads/main
2023/12/06 15:12:01 [Info] Last commit: 79fa4fb Merge branch 'mrincon-ff-clarification' into 'main'
2023/12/06 15:12:01 [Info] ../charts-gitlab already exists, removing it
2023/12/06 15:12:01 [Info] Fetching charts on branch master at commit heads/master
2023/12/06 15:12:02 [Info] Last commit: 43f2d4c Merge branch 'fix-nginx-newline' into 'master'
2023/12/06 15:12:02 [Info] ../gitlab-operator already exists, removing it
2023/12/06 15:12:02 [Info] Fetching operator on branch master at commit heads/master
2023/12/06 15:12:03 [Info] Last commit: 5f76e16 Merge branch 'beck-arm-crosscompile' into 'master'
2023/12/06 15:12:05 [Info] ../gitlab already exists, removing it
2023/12/06 15:12:05 [Info] Fetching gitlab on branch master at commit heads/master
2023/12/06 15:12:27 [Info] Last commit: 964b7cf9a Merge branch 'fix_undefined_method_downcase' into 'master'
2023/12/06 15:12:27 [Info] ../omnibus-gitlab already exists, removing it
2023/12/06 15:12:27 [Info] Fetching omnibus on branch master at commit heads/master
2023/12/06 15:12:28 [Info] Last commit: a489b4e Merge branch 'naman/17584-pages-nginx-namespace-in-path' into 'master'

INFO: Running content update scripts...
Renaming index files in ../gitlab...
Renaming index files in ../omnibus-gitlab...
Renaming index files in ../gitlab-runner...
Renaming index files in ../charts-gitlab...
Renaming index files in ../gitlab-operator...
INFO: Content updates complete!
  1. Run make view

You should see that Hugo has compiled all our pages:

                   |  EN
-------------------+-------
  Pages            | 2739
  Paginator pages  |    0
  Non-page files   |  827
  Static files     |    1
  Processed images |    0
  Aliases          |    0
  Sitemaps         |    1
  Cleaned          |    0

Note: The "Pages" number is higher than our recent content audit because this still includes some pages that we won't actually publish. We'll address this later on: #24 (closed).

This will also return a preview URL: http://localhost:1313/

Visiting this page in your browser should show you the top-level index page (on the current site, that's this: https://docs.gitlab.com/ee/).

Links will not work yet (not til #52 (closed)), and there's no styling, but it's a real webpage!

You can verify we've included all products by visiting these pages:

For GitLab, this is a big change: we've dropped the ee prefix in the URL (which will eventually close gitlab-org/gitlab-docs#1081 (closed)). We will handle redirects for this later on: #43

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #3 (closed)

Edited by Sarah German

Merge request reports