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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91db307ff64061428101567559e520a7569e08d6
4
- data.tar.gz: eb45e58f2e33c2ec079e9e0a8e430b511a2f9670
3
+ metadata.gz: 8b9d4a186f0bd8cc5f21f4af532c4af40a8151ba
4
+ data.tar.gz: 5ca815110a5ffe5dcf14e51a230d47745f2c14b2
5
5
  SHA512:
6
- metadata.gz: 95cffa6f1db00a76baaa405be058d259920ad2a405867be77351e9960e8a2a23dc656a74c5881f5400c9e136ce2e5bed50dfa6fe27a767712a2f8792a1e50816
7
- data.tar.gz: 42f5bcb4c5273f29072b1b5f85794852d75224d7ac3f580bdbd729ff94cf7d4ec984bfb17dfd38c9835ab1611810aed7f84ecedcae492e2fb16deceae13b2520
6
+ metadata.gz: 8c055c974e0b83cb30347a310ce3eeaaf646b5ab421fb1f8572d5b7edc1bb26f6051c21943966cb287ce68ec5a03ab754c915516ec3f818b1f38bbfd5d3fb957
7
+ data.tar.gz: c4a41a135993f461faddf1ef0f09513a0c7672f9e78213a0b34cc3ceec903fe47bb49b7572522041960b292fad553850c4f2d47528aa321691f50e953c58d4da
@@ -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).
@@ -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.
@@ -38,6 +38,7 @@ enable_search: true
38
38
  show_contribution_banner: true
39
39
 
40
40
  github_repo: alphagov/example-repo
41
+ github_branch: source
41
42
 
42
43
  redirects:
43
44
  /something/old.html: /index.html
@@ -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);
@@ -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/master/source/#{current_page.file_descriptor[:relative_path]}"
49
+ "#{repo_url}/blob/#{repo_branch}/source/#{current_page.file_descriptor[:relative_path]}"
46
50
  end
47
51
 
48
52
  def locals
@@ -41,7 +41,7 @@ module GovukTechDocs
41
41
  end
42
42
 
43
43
  def site_name
44
- config[:tech_docs][:service_name]
44
+ config[:tech_docs][:full_service_name] || config[:tech_docs][:service_name]
45
45
  end
46
46
 
47
47
  def page_description
@@ -1,3 +1,3 @@
1
1
  module GovukTechDocs
2
- VERSION = "1.7.0".freeze
2
+ VERSION = "1.8.0".freeze
3
3
  end
@@ -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>
@@ -29,7 +29,7 @@
29
29
  <%= yield_content :head %>
30
30
  </head>
31
31
 
32
- <body <%= 'class="has-sidebar"' if content_for? :sidebar %>>
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.7.0
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-01-17 00:00:00.000000000 Z
11
+ date: 2019-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport