This repository was archived by the owner on Mar 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfig.rb
88 lines (69 loc) · 2.1 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
require 'lib/tech_docs_html_renderer'
###
# Page options, layouts, aliases and proxies
###
set :markdown_engine, :redcarpet
set :markdown,
renderer: TechDocsHTMLRenderer.new(
with_toc_data: true
),
fenced_code_blocks: true,
tables: true
# Per-page layout changes:
#
# With no layout
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
# Design patterns have a different default layout
page "/design-patterns/patterns/*", :layout => "design_pattern"
# Search
# https://github.com/manastech/middleman-search#usage
activate :search do |search|
search.resources = ['design-patterns/patterns']
search.before_index = Proc.new do |to_index, to_store, resource|
throw(:skip) if resource.data.status&.downcase == "backlog" ||
!["all", nil].include?(resource.data.department&.downcase)
end
search.fields = {
# Index the title, but also make it available when showing results
title: {boost: 100, store: true, required: true},
# Index these
aliases: {boost: 50},
content: {boost: 1, index: true, store: false},
# Just make these available when presenting search results
url: {index: false, store: true},
section: {index: false, store: true, required: true},
theme: {index: false, store: true},
description: {index: false, store: true}
}
end
set :theme_orders, {
"About" => [],
"Styles" => [],
"Components" => ["Global", "Navigation", "Form elements", "Content", "Pages"],
"Patterns" => ["Form design", "Personal details", "Service design", "Account information"]
}
# General configuration
# Reload the browser automatically whenever files change
configure :development do
activate :livereload
end
activate :autoprefixer
activate :sprockets
activate :syntax
###
# Helpers
###
# Build-specific configuration
configure :build do
# Minify CSS on build
# activate :minify_css
# Minify Javascript on build
# activate :minify_javascript
end
###
# Tech Docs-specific configuration
###
config[:design_system] = YAML.load_file('config/design-system.yml')
&.with_indifferent_access