Class: Smithy::Liquid::Drops::Page
- Inherits:
-
Base
- Object
- Liquid::Drop
- Base
- Smithy::Liquid::Drops::Page
show all
- Defined in:
- lib/smithy/liquid/drops/page.rb
Instance Attribute Summary
Attributes inherited from Base
#_source
Instance Method Summary
collapse
Methods inherited from Base
#id, #initialize
Instance Method Details
#breadcrumbs ⇒ Object
7
8
9
|
# File 'lib/smithy/liquid/drops/page.rb', line 7
def breadcrumbs
self._source.ancestors.where(["id != ?", root]).map(&:to_liquid)
end
|
#browser_title ⇒ Object
11
12
13
|
# File 'lib/smithy/liquid/drops/page.rb', line 11
def browser_title
self._source.browser_title.present? ? self._source.browser_title : self.generated_browser_title
end
|
#child? ⇒ Boolean
87
88
89
|
# File 'lib/smithy/liquid/drops/page.rb', line 87
def child?
self._source.child?
end
|
#children ⇒ Object
15
16
17
|
# File 'lib/smithy/liquid/drops/page.rb', line 15
def children
self._source.children.map(&:to_liquid)
end
|
#container ⇒ Object
23
24
25
|
# File 'lib/smithy/liquid/drops/page.rb', line 23
def container
self.rendered_containers
end
|
#leaf? ⇒ Boolean
83
84
85
|
# File 'lib/smithy/liquid/drops/page.rb', line 83
def leaf?
self._source.leaf?
end
|
27
28
29
|
# File 'lib/smithy/liquid/drops/page.rb', line 27
def meta_description
self._source.description
end
|
31
32
33
|
# File 'lib/smithy/liquid/drops/page.rb', line 31
def meta_keywords
self._source.keywords
end
|
#nav_children ⇒ Object
19
20
21
|
# File 'lib/smithy/liquid/drops/page.rb', line 19
def nav_children
self._source.children.included_in_navigation.map(&:to_liquid)
end
|
#next ⇒ Object
35
36
37
38
39
40
41
42
43
|
# File 'lib/smithy/liquid/drops/page.rb', line 35
def next
sibling = if self._source.leaf?
self._source.right_sibling
elsif self._source.children.size
self._source.children.first
end
sibling ||= self._source.parent.right_sibling
sibling.to_liquid
end
|
#next_sibling ⇒ Object
45
46
47
|
# File 'lib/smithy/liquid/drops/page.rb', line 45
def next_sibling
self._source.right_sibling.to_liquid
end
|
#parent ⇒ Object
49
50
51
|
# File 'lib/smithy/liquid/drops/page.rb', line 49
def parent
self._source.parent.to_liquid
end
|
#path ⇒ Object
53
54
55
|
# File 'lib/smithy/liquid/drops/page.rb', line 53
def path
self._source.url
end
|
#previous ⇒ Object
57
58
59
60
61
62
63
64
65
|
# File 'lib/smithy/liquid/drops/page.rb', line 57
def previous
sibling = if self._source.left_sibling && self._source.left_sibling.leaf?
self._source.left_sibling
elsif self._source.left_sibling && self._source.left_sibling.children.size
self._source.left_sibling.children.last
end
sibling ||= self._source.parent
sibling.to_liquid
end
|
#previous_sibling ⇒ Object
67
68
69
|
# File 'lib/smithy/liquid/drops/page.rb', line 67
def previous_sibling
sibling = self._source.left_sibling.to_liquid
end
|
#published? ⇒ Boolean
71
72
73
|
# File 'lib/smithy/liquid/drops/page.rb', line 71
def published?
self._source.published?
end
|
#root? ⇒ Boolean
79
80
81
|
# File 'lib/smithy/liquid/drops/page.rb', line 79
def root?
self._source.root?
end
|
#show_in_navigation? ⇒ Boolean
75
76
77
|
# File 'lib/smithy/liquid/drops/page.rb', line 75
def show_in_navigation?
self._source.show_in_navigation?
end
|