Local Setup (for Developers)

Last modified: 2026-04-29 01:29av bruker: Erik Hagen ID: e26cb201-0841-46b2-8ac7-2ba3708edde6 SAMT-X/samt-bu-docs

This option gives you a full local working environment in which you can preview all changes in the browser as you write. Recommended for structural changes, larger amounts of new content, or technical development.

What You Need

ToolVersionPurpose
GitLatest stableVersion control
Hugo Extended0.155.3 or laterSite generator
Go1.21 or laterRequired by Hugo Modules
Text editorVS Code recommended

Installation on Windows

winget install --id Git.Git
winget install --id Hugo.Hugo.Extended
winget install --id GoLang.Go
winget install --id Microsoft.VisualStudioCode

Restart the terminal afterwards so that the newly installed programmes are available in PATH.

Verify the installation:

git --version
hugo version
go version

Installation on macOS

brew install git hugo go

Installation on Linux (Ubuntu/Debian)

sudo apt install git golang
# Hugo Extended is obtained from GitHub Releases (the apt version is often too old):
wget https://github.com/gohugoio/hugo/releases/download/v0.155.3/hugo_extended_0.155.3_linux-amd64.deb
sudo dpkg -i hugo_extended_0.155.3_linux-amd64.deb

Clone the Repository

git clone --recurse-submodules https://github.com/SAMT-X/samt-bu-docs.git
cd samt-bu-docs
hugo mod download

--recurse-submodules ensures that the theme (hugo-theme-samt-bu) is downloaded at the same time. hugo mod download fetches content modules from the other repositories.

Start Local Preview

hugo server

Open http://localhost:1313/samt-bu-docs/ in the browser. The page updates automatically when you save a file.

File Structure – Where the Content Lives

content/
  om/                      ← "About" section
  behov/                   ← Needs (use cases)
  pilotering/              ← Pilots
  arkitektur/              ← Architecture
  prosjektleveranser/      ← Solutions and framework
  innsikt/                 ← Shared insight
  administrasjon-og-styring/
  utkast/                  ← Drafts and inputs (content module)

Each chapter is a folder containing two files:

content/om/om-samt-bu/
  _index.nb.md    ← Norwegian content
  _index.en.md    ← English content

Writing Content

Content files are standard Markdown files with a small header at the top (frontmatter):

---
title: "Page title"
weight: 30
---

Your content begins here in standard Markdown.

## Heading

A paragraph with **bold text** and *italic text*.
  • title – page title displayed in the menu and at the top of the page
  • weight – sort order (lower number = higher in the menu)
  • draft: true – add this to hide the page from publication until it is ready

Saving and Publishing Changes

git add content/path/to/file/_index.en.md
git commit -m "Brief description of what you changed"
git push

GitHub Actions builds and publishes automatically after 1–2 minutes.

No write access to the repository? Create a pull request instead: git checkout -b my-contribution → make changes → git push origin my-contribution → open a PR on GitHub.

Useful Commands

CommandDescription
hugo serverStart local server with live reload
hugo server -DInclude pages marked with draft: true
hugoBuild to the public/ folder (check for errors)
git pullFetch the latest changes from GitHub
hugo mod get -uUpdate all content modules to the latest version