Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • H handbook
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 5
    • Issues 5
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Administrator
  • handbook
  • Issues
  • #1
Closed
Open
Issue created Mar 30, 2020 by Administrator@rootOwner

Local Hugo Review App

When working from a local repository, this project allows you to run the command hugo server to stand up a little local server that shows you what the website will look like once it's published.

There are Merge Request features that can make references to this local environment. The two things that are needed are a /.gitlab/route-map.yml file and a /.gitlab-ci.yaml pipeline job.

GitLab CI Job Definition

local:review:
  stage: review
  script:
    - echo "start review app locally for Merge Request links to work.  Run 'hugo server'"
  only:
    - branches
  except:
    - master
  environment:
    name: local
    url: http://127.0.0.1:1313
  variables:
    GIT_STRATEGY: none

Route Map yaml file contents

# pages, but drop the extension (this means no URLs can have a period in them)
- source: /content\/handbook\/(.+?)\..*/
  public: 'handbook/\1/'

If you create more top-level directories under content, be sure to add them and follow the patterns specified in the docs.

Assignee
Assign to
Time tracking