Get started with the tech-docs-template
The tech-docs-template is a middleman project template which has the basic files and configurations you will need to create your first project.
The template uses the tech-docs-gem to include the GOV.UK styles and components, layout files and custom functionality.
Install tech-docs-template dependencies
Before you use the tech-docs-gem your environment needs to have some additional packages, known as dependencies, installed. Your environment must have the dependencies in the table below. You should check the documentation for the correct installation process to suit your environment.
| Name | Version | Documentation |
|---|---|---|
| Ruby | >= 3.3.11 | Ruby installation instructions |
| Node.js | >= 22 | Node installation instructions |
| Git | latest | Git installation instructions |
| Middleman | latest | Middleman installation instructions |
You will need access to a terminal such as bash or Powershell, depending on the machine you are using. You may also need additional software such as Xcode command line tools if you are on a Mac. You should follow the installation process outlined by your organisation when installing or updating software.
If you are unsure check with your local IT or device management team, or technical colleagues.
Create a new documentation project
Once you have an environment with all your dependencies installed, you can follow these steps to create a new project. During the installation process you will need to answer to some questions to set up your site configuration.
Open your terminal and navigate to the folder you wish to create your project in.
Run the following in the command line:
middleman init <project_name> -T alphagov/tech-docs-templatereplace
<project_name>with the name of your documentation. A new project folder will be created with this name.Answer the installation questions.
When you see
Bundle complete!, go to the new project folder and runbundle installto update the Ruby gems.
Installation questions
You should provide answers to the questions below during the installation process. You will be able to change these settings later in your config/tech-docs.yml file.
| Terminal prompt | Setting | Description | Example |
|---|---|---|---|
Documentation URL: |
host |
The URL of your documentation. This may not be the same as the service itself. | https://docs.data-sharing-service.gov.uk |
Service Name: |
service_name |
The name of the service or API your documentation is about. | Data sharing service |
Service URL: |
service_link |
The URL for the service your documentation is about. | https://data-sharing-service.gov.uk |
Will you be using the GOV.UK logo?: |
show_govuk_logo |
Controls the display of the GOV.UK logo in the documentation header. You should only use this if your documentation falls under the GOV.UK proposition. |
Yes, No
|
If you are running the installation script as part of an automated process, such as Docker environment or a CI/CD pipeline you can set environment variables to avoid CLI prompts.
You can see an example of this in the create-test-site.sh file.
If you are unsure how to set variables for your specific environment you should check with your IT or technical colleagues.