govuk_tech_docs 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/docs/configuration.md +18 -0
- data/example/config/tech-docs.yml +1 -0
- data/lib/assets/stylesheets/modules/_technical-documentation.scss +3 -12
- data/lib/govuk_tech_docs.rb +2 -2
- data/lib/govuk_tech_docs/contribution_banner.rb +5 -1
- data/lib/govuk_tech_docs/meta_tags.rb +1 -1
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/source/layouts/_header.erb +2 -2
- data/lib/source/layouts/core.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b9d4a186f0bd8cc5f21f4af532c4af40a8151ba
|
4
|
+
data.tar.gz: 5ca815110a5ffe5dcf14e51a230d47745f2c14b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c055c974e0b83cb30347a310ce3eeaaf646b5ab421fb1f8572d5b7edc1bb26f6051c21943966cb287ce68ec5a03ab754c915516ec3f818b1f38bbfd5d3fb957
|
7
|
+
data.tar.gz: c4a41a135993f461faddf1ef0f09513a0c7672f9e78213a0b34cc3ceec903fe47bb49b7572522041960b292fad553850c4f2d47528aa321691f50e953c58d4da
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.8.0
|
4
|
+
|
5
|
+
🎉 Our first contributor from outside of GDS. Thanks [@timja](https://github.com/timja) from [HMCTS](https://hmcts.github.io)! 🤝
|
6
|
+
|
7
|
+
New features: you can now configure a different GitHub branch for the repo to generate the "View source" link in the footer. Use `github_branch` in your config file (#71). You can also specify a `full_service_name` in the config, which is used in the browser title and meta tags (#72).
|
8
|
+
|
9
|
+
This version also fixes a bug with unclickable links (#74 - reported in [alphagov/tech-docs-template#123](https://github.com/alphagov/tech-docs-template/issues/123)).
|
10
|
+
|
3
11
|
## 1.7.0
|
4
12
|
|
5
13
|
New features: this release adds support for a full-width page (#63) and adding HTML to the `head` of the page (#64).
|
data/docs/configuration.md
CHANGED
@@ -20,6 +20,14 @@ Your repository. Required if [show_contribution_banner](#show-contribution-banne
|
|
20
20
|
github_repo: alphagov/example-repo
|
21
21
|
```
|
22
22
|
|
23
|
+
## `github_branch`
|
24
|
+
|
25
|
+
Your github branch name. Useful if your default branch is not named master.
|
26
|
+
|
27
|
+
```yaml
|
28
|
+
github_branch: source
|
29
|
+
```
|
30
|
+
|
23
31
|
## `google_site_verification`
|
24
32
|
|
25
33
|
Adds a [Google Site Verification code](https://support.google.com/webmasters/answer/35179?hl=en) to the meta tags.
|
@@ -116,6 +124,16 @@ Example:
|
|
116
124
|
service_name: "Platform as a Service"
|
117
125
|
```
|
118
126
|
|
127
|
+
## `full_service_name`
|
128
|
+
|
129
|
+
The full service name (maybe with GOV.UK)
|
130
|
+
|
131
|
+
Example:
|
132
|
+
|
133
|
+
```yaml
|
134
|
+
full_service_name: "GOV.UK Pay"
|
135
|
+
```
|
136
|
+
|
119
137
|
## `service_link`
|
120
138
|
|
121
139
|
What the service name in the header links to.
|
@@ -1,5 +1,8 @@
|
|
1
1
|
// Adds combination of margin and padding to headings to make them appear
|
2
2
|
// correctly when they're linked to as anchors, and scale them on mobile
|
3
|
+
// TODO: Headings are hidden underneath the sticky 'table of contents' on mobile
|
4
|
+
// when following a link to them
|
5
|
+
|
3
6
|
@mixin heading-offset($tabletTopMargin) {
|
4
7
|
// Scale margins with font size on mobile (16/19ths)
|
5
8
|
$mobileTopMargin: ceil($tabletTopMargin * (16 / 19));
|
@@ -7,18 +10,6 @@
|
|
7
10
|
padding-top: min($mobileTopMargin, $gutter-half);
|
8
11
|
margin-top: max(0, $mobileTopMargin - $gutter-half);
|
9
12
|
|
10
|
-
// Offset headings down on mobile so that linking to anchors they appear after
|
11
|
-
// the sticky 'table of contents' element
|
12
|
-
$stickyTocOffset: 20px + $gutter-half + 10px + 1px;
|
13
|
-
|
14
|
-
// Pad the heading so that when linking to an anchor there is at most a
|
15
|
-
// $gutter-half (mobile) or $gutter (tablet and above) sized gap between the
|
16
|
-
// top of the viewport and the heading.
|
17
|
-
.has-sidebar & {
|
18
|
-
padding-top: min($mobileTopMargin, $gutter-half) + $stickyTocOffset;
|
19
|
-
margin-top: max(0, $mobileTopMargin - $gutter-half) - $stickyTocOffset;
|
20
|
-
}
|
21
|
-
|
22
13
|
@include media(tablet) {
|
23
14
|
padding-top: min($tabletTopMargin, $gutter);
|
24
15
|
margin-top: max(0, $tabletTopMargin - $gutter);
|
data/lib/govuk_tech_docs.rb
CHANGED
@@ -52,8 +52,8 @@ module GovukTechDocs
|
|
52
52
|
|
53
53
|
context.configure :build do
|
54
54
|
activate :autoprefixer
|
55
|
-
activate :minify_css
|
56
|
-
activate :minify_javascript
|
55
|
+
activate :minify_css, ignore: ['/raw_assets/*']
|
56
|
+
activate :minify_javascript, ignore: ['/raw_assets/*']
|
57
57
|
end
|
58
58
|
|
59
59
|
context.config[:tech_docs] = YAML.load_file('config/tech-docs.yml').with_indifferent_access
|
@@ -26,6 +26,10 @@ module GovukTechDocs
|
|
26
26
|
"https://github.com/#{config[:tech_docs][:github_repo]}"
|
27
27
|
end
|
28
28
|
|
29
|
+
def repo_branch
|
30
|
+
config[:tech_docs][:github_branch] || 'master'
|
31
|
+
end
|
32
|
+
|
29
33
|
private
|
30
34
|
|
31
35
|
# If a `page` local exists, see if it has a `source_url`. This is used by the
|
@@ -42,7 +46,7 @@ module GovukTechDocs
|
|
42
46
|
|
43
47
|
# As the last fallback link to the source file in this repository.
|
44
48
|
def source_from_file
|
45
|
-
"#{repo_url}/blob/
|
49
|
+
"#{repo_url}/blob/#{repo_branch}/source/#{current_page.file_descriptor[:relative_path]}"
|
46
50
|
end
|
47
51
|
|
48
52
|
def locals
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="header__container">
|
3
3
|
<div class="header__brand">
|
4
4
|
<% if config[:tech_docs][:service_link] %>
|
5
|
-
<a href="<%= config[:tech_docs][:service_link] %>">
|
5
|
+
<a href="<%= url_for config[:tech_docs][:service_link] %>">
|
6
6
|
<% else %>
|
7
7
|
<span>
|
8
8
|
<% end %>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<ul>
|
34
34
|
<% config[:tech_docs][:header_links].each do |title, path| %>
|
35
35
|
<li<% if active_page(path) %> class="active"<% end %>>
|
36
|
-
<a href="<%= path %>"><%= title %></a>
|
36
|
+
<a href="<%= url_for path %>"><%= title %></a>
|
37
37
|
</li>
|
38
38
|
<% end %>
|
39
39
|
</ul>
|
data/lib/source/layouts/core.erb
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
<%= yield_content :head %>
|
30
30
|
</head>
|
31
31
|
|
32
|
-
<body
|
32
|
+
<body>
|
33
33
|
<div class="app-pane">
|
34
34
|
<div class="app-pane__header toc-open-disabled">
|
35
35
|
<a href="#content" class="skip-link">Skip to main content</a>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_tech_docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|