middleman-navtree 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +3 -0
- data/lib/middleman-navtree/extension.rb +12 -12
- data/lib/middleman-navtree/helpers.rb +15 -6
- data/middleman-navtree.gemspec +4 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NWIzNDFlYzBlOTAzOGY3N2FmZWJkODZhYWU2YTE0ZDIxODBhODI5Ng==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dba692e974c7d73f972a915a964ceccb9b3b2174
|
4
|
+
data.tar.gz: 19e0ebc01af1c4d6ab6d654d9c2f048ebb437250
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YTk4NjUyN2U5OTJkZTQ0YjlkNmMwNmVhNzZhMTIzNjk5YWFiZjBiNGFhZDJm
|
11
|
-
YmZmZjE3ZDdjOWUxYjY4MmVhYTAyZDYzYmU0YzJiNjM3M2EzMjg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NjVkNTM0MDQ2YzAyM2Q5YWRlM2RmNjI1MTk2YzBhZjdmYWIzMWU3ZGVjMThi
|
14
|
-
YjhkZGQwNTYwN2UyYzE1Y2ExMjhiODg5ZjdkMDNmMDUxNzkxOTNlNjk5NTk5
|
15
|
-
MTdkMGEyMzE0OTYxMjg4M2U3NGZkODJjMWY1N2ZmNzc5MWJhNDM=
|
6
|
+
metadata.gz: d560d43755c236300896110543f38a962a40e07237ed52ad577ecc7bf2e0768068d3aabcd3104703756c05242de04e6fc99d5738ece35843773b60c937f69bac
|
7
|
+
data.tar.gz: cf94a511845d61d8a2ed2140e05a10a546990c4daa6496c16e75c6a0ffc9de05c8d93b178c331dbc3d6cfca61b6ae89f97c904cf31b722c4d3ef723b48234c24
|
data/README.md
CHANGED
@@ -77,6 +77,9 @@ You can likewise limit pagination to a specific subtree:
|
|
77
77
|
|
78
78
|
<%= previous_link(data.tree['chapter-2']) %><%= next_link(data.tree['chapter-2']) %>
|
79
79
|
|
80
|
+
## Known Issues
|
81
|
+
|
82
|
+
Middleman Navtree does not currently support links to files using [Directory Indexes](https://middlemanapp.com/advanced/pretty_urls/). For details and the status of this feature, see [#12 Support Directory Indexes](https://github.com/bryanbraun/middleman-navtree/issues/12).
|
80
83
|
|
81
84
|
## Contributing
|
82
85
|
|
@@ -35,16 +35,16 @@ module Middleman
|
|
35
35
|
def after_configuration
|
36
36
|
# Add the user's config directories to the "ignore_dir" option because
|
37
37
|
# these are all things we won't need printed in a NavTree.
|
38
|
-
options.ignore_dir << app.
|
39
|
-
options.ignore_dir << app.
|
40
|
-
options.ignore_dir << app.
|
41
|
-
options.ignore_dir << app.
|
42
|
-
options.ignore_dir << app.
|
43
|
-
options.ignore_dir << app.
|
44
|
-
options.ignore_dir << app.
|
38
|
+
options.ignore_dir << app.config[:js_dir]
|
39
|
+
options.ignore_dir << app.config[:css_dir]
|
40
|
+
options.ignore_dir << app.config[:fonts_dir]
|
41
|
+
options.ignore_dir << app.config[:images_dir]
|
42
|
+
options.ignore_dir << app.config[:helpers_dir]
|
43
|
+
options.ignore_dir << app.config[:layouts_dir]
|
44
|
+
options.ignore_dir << app.config[:partials_dir]
|
45
45
|
|
46
46
|
# Build a hash out of our directory information
|
47
|
-
tree_hash = scan_directory(app.
|
47
|
+
tree_hash = scan_directory(app.config[:source], options)
|
48
48
|
|
49
49
|
# Promote any promoted files to the beginning of our hash.
|
50
50
|
tree_hash = promote_files(tree_hash, options)
|
@@ -53,9 +53,9 @@ module Middleman
|
|
53
53
|
# @todo: This step doesn't rebuild during live-reload, which causes errors if you move files
|
54
54
|
# around during development. It may not be that hard to set up. Low priority though.
|
55
55
|
if options.automatic_tree_updates
|
56
|
-
FileUtils.mkdir_p(app.
|
56
|
+
FileUtils.mkdir_p(app.config[:data_dir])
|
57
57
|
|
58
|
-
data_path = app.
|
58
|
+
data_path = app.config[:data_dir] + '/' + options.data_file
|
59
59
|
IO.write(data_path, YAML::dump(tree_hash))
|
60
60
|
end
|
61
61
|
end
|
@@ -75,7 +75,7 @@ module Middleman
|
|
75
75
|
next if options.ignore_files.include? filename
|
76
76
|
|
77
77
|
if options.promote_files.include? filename
|
78
|
-
original_path = path.sub(/^#{app.
|
78
|
+
original_path = path.sub(/^#{app.config[:source]}/, '') + '/' + filename
|
79
79
|
@existing_promotes << original_path
|
80
80
|
next
|
81
81
|
end
|
@@ -96,7 +96,7 @@ module Middleman
|
|
96
96
|
next unless options.ext_whitelist.include? File.extname(filename)
|
97
97
|
end
|
98
98
|
|
99
|
-
original_path = path.sub(/^#{app.
|
99
|
+
original_path = path.sub(/^#{app.config[:source]}/, '') + '/' + filename
|
100
100
|
data.store(filename.gsub(' ', '%20'), original_path.gsub(' ', '%20'))
|
101
101
|
end
|
102
102
|
end
|
@@ -11,12 +11,21 @@ module Middleman
|
|
11
11
|
# This is a file.
|
12
12
|
# Get the Sitemap resource for this file.
|
13
13
|
# note: sitemap.extensionless_path converts the path to its 'post-build' extension.
|
14
|
-
|
15
|
-
#
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
|
15
|
+
# Make sure the extension path ends with .html (in case we're parsing someting like .adoc)
|
16
|
+
extensionlessPath = sitemap.extensionless_path(value)
|
17
|
+
unless extensionlessPath.end_with? ".html"
|
18
|
+
extensionlessPath << ".html"
|
19
|
+
end
|
20
|
+
|
21
|
+
this_resource = sitemap.find_resource_by_path(extensionlessPath)
|
22
|
+
if this_resource
|
23
|
+
# Define string for active states.
|
24
|
+
active = this_resource == current_page ? 'active' : ''
|
25
|
+
title = discover_title(this_resource)
|
26
|
+
link = link_to(title, this_resource)
|
27
|
+
html << "<li class='child #{active}'>#{link}</li>"
|
28
|
+
end
|
20
29
|
else
|
21
30
|
# This is the first level source directory. We treat it special because
|
22
31
|
# it has no key and needs no list item.
|
data/middleman-navtree.gemspec
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
|
4
|
+
require 'date'
|
5
|
+
|
4
6
|
Gem::Specification.new do |s|
|
5
7
|
s.name = "middleman-navtree"
|
6
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.11"
|
7
9
|
s.licenses = ['MIT']
|
8
10
|
s.date = Date.today.to_s
|
9
11
|
|
@@ -21,6 +23,6 @@ Gem::Specification.new do |s|
|
|
21
23
|
s.require_paths = ["lib"]
|
22
24
|
|
23
25
|
# The version of middleman-core this extension depends on.
|
24
|
-
s.add_runtime_dependency("middleman-core", ["
|
26
|
+
s.add_runtime_dependency("middleman-core", [">= 3.3"])
|
25
27
|
s.add_runtime_dependency("titleize", ["~> 1.3"])
|
26
28
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-navtree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Braun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -75,17 +75,17 @@ require_paths:
|
|
75
75
|
- lib
|
76
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- -
|
78
|
+
- - '>='
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - '>='
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.0.14
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: For building navigation trees with Middleman
|