Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit c940d4c

Browse files
sitestore
1 parent 5461ded commit c940d4c

File tree

2 files changed

+13
-51
lines changed

2 files changed

+13
-51
lines changed

app/stores/site_store.rb

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,17 @@ def loaded?
1818
ret
1919
end
2020

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-
4421
private
4522

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-
6323
def init
6424
@section_stores = {}
65-
# FRED if the site is being loaded through a specific route, can we figure out which section to load first?
6625
load_start_section
6726
load_docs_section
27+
load_installation_section
6828
end
6929

7030
def load_start_section
71-
72-
sectionname = "start"
73-
sectionid = 1
31+
section_name = "start"
7432

7533
pages = [
7634
{ id: 0, name: 'components', repo: 'hyperloop-website', file: 'pages/start/components.md', allow_edit: true },
@@ -80,14 +38,11 @@ def load_start_section
8038
{ id: 4, name: 'policies', repo: 'hyperloop-website', file: 'pages/start/policies.md', allow_edit: true },
8139
{ id: 5, name: 'pradgmatic', repo: 'hyperloop-website', file: 'pages/start/pradgmatic.md', allow_edit: true }
8240
]
83-
84-
@section_stores[sectionname] = SectionStore.new(pages, sectionname, sectionid)
41+
@section_stores[section_name] = SectionStore.new(pages, section_name)
8542
end
8643

8744
def load_docs_section
88-
89-
sectionname = "docs"
90-
sectionid = 0
45+
section_name = "docs"
9146

9247
pages = [
9348
{ id: 0, name: 'components', repo: 'hyper-react', file: 'DOCS.md', allow_edit: true },
@@ -98,10 +53,17 @@ def load_docs_section
9853
{ id: 5, name: 'policies', repo: 'hyper-operation', file: 'DOCS-POLICIES.md', allow_edit: true },
9954
{ id: 6, name: 'dummy', repo: 'hyperloop-website', file: 'dist/dummy_DOCS.md', allow_edit: true }
10055
]
101-
@section_stores[sectionname] = SectionStore.new(pages, sectionname, sectionid)
56+
@section_stores[section_name] = SectionStore.new(pages, section_name)
10257
end
10358

59+
def load_installation_section
60+
section_name = "installation"
10461

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
10567
end
10668

10769
end

pages/start/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Componentst
1+
# Components
22

33
Hyperloop user interfaces are composed of React Components written in Ruby.
44

0 commit comments

Comments
 (0)