radiant-navigation_tags-extension 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +10 -8
- data/VERSION +1 -1
- data/lib/navigation_tags.rb +5 -9
- data/navigation_tags_extension.rb +1 -1
- metadata +6 -8
data/README
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
= Navigation Tags
|
|
2
2
|
|
|
3
|
-
Provides hierarchical tree navigation based on Radiant's site structure. Outputs navigation in the form of a -very flexible and CSS'able- unordered list.
|
|
3
|
+
Provides hierarchical tree navigation based on Radiant's site structure. Outputs navigation in the form of a -very flexible and CSS'able- unordered list.
|
|
4
4
|
|
|
5
5
|
== Usage
|
|
6
6
|
|
|
7
|
-
<r:nav [root="/"] [
|
|
7
|
+
<r:nav [root="/"] [depth="2"] [expand_all="true"] [ids_for_lis="true"] [ids_for_links="true"] [append_urls=".."] [prepend_urls=".."]/>
|
|
8
8
|
|
|
9
9
|
Given this directory tree:
|
|
10
10
|
|
|
@@ -30,12 +30,14 @@ Provides hierarchical tree navigation based on Radiant's site structure. Outputs
|
|
|
30
30
|
|
|
31
31
|
== Available tag attributes:
|
|
32
32
|
|
|
33
|
-
* ids_for_lis:
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* depth:
|
|
37
|
-
* expand_all:
|
|
38
|
-
*
|
|
33
|
+
* ids_for_lis: defaults to false, enable this to give each li an id
|
|
34
|
+
* ids_for_links: defaults to false, enable this to give each a unique id
|
|
35
|
+
* root: defaults to "/", which page to start building the navigation from
|
|
36
|
+
* depth: defaults to 2, which will print out the first two levels of pages.
|
|
37
|
+
* expand_all: defaults to false, enable this to have all li's create sub-ul's of their children, i.o. only the currently active li
|
|
38
|
+
* prepend_urls: defaults to none allows to add certain pages at the top of the list
|
|
39
|
+
* qppend_urls: defaults to none allows to add certain pages at the bottom of the list
|
|
40
|
+
* id, class, monkeyballs, ... will be used as html attributes for the ul
|
|
39
41
|
|
|
40
42
|
= CREDITS
|
|
41
43
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.3
|
data/lib/navigation_tags.rb
CHANGED
|
@@ -100,15 +100,11 @@ module NavigationTags
|
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
def li_attrs_for_current_page_vs_navigation_item current_page, child_page
|
|
103
|
-
classes = [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if !@first_set
|
|
109
|
-
classes << "first"
|
|
110
|
-
@first_set = true
|
|
111
|
-
end
|
|
103
|
+
classes = []
|
|
104
|
+
classes << "current" if current_page == child_page
|
|
105
|
+
classes << "has_children" if child_page.children.size > 0
|
|
106
|
+
classes << "parent_of_current" if !child_page.parent.nil? and current_page.url.starts_with?(child_page.url) and current_page != child_page
|
|
107
|
+
(classes << "first" && @first_set = true) unless @first_set
|
|
112
108
|
|
|
113
109
|
result = ""
|
|
114
110
|
if classes.any?
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: radiant-navigation_tags-extension
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
5
|
-
prerelease:
|
|
4
|
+
hash: 17
|
|
5
|
+
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 2
|
|
9
|
-
-
|
|
10
|
-
version: 0.2.
|
|
9
|
+
- 3
|
|
10
|
+
version: 0.2.3
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Benny Degezelle
|
|
@@ -15,8 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-
|
|
19
|
-
default_executable:
|
|
18
|
+
date: 2011-06-24 00:00:00 Z
|
|
20
19
|
dependencies:
|
|
21
20
|
- !ruby/object:Gem::Dependency
|
|
22
21
|
name: radiant
|
|
@@ -52,7 +51,6 @@ files:
|
|
|
52
51
|
- lib/navigation_tags.rb
|
|
53
52
|
- lib/tasks/navigation_tags_extension_tasks.rake
|
|
54
53
|
- navigation_tags_extension.rb
|
|
55
|
-
has_rdoc: true
|
|
56
54
|
homepage: https://github.com/jomz/navigation_tags
|
|
57
55
|
licenses: []
|
|
58
56
|
|
|
@@ -82,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
82
80
|
requirements: []
|
|
83
81
|
|
|
84
82
|
rubyforge_project:
|
|
85
|
-
rubygems_version: 1.
|
|
83
|
+
rubygems_version: 1.8.5
|
|
86
84
|
signing_key:
|
|
87
85
|
specification_version: 3
|
|
88
86
|
summary: Navigation tags extension for Radiant CMS
|