History

Add doc/type pages to the search index

Closes #55.

Thibaut committed 12 years ago

Commit 32906bc1 parent 68b29113 files · +14 −2Browse files

Unified · Split

3 files
  1. assets/javascripts/app/app.coffee +4 −1
  2. assets/javascripts/models/type.coffee +6 −0
  3. assets/javascripts/templates/pages/news_tmpl.coffee +4 −1
assets/javascripts/app/app.coffee+4−1
@@ -71,7 +71,10 @@ · 70 unmodified lines
7171 return
7272
7373 start: ->
74− @entries.add doc.entries.all() for doc in @docs.all()
74+ for doc in @docs.all()
75+ @entries.add doc.toEntry()
76+ @entries.add type.toEntry() for type in doc.types.all()
77+ @entries.add doc.entries.all()
7578 @trigger 'ready'
7679 @router.start()
7780 @hideLoading()
assets/javascripts/models/type.coffee+6−0
@@ -6,3 +6,9 @@ class app.models.Type extends app.Model · 5 unmodified lines
66
77 entries: ->
88 @doc.entries.findAllBy 'type', @name
9+
10+ toEntry: ->
11+ new app.models.Entry
12+ doc: @doc
13+ name: "#{@doc.name} / #{@name}"
14+ path: '..' + @fullPath()
assets/javascripts/templates/pages/news_tmpl.coffee+4−1
@@ -24,7 +24,10 @@ newsItem = (date, news) -> · 23 unmodified lines
2424 result
2525
2626 app.news = [
27− [ 1390694400000, # January 26, 2013
27+ [ 1392163200000, # February 12, 2013
28+ """ The root/category pages are now included in the search index (e.g. <a href="/#q=CSS">CSS</a>) """,
29+ ], [
30+ 1390694400000, # January 26, 2013
2831 """ Updated <a href="/angular/">Angular.js</a> documentation """,
2932 ], [
3033 1390089600000, # January 19, 2013