@@ -18,59 +18,17 @@ def loaded?
18
18
ret
19
19
end
20
20
21
- # def search_headings value, sectionname
22
- # data = []
23
-
24
- # @section_stores.each do |section|
25
-
26
- # a = {}
27
- # a[:name] = section[0].upcase
28
-
29
- # a[:results] = []
30
- # pages = section[1].pages
31
- # pages.each do |page|
32
- # a[:results].concat( match_headings(page[:headings], value, page) )
33
- # end
34
- # data << a unless a[:results].size == 0
35
- # end
36
- # data
37
- # end
38
-
39
-
40
-
41
-
42
-
43
-
44
21
private
45
22
46
-
47
-
48
- # def match_headings headings, value, page
49
- # ret = []
50
- # headings.each_with_index do |heading, index|
51
- # if heading[:text].downcase.include?(value.downcase)
52
- # heading[:friendly_doc_name] = page[:friendly_doc_name]
53
- # heading[:repo] = page[:repo]
54
- # heading[:file] = page[:file]
55
- # heading[:key] = "#{index}-#{heading[:repo]}-#{heading[:file]}-#{heading[:slug]}"
56
- # ret << heading
57
-
58
- # end
59
- # end
60
- # ret
61
- # end
62
-
63
23
def init
64
24
@section_stores = { }
65
- # FRED if the site is being loaded through a specific route, can we figure out which section to load first?
66
25
load_start_section
67
26
load_docs_section
27
+ load_installation_section
68
28
end
69
29
70
30
def load_start_section
71
-
72
- sectionname = "start"
73
- sectionid = 1
31
+ section_name = "start"
74
32
75
33
pages = [
76
34
{ id : 0 , name : 'components' , repo : 'hyperloop-website' , file : 'pages/start/components.md' , allow_edit : true } ,
@@ -80,14 +38,11 @@ def load_start_section
80
38
{ id : 4 , name : 'policies' , repo : 'hyperloop-website' , file : 'pages/start/policies.md' , allow_edit : true } ,
81
39
{ id : 5 , name : 'pradgmatic' , repo : 'hyperloop-website' , file : 'pages/start/pradgmatic.md' , allow_edit : true }
82
40
]
83
-
84
- @section_stores [ sectionname ] = SectionStore . new ( pages , sectionname , sectionid )
41
+ @section_stores [ section_name ] = SectionStore . new ( pages , section_name )
85
42
end
86
43
87
44
def load_docs_section
88
-
89
- sectionname = "docs"
90
- sectionid = 0
45
+ section_name = "docs"
91
46
92
47
pages = [
93
48
{ id : 0 , name : 'components' , repo : 'hyper-react' , file : 'DOCS.md' , allow_edit : true } ,
@@ -98,10 +53,17 @@ def load_docs_section
98
53
{ id : 5 , name : 'policies' , repo : 'hyper-operation' , file : 'DOCS-POLICIES.md' , allow_edit : true } ,
99
54
{ id : 6 , name : 'dummy' , repo : 'hyperloop-website' , file : 'dist/dummy_DOCS.md' , allow_edit : true }
100
55
]
101
- @section_stores [ sectionname ] = SectionStore . new ( pages , sectionname , sectionid )
56
+ @section_stores [ section_name ] = SectionStore . new ( pages , section_name )
102
57
end
103
58
59
+ def load_installation_section
60
+ section_name = "installation"
104
61
62
+ pages = [
63
+ { id : 0 , name : 'components' , repo : 'hyperloop-website' , file : 'pages/installation/overview.md' , allow_edit : true }
64
+ ]
65
+ @section_stores [ section_name ] = SectionStore . new ( pages , section_name )
66
+ end
105
67
end
106
68
107
69
end
0 commit comments