Skip to content

A new PoC implementation of altinn infoportal using Hugo + markdown.

License

Notifications You must be signed in to change notification settings

Altinn/altinn-infoportal-hugo

Infoportal

This repo is a PoC for portfolio #7.

infoportal.no Infoportal frontpage

Running altinn-infoportal locally

  1. Clone the repo (assumes you've installed Git):
    cd C:/repos
    git clone https://github.com/Altinn/altinn-infoportal-hugo
  2. Download Hugo (v0.80.0 or newer), and copy the executable for your OS into the new altinn-infoportal-hugo folder.
  3. Navigate to folder and run Hugo
    cd altinn-infoportal-hugo
    ./hugo serve --navigateToChanged

Which will result in output similar to:

Start building sites …

                   | NB  | EN  | NN   
-------------------+-----+-----+------
  Pages            |  27 |  19 |  19  
  Paginator pages  |   0 |   0 |   0  
  Non-page files   |   4 |   4 |   4  
  Static files     | 503 | 503 | 503  
  Processed images |   0 |   0 |   0  
  Aliases          |  12 |  10 |  10  
  Sitemaps         |   2 |   1 |   1  
  Cleaned          |   0 |   0 |   0  

Built in 10707 ms
Watching for changes in C:\repos\altinn-infoportal\{content,i18n,layouts,static,themes}
Watching for config changes in C:\repos\altinn-infoportal\config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

The solution is now running locally at http://localhost:1313

Content management (Netlify CMS)

Work in progress, currently only a limited content types is available

Altinn-infoportal use Netlify CMS to manage the site content. The interface is available at http://localhost:1313/admin and requires an Github account with write permission to the repository.

Netlify CMS is configured to be multilanguage supported.

Workflow

The CMS is configured with editorial_workflow which requires the content to be approved before published.

Workflow steps:

  1. Create content
  2. Save Draft
  3. Review pull request in repository
  4. Merge changes
  5. Published

Development

The configuration for Netlify CMS has enabled local_backend which enables the CMS to read/store from local repository. This is good if you want to test or make changes in the CMS, but not commit pull requests to master.

To make this work, run npx netlify-cms-proxy-server in a terminal window while running hugo serve in another.