-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix all broken links and add link checker #108
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8d7ce74
Set up html-proofer as the link checker
e50c6bc
Put tech-docs-gem/docs content in the docs repo
e500890
Remove gem_docs helper
00e2497
Bring in images from the tech docs gem repo
32528eb
Fix links to images which are now in the `images` folder
3fb24e9
Move diagrams to the `images` folder
6d72597
Dix diagram linking after moving to the `images` folder
b0184cf
Fix links that broke as a result of the restructuring in PR#97
5fc0204
Merge branch 'master' into fix-all-broken-links-forever
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
require 'govuk_tech_docs' | ||
|
||
GovukTechDocs.configure(self, livereload: { js_host: "localhost" }) | ||
|
||
DOCS_LOCATION_IN_GEM = Bundler.rubygems.find_name('govuk_tech_docs').first.full_gem_path + "/docs" | ||
|
||
files.watch :source, path: DOCS_LOCATION_IN_GEM | ||
# Check for broken links | ||
require 'html-proofer' | ||
|
||
helpers do | ||
def gem_docs(filename) | ||
raw_markdown = File.read(DOCS_LOCATION_IN_GEM + "/#{filename}") | ||
|
||
# Strip the h1 header from the original markdown file | ||
markdown = raw_markdown.lines[1..-1].join | ||
GovukTechDocs.configure(self, livereload: { js_host: "localhost" }) | ||
|
||
markdown | ||
after_build do |builder| | ||
begin | ||
HTMLProofer.check_directory(config[:build_dir], | ||
{ :assume_extension => true, | ||
:disable_external => true, | ||
:allow_hash_href => true, | ||
:url_swap => { config[:tech_docs][:host] => "" } }).run | ||
rescue RuntimeError => e | ||
abort e.to_s | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,227 @@ review_in: 1 day | |
|
||
# Configuration options | ||
|
||
<%= gem_docs 'configuration.md' %> | ||
You can configure the site using `config/tech-docs.yml`. [See the PaaS tech docs for an example](https://github.com/alphagov/paas-tech-docs/blob/master/config/tech-docs.yml). | ||
|
||
These are all the available options: | ||
|
||
## `ga_tracking_id` | ||
|
||
Tracking ID from Google Analytics | ||
|
||
```yaml | ||
ga_tracking_id: UA-XXXX-Y | ||
``` | ||
|
||
## `github_repo` | ||
|
||
Your repository. Required if [show_contribution_banner](/amend_project/configuration/#show-contribution-banner) is true. | ||
|
||
```yaml | ||
github_repo: alphagov/example-repo | ||
``` | ||
|
||
## `github_branch` | ||
|
||
Your github branch name. Useful if your default branch is not named master. | ||
|
||
```yaml | ||
github_branch: source | ||
``` | ||
|
||
## `google_site_verification` | ||
|
||
Adds a [Google Site Verification code](https://support.google.com/webmasters/answer/35179?hl=en) to the meta tags. | ||
|
||
```yaml | ||
google_site_verification: TvDTuyvdstyusadrCSDrctyd | ||
``` | ||
|
||
## `enable_search` | ||
|
||
Enables search functionality. This indexes pages only and is not recommended for single-page sites. | ||
|
||
```yaml | ||
enable_search: true | ||
``` | ||
|
||
## `header_links` | ||
|
||
Right hand side navigation. | ||
|
||
Example: | ||
|
||
```yaml | ||
header_links: | ||
Documentation: / | ||
``` | ||
|
||
## `footer_links` | ||
|
||
Links to show in footer. | ||
|
||
Example: | ||
|
||
```yaml | ||
footer_links: | ||
Accessibility: /accessibility | ||
``` | ||
|
||
## `host` | ||
|
||
Host to use for canonical URL generation (without trailing slash). | ||
|
||
Example: | ||
|
||
```yaml | ||
host: https://docs.cloud.service.gov.uk | ||
``` | ||
|
||
## `collapsible_nav` | ||
|
||
Enable collapsible navigation in the sidebar. Defaults to false; | ||
|
||
```yaml | ||
collapsible_nav: true | ||
``` | ||
|
||
## `multipage_nav` | ||
|
||
Enable multipage navigation in the sidebar. Defaults to false; | ||
|
||
```yaml | ||
multipage_nav: true | ||
``` | ||
|
||
## `max_toc_heading_level` | ||
|
||
Table of contents depth – how many levels to include in the table of contents. If your ToC is too long, reduce this number and we'll only show higher-level headings. | ||
|
||
```yaml | ||
max_toc_heading_level: 6 | ||
``` | ||
|
||
## `phase` | ||
|
||
```yaml | ||
phase: "Beta" | ||
``` | ||
|
||
## `prevent_indexing` | ||
|
||
Prevent robots from indexing (e.g. whilst in development) | ||
|
||
```yaml | ||
prevent_indexing: false | ||
``` | ||
|
||
## `redirects` | ||
|
||
A list of redirects, from old to new location. Use this to set up external | ||
redirects or if [setting `old_paths` in the frontmatter](/frontmatter.html#old-paths) doesn't work. | ||
|
||
```yaml | ||
redirects: | ||
/old-page.html: https://example.org/something-else.html | ||
/another/old-page.html: /another/new-page.html | ||
``` | ||
|
||
## `service_name` | ||
|
||
The service name in the header. | ||
|
||
Example: | ||
|
||
```yaml | ||
service_name: "Platform as a Service" | ||
``` | ||
|
||
## `full_service_name` | ||
|
||
The full service name (maybe with GOV.UK) | ||
|
||
Example: | ||
|
||
```yaml | ||
full_service_name: "GOV.UK Pay" | ||
``` | ||
|
||
## `service_link` | ||
|
||
What the service name in the header links to. | ||
|
||
default: '/' | ||
|
||
```yaml | ||
service_link: "/" | ||
``` | ||
|
||
## `show_contribution_banner` | ||
|
||
Show a block at the bottom of the page that links to the page source, so readers | ||
can easily contribute back to the documentation. If turned on [github_repo](/amend_project/configuration/#github-repo) is | ||
required. | ||
|
||
Off by default. | ||
|
||
```yaml | ||
show_contribution_banner: true | ||
github_repo: alphagov/example-repo | ||
``` | ||
|
||
## `source_urls` | ||
|
||
Customise the URLs that the contribution banner links to. Only useful if | ||
[show_contribution_banner](/amend_project/configuration/#show-contribution-banner) is turned on. By default, "Report issue" links | ||
to raising a GitHub issue but by modifying the `report_issue_url` it can link to an email address | ||
or another page. | ||
|
||
```yaml | ||
source_urls: | ||
report_issue_url: mailto:[email protected] | ||
``` | ||
|
||
## `show_govuk_logo` | ||
|
||
Whether to show the GOV.UK crown logo. | ||
|
||
default: `true` | ||
|
||
```yaml | ||
show_govuk_logo: true | ||
``` | ||
|
||
## `api_path` | ||
|
||
Define a path to an Open API V3 spec file. This can be a relative file path or a URI to a raw file. | ||
|
||
```yaml | ||
api_path: ./source/pets.yml | ||
``` | ||
|
||
## `owner_slack_workspace` and `default_owner_slack` | ||
|
||
These attributes are used to specify the owner of a page. See the separate | ||
[documentation for page expiry][expiry] for more details. | ||
|
||
## `show_expiry` | ||
|
||
Decides whether or not to show a red banner when the page needs to be reviewed. | ||
|
||
If not present or set to `true`, the red banner will appear when the page needs to be reviewed. This is the default behaviour. | ||
|
||
If set to `false`, the red banner will not appear when the page needs to be reviewed. | ||
|
||
See the separate [documentation for page expiry][expiry] for more details. | ||
|
||
## `show_review_banner` | ||
|
||
Decides whether or not to display the page review banner, regardless of whether the page needs to be reviewed or not. | ||
|
||
If not present or set to `true`, the banner will be displayed on the page. This is the default behaviour. | ||
|
||
If set to `false`, the banner will not be displayed. | ||
|
||
See the separate [documentation for page expiry][expiry] for more details. | ||
|
||
[expiry]: /review_project/page-expiry/#page-expiry-and-review |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean we need to do a pull request on the gem repo to remove content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup - I've raised this PR to cover the content move: alphagov/tech-docs-gem#151