-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.rb
60 lines (47 loc) · 1.4 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
require_relative "lib/teacher_services_tech_docs"
GovukTechDocs.configure(self)
service_list = YAML.load_file("config/services.yml")
services = service_list.reduce([]) do |list, service|
repo = TeacherServicesTechDocs::GitHub::RubyRepo.new(
repo_name: service["repo_name"],
service_name: service["name"],
)
list + service["docsets"].map do |docset|
repo.load_docs(
path_in_repo: docset["path"],
ignore_files: docset.fetch("ignore_files", []),
)
end
end
ignore "templates/*"
RUBY_SERVICE_PROFILES = service_list.select { |s| s["language"] == "ruby" }.map do |service|
repo = TeacherServicesTechDocs::GitHub::RubyRepo.new(
repo_name: service["repo_name"],
service_name: service["name"],
)
repo.profile
end
CS_SERVICE_PROFILES = service_list.select { |s| s["language"] == "cs" }.map do |service|
repo = TeacherServicesTechDocs::GitHub::CsRepo.new(
repo_name: service["repo_name"],
csproj_path: service["csproj_path"],
service_name: service["name"],
)
repo.profile
end
helpers do
def pages_by_category
TeacherServicesTechDocs::PagesByCategory.new(sitemap)
end
def ruby_service_profiles
RUBY_SERVICE_PROFILES.compact
end
def cs_service_profiles
CS_SERVICE_PROFILES.compact
end
end
services.each do |docset|
docset.each do |page|
proxy page.fetch(:path), "templates/external_doc_template.html", page.fetch(:proxy_args)
end
end