Coder Social home page Coder Social logo

calgoodman / govuk-hugo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from co-analysis/govukhugo

0.0 1.0 0.0 2.75 MB

GOV.UK style theme for Hugo site builder

Home Page: https://co-analysis.github.io/govuk-hugo-demo

License: MIT License

HTML 10.68% CSS 15.50% JavaScript 73.31% SCSS 0.51%

govuk-hugo's Introduction

govukhugo

BREAKING CHANGE: The repository is now named govukhugo (formerly govuk-hugo).

govukhugo is a theme for the Hugo static site builder that is based on the GOV.UK Design System.

Hugo is a lightweight static site builder.

This is a work in progress. It has been created to help Cabinet Office Analysts make simple public facing sites for official statistics and open source works using the GOV.UK design system. In addition to the design system, as a data team, it has been inspired by Public Health England's Coronavirus data dashboard, which has adapted the GOV.UK style for data visualisation.

Features

govukhugo uses GOV.UK Frontend v3.10.2.

Hugo uses Goldmark to render markdown to HTML. While boilerplate elements (the header, footer and navbar structure) are natively written to support the Design System, Goldmark does not add the Design System classes to the rendered HTML, the footer content includes JavaScript that applies the Design System CSS to relevant HTML tags. Therefore, govukhugo is not suitable for environments that do not support JavaScript.

govukhugo does not use SASS for CSS processing, therefore the dashboard-layout.css provides the GOV.UK colour palettes as :root variables.

govukhugo is designed for dashboards, and uses a wider maximum page width than standard GOV.UK pages. Text elements are however limited to a max-width to improve readability: <p> and <pre> elements are limited to 810px; <li> elements are limited to 700px). Other elements (e.g. tables, images, interactives).

govukhugo supports code blocks, and provides syntax highlighting with Highlight.js.

Menu

govukhugo uses a sidebar menu, this relies on your content being organised within sections underneath the content folder. Your homepage will not show in the menu. If an about.md file is included in the content folder then this is rendered as an additional link at the bottom of the menu, any other files in the content directory but not within a sub-folder are not rendered.

Installation

Follow Hugo's instructions on getting started.

To install the theme either:

Download this repo as a zip and extract the files and copy them to the folder themes/govukhugo within your Hugo site base folder (note the lack of dash!!).

Or, add govukhugo as a submodule to your Hugo site's repository

$ git submodule add https://github.com/co-analysis/govukhugo.git themes/govukhugo

Configuration

To use this theme ensure your hugo config.yaml follows this example:

baseURL: https://your.site/
languageCode: en-gb
title: My Site Title
theme: govukhugo
publishDir: docs
canonifyurls: true

markup:
  goldmark:
    renderer:
      unsafe: true

params:
  govuk: false
  logotext: ABC
  product: Product Name
  phase: alpha
  feedbackurl: https://your.site/feedback/

If deploying to GitHub Pages you must set publishDir: docs and canonifyurls: true.

Set unsafe: true if you want to be able to use raw HTML in in markdown documents.

Unless you are deploying to a .gov.uk subdomain you should set govuk:false - this ensures you do not use GOV.UK's New Transport font, nor use the GOV.UK crown in the header and as the favicon.

You should provide a service acronym using logotest: ABC - this should be capitalised. If deploying to service.gov.uk you should set this as logotest: GOV.UK.

You can provide a product name using product: Product Name which will provide the product name in the header. If a product name is not provided the title specified at the top of the config.yaml file will be used.

To add a GOV.UK style "phase" banner set phase: alpha or phase:beta in the params. You should also provide a feedback URL using feedbackurl: https://your.site/feedback

govuk-hugo's People

Contributors

mattkerlogue avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.