govuk_tech_docs 1.6.3 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +11 -0
- data/CHANGELOG.md +5 -1
- data/README.md +1 -3
- data/docs/core-layout-without-sidebar.png +0 -0
- data/docs/frontmatter.md +23 -0
- data/example/source/core-layout-without-sidebar.html.md.erb +7 -0
- data/example/source/core-layout.html.md.erb +1 -1
- data/lib/assets/javascripts/_modules/in-page-navigation.js +5 -1
- data/lib/assets/stylesheets/modules/_technical-documentation.scss +7 -2
- data/lib/govuk_tech_docs/pages.rb +1 -1
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/source/layouts/core.erb +20 -14
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91db307ff64061428101567559e520a7569e08d6
|
4
|
+
data.tar.gz: eb45e58f2e33c2ec079e9e0a8e430b511a2f9670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95cffa6f1db00a76baaa405be058d259920ad2a405867be77351e9960e8a2a23dc656a74c5881f5400c9e136ce2e5bed50dfa6fe27a767712a2f8792a1e50816
|
7
|
+
data.tar.gz: 42f5bcb4c5273f29072b1b5f85794852d75224d7ac3f580bdbd729ff94cf7d4ec984bfb17dfd38c9835ab1611810aed7f84ecedcae492e2fb16deceae13b2520
|
data/.travis.yml
CHANGED
@@ -3,3 +3,14 @@ rvm:
|
|
3
3
|
- 2.4.2
|
4
4
|
script:
|
5
5
|
- bundle exec rake
|
6
|
+
before_install:
|
7
|
+
- rvm @global do gem uninstall bundler -a -x
|
8
|
+
- rvm @global do gem install bundler -v 1.17.3
|
9
|
+
deploy:
|
10
|
+
provider: rubygems
|
11
|
+
gem: govuk_tech_docs
|
12
|
+
api_key:
|
13
|
+
secure: CY9C+IUqUeYWqXSyQgfF5swdYw1rRtYi0ai1xasD3R5rwARF6Qr8CnmdSBjfT2S84fXQiMza45Jto4w1jiy3o4wpxuKN68xEB7J4W/YEpFcZectzsmXwcMJH+DXh720KFIX2xiHaG5N0nWzAoV+6zgw6Vq24IXYE33wO6BgCmTe3vtO+Apg0+wDRAOuJ4T5XfSyWUvG8JqLRb81t+WbrsOLcUgZn24DHvs+lrjXTDDTzrgwTuKeaKd+h+mfxlHZD+Xxbcy624qop5ICwOOP0koRXCdVmTOSZ4mNI10+loCyA1B5Tryj/2wweyc8CanqRMniF8p/BxLV1sAwihpCmCpuWUyxq2pTPSgjF1A1f5hXwkAT/HiaXLzXKyO1REnbtLHYvre10EIYIII4nDAtCZP0YLYvPoKQUrAydeWiQ4jL+cyEeN/8Dznx2OPrhcwxazsElMm0yOZDNXERNIf3IVnQshxMFxQfGW3NTG8XR4l5PHAI2XqKy/O/VGbiRcNV3EYVG5w/KumB698BGDGV2QPOlh3JOEkebXTGDsMJj/gzZik2BtvAqYatwgx7oiYzvhEPz0m9o/DTS7Gf/5Hkj3iV2mpcNtRMc0HKmS7bwkv8Cl6dWECt7PWQ8Kz5ttrCKRmTCJDgra2xLFuV8kbBISPkKKv87KCXzxthM8ps94WE=
|
14
|
+
on:
|
15
|
+
repo: alphagov/tech-docs-gem
|
16
|
+
branch: master
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## 1.7.0
|
4
|
+
|
5
|
+
New features: this release adds support for a full-width page (#63) and adding HTML to the `head` of the page (#64).
|
6
|
+
|
7
|
+
This release also makes sure that all pages are returned in the `/api/pages.json` endpoint (#66).
|
4
8
|
|
5
9
|
## 1.6.3
|
6
10
|
|
data/README.md
CHANGED
@@ -48,11 +48,9 @@ Or, on the command line, run `bundle exec rake jasmine:ci`.
|
|
48
48
|
|
49
49
|
## Releasing new versions
|
50
50
|
|
51
|
-
At the moment this gem has to be released manually. There's a [story on the Reliability Engineering backlog](https://trello.com/c/gRQ8OnBl) to automate this.
|
52
|
-
|
53
51
|
To release a new version, create a new Pull Request that updates [version.rb](lib/govuk_tech_docs/version.rb) and [CHANGELOG.md](CHANGELOG.md). Don't mix this in with other changes - this makes it easier to find out what was released when. See [this PR to release a new version as an example](https://github.com/alphagov/tech-docs-gem/pull/15).
|
54
52
|
|
55
|
-
[
|
53
|
+
Travis will automatically release a [new version to Rubygems.org](https://rubygems.org/gems/govuk_tech_docs).
|
56
54
|
|
57
55
|
## License
|
58
56
|
|
Binary file
|
data/docs/frontmatter.md
CHANGED
@@ -65,6 +65,18 @@ This page has a configurable sidebar that is independent of the content.
|
|
65
65
|
|
66
66
|

|
67
67
|
|
68
|
+
If you do not specify a sidebar, you will get a simple one-column layout without one.
|
69
|
+
|
70
|
+
```rb
|
71
|
+
---
|
72
|
+
layout: core
|
73
|
+
---
|
74
|
+
|
75
|
+
This page does not have a sidebar.
|
76
|
+
```
|
77
|
+
|
78
|
+

|
79
|
+
|
68
80
|
## `old_paths`
|
69
81
|
|
70
82
|
Any paths of pages that should redirect to this page.
|
@@ -88,6 +100,17 @@ owner_slack: "#operations-teams"
|
|
88
100
|
---
|
89
101
|
```
|
90
102
|
|
103
|
+
## `source_url`
|
104
|
+
|
105
|
+
If the contribution banner is turned on, you can override the "View source" link
|
106
|
+
using `source_url`.
|
107
|
+
|
108
|
+
Example:
|
109
|
+
|
110
|
+
```yaml
|
111
|
+
source_url: http://example.org/source.md
|
112
|
+
```
|
113
|
+
|
91
114
|
## `title`
|
92
115
|
|
93
116
|
The browser title of the page.
|
@@ -70,7 +70,11 @@
|
|
70
70
|
}
|
71
71
|
|
72
72
|
function highlightActiveItemInToc(fragment) {
|
73
|
-
|
73
|
+
// Navigation items for single page navigation don't necessarily include the path name, but
|
74
|
+
// navigation items for multipage navigation items do include it. This checks for either case.
|
75
|
+
var $activeTocItem = $tocItems.filter(
|
76
|
+
'[href="' + window.location.pathname + fragment + '"],[href="' + fragment + '"]'
|
77
|
+
);
|
74
78
|
// Navigation items with children don't contain fragments in their url
|
75
79
|
// Check to see if any nav items contain just the path name.
|
76
80
|
if(!$activeTocItem.get(0)) {
|
@@ -4,6 +4,9 @@
|
|
4
4
|
// Scale margins with font size on mobile (16/19ths)
|
5
5
|
$mobileTopMargin: ceil($tabletTopMargin * (16 / 19));
|
6
6
|
|
7
|
+
padding-top: min($mobileTopMargin, $gutter-half);
|
8
|
+
margin-top: max(0, $mobileTopMargin - $gutter-half);
|
9
|
+
|
7
10
|
// Offset headings down on mobile so that linking to anchors they appear after
|
8
11
|
// the sticky 'table of contents' element
|
9
12
|
$stickyTocOffset: 20px + $gutter-half + 10px + 1px;
|
@@ -11,8 +14,10 @@
|
|
11
14
|
// Pad the heading so that when linking to an anchor there is at most a
|
12
15
|
// $gutter-half (mobile) or $gutter (tablet and above) sized gap between the
|
13
16
|
// top of the viewport and the heading.
|
14
|
-
|
15
|
-
|
17
|
+
.has-sidebar & {
|
18
|
+
padding-top: min($mobileTopMargin, $gutter-half) + $stickyTocOffset;
|
19
|
+
margin-top: max(0, $mobileTopMargin - $gutter-half) - $stickyTocOffset;
|
20
|
+
}
|
16
21
|
|
17
22
|
@include media(tablet) {
|
18
23
|
padding-top: min($tabletTopMargin, $gutter);
|
data/lib/source/layouts/core.erb
CHANGED
@@ -25,9 +25,11 @@
|
|
25
25
|
<% meta_tags.tags.each do |property, content| %>
|
26
26
|
<%= tag :meta, property: property, content: content %>
|
27
27
|
<% end %>
|
28
|
+
|
29
|
+
<%= yield_content :head %>
|
28
30
|
</head>
|
29
31
|
|
30
|
-
<body
|
32
|
+
<body <%= 'class="has-sidebar"' if content_for? :sidebar %>>
|
31
33
|
<div class="app-pane">
|
32
34
|
<div class="app-pane__header toc-open-disabled">
|
33
35
|
<a href="#content" class="skip-link">Skip to main content</a>
|
@@ -35,22 +37,26 @@
|
|
35
37
|
<%= partial 'layouts/header' %>
|
36
38
|
</div>
|
37
39
|
|
38
|
-
|
39
|
-
<
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
<% if content_for? :sidebar %>
|
41
|
+
<div id="toc-heading" class="toc-show fixedsticky">
|
42
|
+
<a href="#toc" class="toc-show__label js-toc-show" aria-controls="toc">
|
43
|
+
Table of contents <span class="toc-show__icon"></span>
|
44
|
+
</a>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
43
47
|
|
44
48
|
<div class="app-pane__body"<%= " data-module=\"#{yield_content(:toc_module)}\"" if content_for? :toc_module %>>
|
45
|
-
|
46
|
-
<div class="
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
<%=
|
51
|
-
|
49
|
+
<% if content_for? :sidebar %>
|
50
|
+
<div class="app-pane__toc">
|
51
|
+
<div class="toc" data-module="table-of-contents">
|
52
|
+
<%= partial "layouts/search" %>
|
53
|
+
<a href="#" class="toc__close js-toc-close" aria-controls="toc" aria-label="Hide table of contents"></a>
|
54
|
+
<nav id="toc" class="js-toc-list toc__list" aria-labelledby="toc-heading"<%= " data-module=\"collapsible-navigation\"" if config[:tech_docs][:collapsible_nav] %>>
|
55
|
+
<%= yield_content :sidebar %>
|
56
|
+
</nav>
|
57
|
+
</div>
|
52
58
|
</div>
|
53
|
-
|
59
|
+
<% end %>
|
54
60
|
|
55
61
|
<div class="app-pane__content toc-open-disabled">
|
56
62
|
<main id="content" class="technical-documentation" data-module="anchored-headings">
|
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.7.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:
|
11
|
+
date: 2019-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -311,6 +311,7 @@ files:
|
|
311
311
|
- README.md
|
312
312
|
- Rakefile
|
313
313
|
- docs/configuration.md
|
314
|
+
- docs/core-layout-without-sidebar.png
|
314
315
|
- docs/core-layout.png
|
315
316
|
- docs/expired-page.png
|
316
317
|
- docs/frontmatter.md
|
@@ -324,6 +325,7 @@ files:
|
|
324
325
|
- example/source/api-path.html.md
|
325
326
|
- example/source/api-reference.html.md
|
326
327
|
- example/source/child-of-expired-page.html.md
|
328
|
+
- example/source/core-layout-without-sidebar.html.md.erb
|
327
329
|
- example/source/core-layout.html.md.erb
|
328
330
|
- example/source/expired-page-with-owner.html.md
|
329
331
|
- example/source/expired-page.html.md
|
@@ -459,7 +461,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
459
461
|
version: '0'
|
460
462
|
requirements: []
|
461
463
|
rubyforge_project:
|
462
|
-
rubygems_version: 2.6.
|
464
|
+
rubygems_version: 2.6.14
|
463
465
|
signing_key:
|
464
466
|
specification_version: 4
|
465
467
|
summary: Gem to distribute the GOV.UK Tech Docs Template
|