Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/upstream #60

Merged
merged 279 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
279 commits
Select commit Hold shift + click to select a range
3a7d640
Remove ƒ typo in fieldset example
christopherthomasdesign Apr 13, 2022
0d75a84
Merge pull request #2136 from alphagov/remove-typo
christopherthomasdesign Apr 13, 2022
50703c7
Fix autocomplete values in multiple address example
christopherthomasdesign Apr 13, 2022
9999f5c
Add latest blog posts April 2022
calvin-lau-sig7 Apr 13, 2022
66f5688
Fix dashes and punctuation
calvin-lau-sig7 Apr 13, 2022
6065bf6
update image to make it neater on the check a service is suitable pat…
Ciandelle Apr 14, 2022
9b20828
update image to make it neater on the check a service is suitable pat…
Ciandelle Apr 14, 2022
9a9e4dd
Merge pull request #2133 from alphagov/check-a-service-is-suitable-pa…
Ciandelle Apr 14, 2022
8cd4e3b
Add latest blog posts April 2022
calvin-lau-sig7 Apr 14, 2022
0f3b5ab
Merge pull request #2129 from alphagov/dependabot/npm_and_yarn/moment…
domoscargin Apr 14, 2022
a823ecb
Update Node to Active LTS version v16 (Gallium)
domoscargin Mar 16, 2022
c30b9db
Add troubleshooting documentation for Node 16, node-sass and M1 machines
domoscargin Apr 20, 2022
2756ad7
Merge pull request #2110 from alphagov/bk-update-node-lts
domoscargin Apr 25, 2022
91e97fa
Update metalsmith to latest version (2.4.2)
Apr 22, 2022
06a3370
Install @metalsmith/sass
Apr 22, 2022
6b76274
Uninstall metalsmith-sass and node-sass
Apr 22, 2022
7b8b2f9
Set `quietDeps` to true and move config to @metalsmith/sass syntax
Apr 22, 2022
9692772
Add 'src/stylesheets' to sass loadPaths
Apr 22, 2022
901dc56
Merge pull request #2150 from alphagov/move-to-dartsass
Apr 25, 2022
fb75f72
Remove node-sass on node v16 troubleshooting docs
domoscargin Apr 25, 2022
84983e2
Merge pull request #2154 from alphagov/bk-remove-outdated-docs
domoscargin Apr 25, 2022
f243817
Update link text in examples
frankieroberto Apr 27, 2022
1b08adf
Add new team member
ameliaphil Apr 27, 2022
d417ab3
Make help text advice clearer in fieldset guidance
EoinShaughnessy Apr 20, 2022
2ec77da
Merge pull request #2159 from alphagov/ameliaphil-patch-1
ameliaphil Apr 27, 2022
708cf71
Add placeholder text info to text input guidance
EoinShaughnessy Apr 25, 2022
cdbfd18
Revert town or city field to use address-level2
christopherthomasdesign Apr 28, 2022
78d287c
Explain issues with client side validation
EoinShaughnessy Apr 28, 2022
3cf3f69
Merge pull request #2137 from alphagov/update-address-pattern
christopherthomasdesign Apr 28, 2022
f471d25
Merge pull request #2152 from alphagov/expand-placeholder-content-tex…
EoinShaughnessy Apr 28, 2022
072d377
Add implementation advice to skip link guidance
EoinShaughnessy Apr 27, 2022
8b8b45e
Merge pull request #2158 from alphagov/update-skip-link
EoinShaughnessy Apr 28, 2022
6170068
Add subheadings to text input guidance
EoinShaughnessy May 3, 2022
81a0f10
Replace double quotes with singles in example
EoinShaughnessy May 5, 2022
532e25b
Updating error example for National Insurance number to use correct f…
htmlandbacon May 5, 2022
074460f
Merge pull request #2171 from alphagov/iterate-text-input
calvin-lau-sig7 May 6, 2022
7a48ab5
Merge pull request #2145 from alphagov/update-fieldset-guidance
calvin-lau-sig7 May 6, 2022
bab2b9f
Merge pull request #2174 from alphagov/update-checkboxes-example
calvin-lau-sig7 May 6, 2022
efcb986
Merge pull request #2175 from htmlandbacon/feature/nino-update
calvin-lau-sig7 May 6, 2022
527132c
adding format guidance for National Insurance number
htmlandbacon May 6, 2022
ca1fc7c
Update design-system-team.md.njk
ruthhammond May 9, 2022
1822a90
Update src/design-system-team.md.njk
ruthhammond May 9, 2022
e73d102
Update src/patterns/national-insurance-numbers/index.md.njk
htmlandbacon May 9, 2022
9fc1f37
Merge pull request #2177 from alphagov/ruthhammond-patch-1
ruthhammond May 9, 2022
f8a2c96
Merge pull request #2176 from htmlandbacon/docs/nino-update-part-2
calvin-lau-sig7 May 10, 2022
a9db159
Move #top anchor to before the skip link
36degrees Apr 28, 2022
0fdff8a
Make layout name consistent throughout guidance
EoinShaughnessy May 10, 2022
ffc2a13
Merge pull request #2160 from alphagov/update-validation-pattern
EoinShaughnessy May 11, 2022
d0b5259
Merge pull request #2180 from alphagov/make-layout-term-consistent
EoinShaughnessy May 11, 2022
5053711
Update guidance on footer component
StephenGill May 11, 2022
4904105
Update character count guidance to match new implementation
calvin-lau-sig7 May 11, 2022
b92ef45
Minor edits for consistency
calvin-lau-sig7 May 16, 2022
6ff61ed
Clarify and add accessibility information
calvin-lau-sig7 May 16, 2022
771cd81
Update What's New section for v4.1.0
May 16, 2022
5b2bafd
Update roadmap
May 16, 2022
58e99ff
Add context to JAWS issue
calvin-lau-sig7 May 17, 2022
873a5fc
Bump govuk-frontend to 4.1.0
domoscargin May 18, 2022
e5d41d2
Merge pull request #2192 from alphagov/bk-update-to-govuk-frontend-4.1.0
domoscargin May 18, 2022
f5a7be2
Merge pull request #2181 from alphagov/calvin-lau-sig7-char-count-gui…
domoscargin May 18, 2022
0fb4102
Add nodeListForEach helper directly into design system
Apr 21, 2022
48fc4d0
Replace individual JS imports with ES modules initAll
Apr 21, 2022
a67e3c6
Merge pull request #2146 from alphagov/use-esm
36degrees May 18, 2022
d76304a
Merge pull request #2185 from alphagov/update-v4.1.0
EoinShaughnessy May 18, 2022
316bc7f
Explain that red border depends on exceeding limit
EoinShaughnessy May 17, 2022
24f823a
Add accurate content for email field char limit
EoinShaughnessy May 18, 2022
022d59b
Merge pull request #2188 from alphagov/update-char-count-about-red-bo…
EoinShaughnessy May 18, 2022
051815f
Merge pull request #2191 from alphagov/update-email-addresses-content
EoinShaughnessy May 18, 2022
0891857
Replace in guidance and examples
calvin-lau-sig7 May 18, 2022
637a7e5
Merge pull request #2193 from alphagov/calvin-lau-sig7-fewer-less
calvin-lau-sig7 May 18, 2022
f96323a
Merge pull request #2161 from alphagov/move-top-anchor
36degrees May 19, 2022
826c229
Merge pull request #2182 from StephenGill/patch-3
EoinShaughnessy May 19, 2022
aadf80a
Bump actions/setup-node from v2 to v3
lfdebrux May 20, 2022
a8916f9
Use node-version-file input to specify node version
lfdebrux May 20, 2022
5071082
Merge pull request #2200 from alphagov/ldeb-use-setup-node-node-versi…
lfdebrux May 20, 2022
4dc4eb8
Make validation guidance language more consistent
EoinShaughnessy May 12, 2022
9dcbcae
Merge pull request #2184 from alphagov/improve-validation-wording
EoinShaughnessy May 23, 2022
0642b7f
Add info on default components in page template
EoinShaughnessy May 4, 2022
2a71c18
Change contact panel headings to reflect the kind of page they're on
christopherthomasdesign May 24, 2022
fb94d0c
Merge pull request #2202 from alphagov/contact-panel-headings
christopherthomasdesign May 26, 2022
4cde88b
Merge pull request #2157 from frankieroberto/update-link-examples
EoinShaughnessy May 26, 2022
5db8961
Make link text in example reflect guidance
EoinShaughnessy May 26, 2022
7b76f3b
Reorder link text
EoinShaughnessy May 26, 2022
9937f8a
Update team page on Design System site
EoinShaughnessy May 30, 2022
a382f69
Merge pull request #2206 from alphagov/update-team-page-community-tab
domoscargin May 31, 2022
ddc10fb
Update cookie hide button to be more descriptive
May 31, 2022
7021e0d
Merge pull request #2207 from alphagov/cookie-hide-button-text
May 31, 2022
bb47ce1
Merge pull request #2204 from alphagov/update-link-text-typography-ex…
calvin-lau-sig7 Jun 1, 2022
e01cebf
Merge pull request #2173 from alphagov/iterate-pagetemplate-skiplink-…
calvin-lau-sig7 Jun 7, 2022
5543d85
Add Claire to team page
calvin-lau-sig7 Jun 8, 2022
d5e3d9b
Fix em-dash
calvin-lau-sig7 Jun 8, 2022
86ddf92
Merge pull request #2210 from alphagov/calvin-lau-sig7-add-claire-team
calvin-lau-sig7 Jun 8, 2022
439513b
Remove last line about performance platform
claireashworth Jun 10, 2022
398b600
Merge pull request #2212 from alphagov/minor-update-line-removal
claireashworth Jun 15, 2022
b0d48cc
add a hint to the select to help users understand the options
Ciandelle Jun 9, 2022
d437597
Merge pull request #2211 from alphagov/select-with-hint
Ciandelle Jun 20, 2022
5da9e97
Bump govuk-frontend to v4.2.0
domoscargin Jun 27, 2022
270ec00
Merge pull request #2230 from alphagov/use-govuk-frontend-4.2.0
36degrees Jun 27, 2022
91a5a86
Add guidance for pagination component
36degrees Jun 27, 2022
ce9f50a
Remove pagination component from community backlog
owenatgov May 19, 2022
494152c
Merge pull request #1972 from alphagov/add-pagination
domoscargin Jun 27, 2022
ef4c663
Update what's new and roadmap for 4.2.0
36degrees Jun 27, 2022
1a071c4
Merge pull request #2227 from alphagov/update-v4.2.0
domoscargin Jun 27, 2022
5119306
Update roadmap
domoscargin Jun 27, 2022
803affd
Fixed typo on pagination documentation
robertdeniszczyc2 Jun 29, 2022
e5f8ed1
Merge pull request #2235 from robertdeniszczyc2/patch-1
36degrees Jun 29, 2022
89a62c3
Add paragraph tag to link example
querkmachine Jul 1, 2022
decd98c
Merge pull request #2237 from alphagov/add-paragraph-link-example
querkmachine Jul 1, 2022
7cb9eca
Indent Nunjucks code
querkmachine Jul 11, 2022
c7dbb1f
Refactor design system tabs JS
querkmachine Jul 11, 2022
8b53583
Fix tab not being opened when macro options are linked to
querkmachine Jul 11, 2022
4d49077
Update test ID and result checks
querkmachine Jul 12, 2022
a23fc1f
Check for existence of tabs
querkmachine Jul 12, 2022
58e1aa1
Merge pull request #2231 from alphagov/bk-update-roadmap
domoscargin Jul 12, 2022
6aec32b
Update team member
NoraGDS Jul 13, 2022
2906387
Remove govuk-react-jsx which is no longer supported
andymantell Jul 15, 2022
1c9f1c3
Merge pull request #2245 from alphagov/team-update
NoraGDS Jul 15, 2022
c59b3cf
Merge pull request #2247 from andymantell/patch-1
domoscargin Jul 18, 2022
a443f7d
Bump terser from 5.7.0 to 5.14.2
dependabot[bot] Jul 20, 2022
d223d1e
Merge pull request #2253 from alphagov/dependabot/npm_and_yarn/terser…
domoscargin Jul 20, 2022
362f1da
Bump moment from 2.29.2 to 2.29.4
dependabot[bot] Jul 20, 2022
7fbafde
Merge pull request #2254 from alphagov/dependabot/npm_and_yarn/moment…
Jul 20, 2022
a74649a
Apply `this` binding changes from code review
querkmachine Jul 20, 2022
5ddacc5
Refactor getDesktopTab to not use a loop
querkmachine Jul 20, 2022
72f24b3
Merge pull request #2242 from alphagov/kg-refactor-tabs
querkmachine Jul 20, 2022
8d7140c
Bump metalsmith to 2.5.0
domoscargin Jul 21, 2022
0322874
Merge pull request #2259 from alphagov/bk-bump-metalsmith
domoscargin Jul 21, 2022
ff41846
Remove ‘mainstream’ from images guidance
36degrees Jul 19, 2022
ee324be
Use the official core metalsmith postcss plugin
domoscargin Jul 21, 2022
354a885
Merge pull request #2252 from alphagov/images-guidance-mainstream
36degrees Jul 21, 2022
9742dd5
Only toggle details aria attributes if already set
36degrees Jul 21, 2022
e468190
Merge pull request #2258 from alphagov/bk-bump-metalsmith-postcss
domoscargin Jul 21, 2022
c5a7687
Bump metalsmith-env to 2.2.0
domoscargin Jul 21, 2022
5ca3092
Use @metalsmith/in-place in favour of metalsmith-in-place
domoscargin Jul 21, 2022
8c950cf
Use @metalsmith/layouts in favour of metalsmith-layouts
domoscargin Jul 21, 2022
0e70e92
Use @metalsmith/permalinks in favour of metalsmith-permalinks
domoscargin Jul 21, 2022
f4557ef
Bump metalsmith-uglify to v2.4.1
domoscargin Jul 21, 2022
11e400c
Bump @metalsmith/sass from 1.0.0 to 1.0.1
domoscargin Jul 21, 2022
6e8d7c9
Merge pull request #2261 from alphagov/options-table-aria
36degrees Jul 22, 2022
d1dd267
Adjust link text to GOV.UK image guidance
calvin-lau-sig7 Jul 22, 2022
139bd2c
Allow start buttons to be forms
thomasleese Jul 1, 2022
d325a62
Merge pull request #2238 from thomasleese/start-button-form
calvin-lau-sig7 Jul 25, 2022
4247c5a
Update link to task list Sass file
querkmachine Jul 25, 2022
5990718
Merge pull request #2267 from alphagov/kg-task-list-link-update
querkmachine Jul 25, 2022
527dbab
Override auto-linking with period character
calvin-lau-sig7 Jul 25, 2022
4358e92
Merge pull request #2266 from alphagov/calvin-lau-sig7-adjust-image-link
calvin-lau-sig7 Jul 25, 2022
78f87b5
Move width override classes from spacing to layout
36degrees Jul 25, 2022
a006ac9
Tweak width override guidance for new context
36degrees Jul 25, 2022
f02cc20
Update links to width override classes
36degrees Jul 25, 2022
8651e57
Remove link to archived ethnic groups pattern
36degrees Jul 25, 2022
51305ab
Remove broken link in page template guidance
36degrees Jul 25, 2022
4f8658c
Merge pull request #2268 from alphagov/move-width-override-docs
36degrees Jul 25, 2022
95cd2ec
Merge pull request #2269 from alphagov/error-message-ethnic-groups-br…
36degrees Jul 26, 2022
6d7d3c7
Remove redundant classes
36degrees Jul 26, 2022
60a0409
Remove extra closing `</tr>` tag
36degrees Jul 26, 2022
0efa3f1
Swap small and large screen sizes in spacing table
36degrees Jul 26, 2022
31991a7
Flip order of spacing scale in table
36degrees Jul 26, 2022
f532186
Fix mismatched heading tags in navigation
36degrees Jul 26, 2022
f8c70d2
Document the static spacing scale
36degrees Jul 27, 2022
925a019
Improve headings for override classes and helpers
36degrees Jul 27, 2022
4842172
Move section on overrides last
36degrees Jul 27, 2022
66a3bce
Update link to my talk for more accessible blog
NickColley Jul 27, 2022
fc01f0c
Tweaks to guidance on helpers
36degrees Jul 27, 2022
ba65418
Tweaks to guidance on override classes
36degrees Jul 27, 2022
c6583ee
Merge pull request #2275 from alphagov/nav-mismatched-heading-tags
36degrees Jul 27, 2022
867a531
Merge pull request #2263 from alphagov/bk-bump-metalsmith-deps
domoscargin Jul 27, 2022
55ef0c2
Bump autoprefixer to 10.4.7
domoscargin Jul 21, 2022
2ff2137
Merge pull request #2264 from alphagov/bk-bump-autoprefixer
domoscargin Jul 27, 2022
9906f49
Merge pull request #2270 from alphagov/page-template-blocks-link
36degrees Jul 27, 2022
8481e0d
Replace sass-lint with stylelint
domoscargin Jul 27, 2022
959db5c
Add basic stylelint config
domoscargin Jul 27, 2022
20fb8b8
Fix SCSS linting errors
domoscargin Jul 21, 2022
438776e
Update documentation
domoscargin Jul 21, 2022
400cd62
Merge pull request #2265 from alphagov/bk-sass-lint-to-stylelint
domoscargin Jul 27, 2022
d33e4d5
Replace metalsmith-tagcleaner with a custom marked renderer
domoscargin Jul 22, 2022
2100ebd
Bump marked and jstransformer packages
domoscargin Jul 27, 2022
022cd5e
Merge pull request #2278 from nickcolley/patch-1
domoscargin Jul 28, 2022
2a36303
Merge pull request #2274 from alphagov/spacing-table-tweaks
36degrees Jul 28, 2022
d38e5dc
Apply suggestions from code review
36degrees Jul 29, 2022
4909b71
Merge pull request #2279 from alphagov/static-spacing-guidance
36degrees Jul 29, 2022
cc2a724
Update logo in header to match GOV.UK Frontend
36degrees Jul 29, 2022
c2fcbc6
Document static spacing override classes
36degrees Jul 29, 2022
3ab1e73
Change to more up to date link
edwardhorsford Jul 29, 2022
9d7fbf7
Remove examples for archived ethnic groups pattern
36degrees Aug 1, 2022
eb58287
Use subclass for marked renderer
domoscargin Aug 1, 2022
34867d4
Merge pull request #2283 from alphagov/header-changes
36degrees Aug 1, 2022
c223dd0
Merge pull request #2286 from alphagov/ethnic-group-examples
36degrees Aug 1, 2022
78989ed
Merge pull request #2276 from alphagov/bk-spike-tagcleaner-replacement
domoscargin Aug 1, 2022
56c50ae
Fix markdown lists on pagination component page
peteryates Aug 1, 2022
ef86cdc
Revert "Replace metalsmith-tagcleaner with a custom marked renderer"
36degrees Aug 1, 2022
4e015a2
Merge pull request #2288 from alphagov/revert-2276-bk-spike-tagcleane…
36degrees Aug 1, 2022
ccdfcbb
Merge pull request #2287 from peteryates/fix-lists-on-the-pagination-…
36degrees Aug 1, 2022
3b97070
Update src/patterns/equality-information/index.md.njk
edwardhorsford Aug 2, 2022
04acf9d
Merge pull request #2285 from edwardhorsford/patch-2
domoscargin Aug 2, 2022
c5dc3f0
Fix matchMedia event listener in IE / Safari < 14
36degrees Aug 4, 2022
faf2cc7
Enable aliases for section headings
NickColley Aug 4, 2022
f8affe9
Alias section break as hr
NickColley Aug 4, 2022
54d2bf7
Update What's New for v4.3.0
calvin-lau-sig7 Aug 9, 2022
5549ca7
Update govuk-frontend to 4.3.0
owenatgov Aug 9, 2022
69be51f
Merge pull request #2303 from alphagov/update-to-govuk-frontend-4.3.0
owenatgov Aug 9, 2022
57572f4
Document `opengraphImageUrl` page template option
36degrees Jun 27, 2022
c6f36a6
Merge pull request #2282 from alphagov/static-overrides-guidance
owenatgov Aug 9, 2022
1e824ec
Merge pull request #2228 from alphagov/opengraph-url
owenatgov Aug 9, 2022
388c9c6
Merge pull request #2302 from alphagov/calvin-lau-sig7-whats-new-430
calvin-lau-sig7 Aug 9, 2022
8dcb23b
Retry failed tests
domoscargin Aug 9, 2022
088ecd0
Merge pull request #2304 from alphagov/bk-flaky-jest-investigation
domoscargin Aug 10, 2022
6e86736
Fix linting issues
NickColley Aug 10, 2022
fbda060
Merge pull request #2291 from hippo-digital/add-alias-for-section-break
owenatgov Aug 11, 2022
f6324c5
Update team members list
Aug 11, 2022
f48885e
Merge pull request #2305 from alphagov/update-kim-name
querkmachine Aug 11, 2022
ee1828f
Merge pull request #2290 from alphagov/matchmedia-event-listener
36degrees Aug 12, 2022
2c17b29
Reference cookie banner in updating guidance
36degrees Aug 12, 2022
79d41d8
Merge pull request #2306 from alphagov/updating-cookie-banner
36degrees Aug 12, 2022
e3cc871
Add ‘measuring the value’ talk to community page
36degrees Aug 17, 2022
885dbf3
Update what's new with DSDay blog post
calvin-lau-sig7 Aug 17, 2022
4c6f814
Update date
calvin-lau-sig7 Aug 17, 2022
849dcb2
Shorten call-to-action
calvin-lau-sig7 Aug 17, 2022
da3145c
Update what's new with DSDay blog post
calvin-lau-sig7 Aug 17, 2022
b315693
Update what's new for v4.3.1
calvin-lau-sig7 Aug 18, 2022
1a2ba89
Update to GOV.UK Frontend v4.3.1
36degrees Aug 18, 2022
527d330
Merge pull request #2317 from alphagov/govuk-frontend-v4.3.1
36degrees Aug 18, 2022
5104a0a
Update what's new for v4.3.1
calvin-lau-sig7 Aug 18, 2022
e27fd81
Add in link and download to Mural file
clare-brown Jul 27, 2022
3100f1e
Merge pull request #2318 from alphagov/patch-1
36degrees Aug 19, 2022
34f5a5f
Merge pull request #2314 from alphagov/add-measuring-value-video
36degrees Aug 19, 2022
376068b
Remove unused tables option
36degrees Aug 1, 2022
4811829
Remove unused gfm: true from marked config
36degrees Aug 19, 2022
d9c3cac
Add border to 'preview' / 'archive' banner
36degrees Aug 19, 2022
f2f34ea
Merge pull request #2324 from alphagov/marked-config
36degrees Aug 19, 2022
ded6797
Merge pull request #2325 from alphagov/phase-banner-border
36degrees Aug 19, 2022
fc7780b
Remove redundant app-pane wrapper
36degrees Aug 19, 2022
1ee8b88
Remove custom phase banner styles
36degrees Aug 19, 2022
f6e9c1b
Remove redundant app-pane__content wrappers
36degrees Aug 19, 2022
3734ae6
Split 'category nav' out from app pane CSS
36degrees Aug 19, 2022
37f692b
Rename app-pane classes
36degrees Aug 19, 2022
e980f16
Fix implementation for non-flexbox browsers
36degrees Aug 19, 2022
840e749
Rename 'pane' to 'split-pane'
36degrees Aug 19, 2022
763c29f
Remove unused CSS
36degrees Aug 19, 2022
545fa55
Stop recommending pattern=[0-9]* on number inputs
36degrees Aug 19, 2022
62aead4
Remove pattern attribute from examples
36degrees Aug 19, 2022
93151fc
Remove use of govuk-exports
36degrees Aug 19, 2022
689fcda
Remove Sass and class that don't do anything
36degrees Aug 19, 2022
8987cf6
Fix more Sass that doesn't do anything
36degrees Aug 19, 2022
e0a19a0
Merge pull request #2323 from alphagov/remove-pattern-attribute-numbers
36degrees Aug 19, 2022
aae8f1c
Remove unused app-phase-banner class
36degrees Aug 26, 2022
ad315bd
Merge pull request #2327 from alphagov/refactor-layout
36degrees Aug 26, 2022
e2a6e69
Merge pull request #2328 from alphagov/sass-exports
36degrees Aug 26, 2022
d7a6abc
Merge pull request #2329 from alphagov/footer-sass
36degrees Aug 26, 2022
a7b6aa6
Merge branch 'main' of github.com:alphagov/govuk-design-system into u…
Sep 1, 2022
01c88d9
Update package-lock.json
Sep 1, 2022
8ccc748
Remove new GOV.UK pages
Sep 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env jest */

jest.setTimeout(10000)
jest.retryTimes(3, { logErrorsBeforeRetry: true })
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Example with aliases
headingAliases:
Heading level 1: one
Heading level 2: two
Heading level 3: three
---

Contents

# Heading level 1

Paragraph

## Heading level 2

[Link](/)

### Heading level 3
26 changes: 19 additions & 7 deletions lib/extract-page-headings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,26 @@ const plugin = () => {
let tokens = lexer.lex(contents)
let headingsArray = []
tokens.forEach(token => {
if (token.type === 'heading') {
let heading = {
depth: token.depth,
text: token.text,
url: token.text.toLowerCase().replace(/[^\w]+/g, '-')
}
headingsArray.push(heading)
if (token.type !== 'heading') {
return
}

let aliases = null
if (data.headingAliases) {
aliases =
Object.entries(data.headingAliases)
.filter(([text]) => { return text === token.text })
.map(([text, alias]) => { return alias })
.join()
}

let heading = {
depth: token.depth,
text: token.text,
url: token.text.toLowerCase().replace(/[^\w]+/g, '-'),
aliases
}
headingsArray.push(heading)
})
data.headings = headingsArray
})
Expand Down
32 changes: 22 additions & 10 deletions lib/extract-page-headings/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,35 @@ const metalsmith = require('metalsmith')
const plugin = require('./index.js')

describe('extract-page-headings plugin', () => {
it('generated heading metadata matches expected', (done) => {
let pages
beforeAll((done) => {
metalsmith('lib/extract-page-headings/fixtures')
.use(plugin())
.build((err, files) => {
if (err) {
return done(err)
}
Object.keys(files).forEach((file) => {
const metadataHeadings = files[file].headings
const expectedHeadings = [
{ depth: 1, text: 'Heading level 1', url: 'heading-level-1' },
{ depth: 2, text: 'Heading level 2', url: 'heading-level-2' },
{ depth: 3, text: 'Heading level 3', url: 'heading-level-3' }
]
expect(metadataHeadings).toEqual(expectedHeadings)
})
pages = files

done()
})
})
it('generated heading metadata matches expected', () => {
const metadataHeadings = pages['example.md.njk'].headings
const expectedHeadings = [
{ aliases: null, depth: 1, text: 'Heading level 1', url: 'heading-level-1' },
{ aliases: null, depth: 2, text: 'Heading level 2', url: 'heading-level-2' },
{ aliases: null, depth: 3, text: 'Heading level 3', url: 'heading-level-3' }
]
expect(metadataHeadings).toEqual(expectedHeadings)
})
it('generates headings with aliases', () => {
const metadataHeadings = pages['example-with-aliases.md.njk'].headings
const expectedHeadings = [
{ aliases: 'one', depth: 1, text: 'Heading level 1', url: 'heading-level-1' },
{ aliases: 'two', depth: 2, text: 'Heading level 2', url: 'heading-level-2' },
{ aliases: 'three', depth: 3, text: 'Heading level 3', url: 'heading-level-3' }
]
expect(metadataHeadings).toEqual(expectedHeadings)
})
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Page with headings
show_page_nav: true
headingAliases:
Heading level 2: two
---

# Heading level 1
Expand Down
6 changes: 4 additions & 2 deletions lib/metalsmith-lunr-index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ module.exports = function lunrPlugin () {
path: `${documentPath}/#${heading.url}`,
title: heading.text,
page: file.title,
section: file.section
section: file.section,
aliases: heading.aliases === null ? undefined : heading.aliases
}
})
return headings
Expand Down Expand Up @@ -98,7 +99,8 @@ module.exports = function lunrPlugin () {
store[doc.path] = {
title: doc.title,
path: doc.path,
section: `${doc.section}${separator}${doc.page}`
section: `${doc.section}${separator}${doc.page}`,
aliases: doc.aliases
}
this.add(doc)
})
Expand Down
7 changes: 7 additions & 0 deletions lib/metalsmith-lunr-index/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,12 @@ describe('metalsmith-lunr-index plugin', () => {

expect(documentStore[resultRef].title).toEqual('Heading level 2')
})

it('stores the aliases for the page heading of the page in the metadata', () => {
const searchResults = searchIndex.search('two')
const resultRef = searchResults[0].ref

expect(documentStore[resultRef].title).toEqual('Heading level 2')
})
})
})
2 changes: 0 additions & 2 deletions lib/metalsmith.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ module.exports = metalsmith(__dirname) // __dirname defined by node.js: name of

// Markdown engine options
smartypants: true, // use "smart" typographic punctuation
gfm: true,
tables: true,
pedantic: true,
highlight: highlighter
}
Expand Down
Loading