Skip to content

Commit 07a91b3

Browse files
authored
Merge pull request #1 from ukhsa-collaboration/hg-initial-commit
initial commit hg
2 parents e7ec372 + 87cb0f6 commit 07a91b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+4416
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Standard issue template
3+
about: For requesting changes or new features
4+
title: 'Issue report template (Replace with a description of your issue)'
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## What type of issue is this?
11+
12+
- [ ] Suggesting a change to a published page
13+
- [ ] Requesting something new
14+
- [ ] Other
15+
16+
## Details
17+
18+
Replace this text with a description of what you are suggesting or asking for.

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# R files
2+
*.Rhistory
3+
*.RData
4+
*.rData
5+
*.Ruserdata
6+
*.Rcheck
7+
*.Rproj.user
8+
9+
# Local testing environment files
10+
Gemfile.lock
11+
docs/_site/

CONTRIBUTING.md

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
## Contributing instructions
2+
3+
We welcome contributions to our guidance or other resources. If you would like to suggest a change, please either [raise an issue](https://github.com/ukhsa-collaboration/statistics-production-hub/issues), [email us](mailto:ukhsa_hopstats@ukhsa.gov.uk) or raise a pull request.
4+
5+
The sections below describe the setup of this repository and how to reproduce some of the markdown features used within the guidance pages.
6+
7+
8+
### Interacting with this repository
9+
10+
#### Cloning the repository
11+
12+
In a new folder, using GitBash (or equivalent), run the following code:
13+
14+
```
15+
git clone https://github.com/ukhsa-collaboration/statistics-production-hub
16+
```
17+
18+
Open the .Rproj file to interact with the contents. You should not need to set any remotes for push/pull operations.
19+
20+
Remember to run `git pull` regularly to keep up to date with the main branch.
21+
22+
#### Branching
23+
24+
The 'main' branch is protected, meaning you will have to create a new branch to make any changes.
25+
26+
To do this, on your local machine, first update your 'main' branch using `git pull`. Then run `git checkout -b branch-name` to create and switch to a new branch. You can switch between branches (for example, to work on different fixes) by using `git checkout branch-name`.
27+
28+
Branch names should be short but descriptive, with each word separated by a hyphen. Author initials should be added to the prefix. For example: `"bc-update-data-vis"`.
29+
30+
Use `git add` and `git commit -m "a clear descriptive commit message"` as usual to stage and commit your changes.
31+
32+
Once you have finished making your changes, push your branch to GitHub (using `git push` - it may give you instructions for setting an upstream branch). Then log in to GitHub and raise a pull request to have your changes reviewed and merged into 'main'.
33+
34+
35+
## Building websites with Jekyll and GitHub
36+
37+
[See a useful resource for working with Jekyll in GitHub here](https://carpentries-incubator.github.io/jekyll-pages-novice/).
38+
39+
### Folder and file structure
40+
The root folder can be used to store any non-website content.
41+
42+
Anything contained within `docs` is used to render the live site (this can be changed if needed via GitHub > Settings > Pages).
43+
44+
Individual pages should be contained within the `docs` folder (not in sub-folders), and in .md format.
45+
46+
The `_includes` folder is used to store .html/.js snippets to be inserted into other files via Liquid commands (for example, `{% include site-nav.html %}`).
47+
48+
The `_layouts` folder is used to store larger template files.
49+
50+
The `assets` folder is used to store .css stylesheets and images.
51+
52+
The `_config.yml` file can be used to store sitewide values. These are then inserted to other pages via Liquid commands (for example, `{{ site.email }}`).
53+
54+
### Creating direct download links for files
55+
Direct download links are used for files such as the QA review conversation tool.
56+
57+
To get a link:
58+
1. Navigate to the file in the assets/downloads folder in GitHub (click on the actual file).
59+
2. Right-click "Raw", and "Copy link address".
60+
3. Paste that URL into your markdown file, formatting as with any other link.
61+
62+
### Markdown commands used in this site
63+
Most of what goes into the .md files will be standard markdown. Some other code is custom built for this site, relying on scripts found within the `_includes` folder.
64+
65+
The features used within this site can be replicated as follows.
66+
67+
#### Block quotes
68+
69+
Add an arrow (">") to the start of each line. You can use other markdown tags (headers, bullets) within this.
70+
71+
```
72+
> ## Main messages
73+
>
74+
> - Message 1
75+
> - Message 2
76+
> - Message 3
77+
```
78+
79+
#### Expandable sections
80+
81+
First include the hidden content within a 'capture' block like below.
82+
83+
Make sure to add a unique number to the end of each block title. Numbers should be unique across all expandable blocks in the whole document.
84+
85+
```
86+
{% capture expandable_content_1 %}
87+
Content goes here, written in normal markdown.
88+
{% endcapture %}
89+
90+
{% capture expandable_content_2 %}
91+
This is a second expandable section.
92+
{% endcapture %}
93+
```
94+
95+
Then you can use the following code to include expandable sections with the appropriate titles.
96+
97+
The 'block-start' and 'block-end' lines are needed for styling.
98+
99+
The parameter given in 'content' should match the title of the relevant capture block declared above.
100+
101+
Be careful to use a unique number in each line (numbers should also be unique within the entire markdown file). The title will display within the button used to expand the section.
102+
103+
```
104+
{% include expandable-block-start.html %}
105+
{% include expandable-section.html number="1" content=expandable_content_1 title="This is the first title" %}
106+
{% include expandable-section.html number="2" content=expandable_content_2 title="This is the second title" %}
107+
{% include expandable-block-end.html %}
108+
109+
```
110+
111+
112+
#### Code blocks
113+
````
114+
```
115+
Code block
116+
line 2
117+
line 3
118+
```
119+
````
120+
121+
122+
#### Images
123+
124+
To add images to a page, first add the file to the `docs/assets/img/` folder.
125+
126+
Then link using the following code, adding the correct filepath and alt-text:
127+
128+
`<img src="assets/img/laptophands.jpg" alt="A picture of a person working at a laptop">`
129+
130+
131+
##### Image and text side-by-side
132+
If you want to have an image next to some text, you can do that using the code below.
133+
134+
Note that you should specify the image width and height.
135+
136+
137+
```
138+
<div class="image-text-container">
139+
<img src="assets/img/image.png" width="460px" height="318px" alt="provide some alternative text here">
140+
<p>The text goes here</p>
141+
</div>
142+
```
143+
144+
#### Title+content cards (like the ones found in the QA guidance)
145+
146+
First include the card content within a 'capture' block like below.
147+
148+
Make sure to add a unique number to the end of each block title. Numbers should be unique across all cards in the whole document.
149+
150+
```
151+
{% capture card_content_1 %}
152+
Content goes here, written in normal markdown.
153+
{% endcapture %}
154+
155+
{% capture card_content_2 %}
156+
This is content for a second card.
157+
{% endcapture %}
158+
```
159+
160+
Then you can use the following code to include cards with the appropriate titles.
161+
162+
The 'container-start' and 'container-end' lines are needed for styling.
163+
164+
The parameter given in 'content' should match the title of the relevant capture block declared above.
165+
166+
```
167+
{% include cards-container-start.html %}
168+
{% include card.html content=card_content_1 title="This is the first title" %}
169+
{% include card.html content=card_content_2 title="This is the second title" %}
170+
{% include cards-container-end.html %}
171+
172+
```
173+
174+
175+
### Setting up a local testing environment
176+
Unless you set up a local testing environment, the only way to see what your changes will look like is to push them to main and have GitHub rebuild the live site. This obviously comes with inherent risks.
177+
178+
[Follow this guide](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll).
179+
180+
First, you will need to install Ruby. Then run `gem install bundler` to install the bundler gem. Getting this to work around permission restrictions can be difficult. You should get in touch with your IT department to support with this, and ChatGPT can also be your friend in understanding how to get around certain error messages!
181+
182+
Once you have managed to install Ruby and the Bundler gem, you should create a Gemfile and add it to your project (you can copy the example in the root of this project). Then run `bundler install` in your terminal. Make sure to run `bundler update github-pages` on a semi-regular basis, otherwise your local testing environment might look different to the published version.
183+
184+
To create the locally hosted site, navigate to the 'docs' folder in GitBash (for example, using `cd docs`), then run the following command: `bundler exec jekyll serve`. This will give a server address; navigate there to see your site.

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ruby Gemfile used for creating a local testing environment
2+
# See our [contributing instructions](https://github.com/ukhsa-collaboration/statistics-production-hub/blob/main/CONTRIBUTING.md) page for more guidance
3+
4+
source 'https://rubygems.org'
5+
6+
gem 'github-pages', group: :jekyll_plugins

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 UK Health Security Agency (UKHSA)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# UKHSA Statistics Production Hub
2-
This repository is being created by the Statistics Production Division in the UK Health Security Agency (UKHSA).
1+
## UKHSA Statistics Production Hub
32

4-
It will be used to host a number of guidance materials and other resources relating to the production and dissemination of statistics.
3+
This repository has been created by the Statistics Production Division in the UK Health Security Agency (UKHSA). It is used to host a number of guidance materials and other resources relating to the production and dissemination of statistics.
54

6-
Watch this space for updates!
5+
We have decided to open source these materials to better enable sharing across government (and beyond), and to invite others to share their insights with us.
6+
7+
If you would like to contribute to this repository or make suggestions for additions or improvement, please see our [contributing instructions](/CONTRIBUTING.md).
8+
9+
Contact: <UKHSA_HOPSTATS@ukhsa.gov.uk>

docs/_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: "This site contains guidance materials produced by the Statistics Production Division of UKHSA."
2+
email: "UKHSA_HOPSTATS@ukhsa.gov.uk"
3+
github: "https://github.com/ukhsa-collaboration/statistics-production-hub"

docs/_includes/card.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div class="card" {% if include.id %}id="{{ include.id }}"{% endif %}>
2+
<div class="card-top"><h4>{{ include.title }}</h4></div>
3+
<div class="card-bottom"><p>{{ include.content | markdownify }}</p></div>
4+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div class="cards-container">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div class="expandables-block">
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<button type="button" id="expanded-header-{{ include.number }}" aria-controls="expanded-content-{{ include.number }}" aria-expanded="false" class="expandable-header">
2+
<h5>{{ include.title }}</h5>
3+
</button>
4+
5+
<div id="expanded-content-{{ include.number }}" class="expandable-contents" aria-hidden="true">
6+
{{ include.content | markdownify }}
7+
</div>

docs/_includes/expandable-sections.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const expandables = document.getElementsByClassName("expandable-header");
2+
3+
const expand = function(){
4+
target = this.getAttribute('aria-controls');
5+
expanded = this.getAttribute('aria-expanded');
6+
7+
if(expanded == "true"){
8+
document.getElementById(target).setAttribute("aria-hidden", true);
9+
this.setAttribute("aria-expanded", false);
10+
} else if(expanded == "false"){
11+
document.getElementById(target).setAttribute("aria-hidden", false);
12+
this.setAttribute("aria-expanded", true);
13+
}
14+
}

docs/_includes/footer.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<div id="little-banner" style="margin-top: 35px"></div>
2+
3+
<div id="footer">
4+
5+
<div id="footer-container">
6+
7+
<p>Users are encouraged to apply the guidance on this site in a way that is appropriate for their teams and circumstances</p>
8+
9+
<p style="margin-bottom: 0;">If you have any feedback or suggestions for this site, please <a href="mailto:UKHSA_HOPSTATS@ukhsa.gov.uk?subject=Statistics Production Hub">email us</a> or <a href="https://github.com/ukhsa-collaboration/statistics-production-hub/blob/main/CONTRIBUTING.md">see our contributing instructions on GitHub</a></p>
10+
11+
<div id="copyright-block">
12+
<p><svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 483.2 195.7" height="17" width="41"><path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"></path></svg> All content is available under the <a href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/">Open Government Licence v3.0</a>, except where otherwise stated</p>
13+
14+
<p id="copyright-notice">&copy; {{ "now" | date: "%Y" }} Crown Copyright</p>
15+
</div>
16+
17+
</div>
18+
19+
</div>

docs/_includes/site-nav.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div id="site-nav">
2+
<a href="/statistics-production-hub/" style="display:inline-block;"><p>Go back to see other topics</p></a>
3+
4+
{% if page.page-group-title %}
5+
<p style="margin: 12px 10px 12px 0px; border-left: 1pt solid #ada8a8; display:inline-block;">&nbsp;</p>
6+
<p style="font-weight:bold">{{ page.page-group-title}} pages:</p>
7+
{% endif %}
8+
9+
{% if page.page1 %}
10+
<a href="{{ page.page1.url }}"><p>{{ page.page1.name }}</p></a>
11+
{% endif %}
12+
13+
{% if page.page2 %}
14+
<a href="{{ page.page2.url }}"><p>{{ page.page2.name }}</p></a>
15+
{% endif %}
16+
17+
{% if page.page3 %}
18+
<a href="{{ page.page3.url }}"><p>{{ page.page3.name }}</p></a>
19+
{% endif %}
20+
21+
</div>

docs/_includes/sources-text.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This page is based upon a range of sources from across government and beyond. For a reading list, please see the [sources](#sources) section towards the bottom of this page.

0 commit comments

Comments
 (0)