This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.rb
69 lines (58 loc) · 1.67 KB
/
config.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# frozen_string_literal: true
require "govuk_tech_docs"
require "lib/requires"
GovukTechDocs.configure(self)
activate :open_api
set :markdown,
renderer: DfETechDocs::TechDocsHTMLRenderer.new(
with_toc_data: true,
api: true,
context: self,
),
fenced_code_blocks: true,
tables: true,
no_intra_emphasis: true
set :layout, "dfe_tech_docs"
ignore "templates/*"
set :relative_links, true
SERVICE_DOCS = [
{
title: "Manage continuing professional development runbooks",
pages: GitHubRepoFetcher.instance.docs(
service_name: "Manage continuing professional development",
repo_name: "DFE-Digital/early-careers-framework",
path_in_repo: "documentation",
path_prefix: "runbooks/early-careers-framework",
# ignore_files: %w[api.md],
),
},
{
title: "Manage continuing professional development ADR",
pages: GitHubRepoFetcher.instance.docs(
service_name: "Manage continuing professional development",
repo_name: "DFE-Digital/early-careers-framework",
path_in_repo: "documentation/adr",
path_prefix: "adr/early-careers-framework",
ignore_files: %w[0001-record-architecture-decisions.md],
),
},
].freeze
helpers do
def service_docs
SERVICE_DOCS
end
def pages_by_category
PagesByCategory.new(sitemap)
end
# Returns all pages under a certain directory.
def sub_pages(dir)
sitemap.resources.select do |resource|
resource.url.start_with?(dir) && resource.url != dir
end
end
end
SERVICE_DOCS.each do |service_doc|
service_doc[:pages].each do |page|
proxy page.fetch(:path), "templates/external_doc_template.html", page.fetch(:proxy_args)
end
end