middleman-pagegroups 1.0.0

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.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Gemfile +18 -0
  5. data/LICENSE.md +22 -0
  6. data/README.md +87 -0
  7. data/Rakefile +10 -0
  8. data/bin/middleman-pagegroups +108 -0
  9. data/documentation_project/.gitignore +25 -0
  10. data/documentation_project/Gemfile +18 -0
  11. data/documentation_project/README.md +13 -0
  12. data/documentation_project/config.rb +109 -0
  13. data/documentation_project/source/documentation/10_concepts.html.md.erb +111 -0
  14. data/documentation_project/source/documentation/20_directory_organization.html.md.erb +85 -0
  15. data/documentation_project/source/documentation/30_frontmatter.html.md.erb +70 -0
  16. data/documentation_project/source/documentation/40_resources.html.md.erb +79 -0
  17. data/documentation_project/source/documentation/50_helpers.html.md.erb +252 -0
  18. data/documentation_project/source/documentation/60_sample_partials.html.md.erb +55 -0
  19. data/documentation_project/source/documentation/70_sample_layouts.html.md.erb +92 -0
  20. data/documentation_project/source/documentation/80_config.html.md.erb +98 -0
  21. data/documentation_project/source/documentation/index.html.md.erb +32 -0
  22. data/documentation_project/source/documentation/ovum.html.md.erb +27 -0
  23. data/documentation_project/source/fonts/font-awesome/FontAwesome.otf +0 -0
  24. data/documentation_project/source/fonts/font-awesome/fontawesome-webfont.eot +0 -0
  25. data/documentation_project/source/fonts/font-awesome/fontawesome-webfont.svg +655 -0
  26. data/documentation_project/source/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
  27. data/documentation_project/source/fonts/font-awesome/fontawesome-webfont.woff +0 -0
  28. data/documentation_project/source/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
  29. data/documentation_project/source/images/middleman-pagegroups-small.png +0 -0
  30. data/documentation_project/source/images/middleman-pagegroups.png +0 -0
  31. data/documentation_project/source/index.html.md.erb +39 -0
  32. data/documentation_project/source/javascripts/all.js +1 -0
  33. data/documentation_project/source/layouts/layout.haml +11 -0
  34. data/documentation_project/source/layouts/template-logo-large.haml +25 -0
  35. data/documentation_project/source/layouts/template-logo-medium.haml +26 -0
  36. data/documentation_project/source/layouts/template-logo-small.haml +26 -0
  37. data/documentation_project/source/license.html.md.erb +29 -0
  38. data/documentation_project/source/partials/_nav_breadcrumbs.haml +11 -0
  39. data/documentation_project/source/partials/_nav_breadcrumbs_alt.haml +15 -0
  40. data/documentation_project/source/partials/_nav_brethren.haml +18 -0
  41. data/documentation_project/source/partials/_nav_brethren_index.haml +14 -0
  42. data/documentation_project/source/partials/_nav_legitimate_children.haml +16 -0
  43. data/documentation_project/source/partials/_nav_prev_next.haml +21 -0
  44. data/documentation_project/source/partials/_nav_toc_index.haml +21 -0
  45. data/documentation_project/source/stylesheets/_github.scss +61 -0
  46. data/documentation_project/source/stylesheets/_middlemac_minimal.scss +668 -0
  47. data/documentation_project/source/stylesheets/_normalize.scss +374 -0
  48. data/documentation_project/source/stylesheets/breadcrumb-separator-light.png +0 -0
  49. data/documentation_project/source/stylesheets/style.css.scss +3 -0
  50. data/documentation_project/source/toc.html.md.erb +26 -0
  51. data/lib/middleman-pagegroups/extension.rb +431 -0
  52. data/lib/middleman-pagegroups/partials.rb +173 -0
  53. data/lib/middleman-pagegroups/version.rb +5 -0
  54. data/lib/middleman-pagegroups.rb +6 -0
  55. data/middleman-pagegroups.gemspec +26 -0
  56. metadata +140 -0
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: Welcome to <code>middleman-pagegroups</code>
3
+ blurb: <em>middleman-pageGroups</em> is a great way to serve organized content.
4
+ layout: template-logo-large
5
+ navigate: false
6
+ ---
7
+
8
+ # <%= current_page.data.title %>
9
+
10
+ Thanks for having a look at `middlemac-pagegroups`! This documentation is an
11
+ example of “eating your own dog food,” and uses the features of this extension
12
+ to demonstrate itself.
13
+
14
+ `middleman-pagegroups` principally enables **automatic navigation** via the
15
+ management of **sort order**, **groups** (including nested groups), and making
16
+ a determination about the **legitimacy** of these relationships.
17
+
18
+ It provides sample partials to enable **breadcrumbs**, **previous** and
19
+ **next** buttons, **tables of contents**, and **related pages**, all using the
20
+ concepts that enable automatic navigation.
21
+
22
+ The extension itself is quite simple; it adds a few methods to each resource
23
+ (those that you access with `current_page`, as well as several helpers, and if
24
+ you prefer to use partials, `middleman-pagegroups` can even generate some sample
25
+ partials for you.
26
+
27
+ * * *
28
+
29
+ <%= nav_legitimate_children %>
30
+
31
+ * * *
32
+
33
+ The table of contents above is the result of using the `nav_legitimate_children`
34
+ helper; all of the data comes automatically from the front matter of the files
35
+ that are part of this `source` group.
36
+
37
+ ~~~ erb
38
+ <%%= nav_legitimate_children %>
39
+ ~~~
@@ -0,0 +1 @@
1
+ // This is where it all goes :)
@@ -0,0 +1,11 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title= current_page.data.title || 'middleman-targets'
5
+ %meta{:content => 'text/html; charset=utf-8', :'http-equiv' => 'Content-Type'}/
6
+ = stylesheet_link_tag 'style'
7
+ = javascript_include_tag 'all'
8
+ %body{:class => "#{page_classes}"}
9
+ %nav#breadcrumbs
10
+ = nav_breadcrumbs_alt
11
+ = yield
@@ -0,0 +1,25 @@
1
+ = wrap_layout ('layout'.to_sym) do
2
+ .container-logo-large
3
+ %div
4
+ %div
5
+ = image_tag 'middleman-pagegroups-small.png', :alt => 'middleman-pagegroups logo'
6
+ %h1= "#{product_name}"
7
+ %h2= "version #{product_version}"
8
+ %a{:href => product_uri}= product_uri
9
+
10
+ - if content_for?(:seeAlso)
11
+ .related_topics
12
+ %h1 See Also
13
+ = yield_content :seeAlso
14
+
15
+ %div
16
+ .yield-content
17
+ ~ yield
18
+ - if current_page.navigator_eligible?
19
+ %hr
20
+ = nav_prev_next
21
+
22
+ -#
23
+ This template is suitable for your landing page or major sections, and features
24
+ a large version of your logo, the application name, and the application URI.
25
+ It can include optional :seeAlso content below the application URI.
@@ -0,0 +1,26 @@
1
+ = wrap_layout ('layout'.to_sym) do
2
+ .container-logo-medium
3
+ %div
4
+ .yield-content
5
+ ~ yield
6
+ - if current_page.navigator_eligible?
7
+ %hr
8
+ = nav_prev_next
9
+
10
+ %div
11
+ %div
12
+ = image_tag 'middleman-pagegroups-small.png', :alt => 'middleman-pagegroups logo'
13
+ .related_topics
14
+ %h1 Related Topics
15
+ = nav_brethren_index
16
+
17
+ - if content_for?(:seeAlso)
18
+ %h1 See Also
19
+ = yield_content :seeAlso
20
+
21
+ -#
22
+ This template is suitable for general pages within a group, as it makes
23
+ navigation between the different pages in the group obvious and easy. It
24
+ features a medium version of your logo on the right, followed by navigation
25
+ to the other pages in the group. Optionally :seeAlso content can follow the
26
+ related pages.
@@ -0,0 +1,26 @@
1
+ = wrap_layout ('layout'.to_sym) do
2
+ .container-logo-small
3
+ .yield-content
4
+ = image_tag 'middleman-pagegroups-small.png', :alt => 'middleman-pagegroups logo'
5
+ ~ yield
6
+ - if current_page.navigator_eligible?
7
+ %hr
8
+ = nav_prev_next
9
+
10
+ - if !current_page.brethren.to_a.empty? || content_for?(:seeAlso)
11
+ %hr/
12
+
13
+ .related_topics
14
+ %h1 Related Topics
15
+ = nav_brethren_index
16
+
17
+ - if content_for?(:seeAlso)
18
+ %h1 See Also
19
+ = yield_content :seeAlso
20
+
21
+ -#
22
+ This template is suitable for general pages that aren’t meant to participate
23
+ within a group. It does show related pages followed by :seeAlso content at
24
+ the bottom on the page, but it’s not as obvious for simple navigation as the
25
+ template-logo-medium. It features a small version of your help logo in the
26
+ top left, followed by the title.
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: The MIT License
3
+ blurb: Describes your legal rights and obligations for using these materials.
4
+ layout: template-logo-medium
5
+ order: 40
6
+ navigate: false
7
+ ---
8
+
9
+ # <%= current_page.data.title %>
10
+
11
+ **Copyright (c) 2016 Jim Derry**
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in
21
+ all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
+ THE SOFTWARE.
@@ -0,0 +1,11 @@
1
+ - pages = current_page.breadcrumbs
2
+ - unless pages.to_a.empty?
3
+ %div{:class => (defined?(klass) && klass) || nav_breadcrumbs_class}
4
+ %ul
5
+ - pages.each do |p|
6
+ %li= link_to p.data.title, p
7
+
8
+ -#
9
+ - This partial renders links into an <ul>.
10
+ - You probably need a class in order to render this properly.
11
+ - :klass - pass in this local to specify a class for the containing div.
@@ -0,0 +1,15 @@
1
+ - pages = current_page.breadcrumbs
2
+ - unless pages.to_a.empty?
3
+ %div{:class => (defined?(klass) && klass) || nav_breadcrumbs_alt_class}
4
+ %ul
5
+ - pages[0...pages.count-1].each do |p|
6
+ %li= link_to p.data.title, p
7
+ %li= (defined?(label) && label) || nav_breadcrumbs_alt_label
8
+
9
+ -#
10
+ - This partial renders links into an <ul>.
11
+ - You probably need a class in order to render this properly.
12
+ - This alternate version replaces the last link with the extension's
13
+ `nav_breadcrumbs_alt_label` value.
14
+ - :label - pass in this local instead of using the default.
15
+ - :klass - pass in this local to specify a class for the containing div.
@@ -0,0 +1,18 @@
1
+ - commence = (defined?(start) && start) || current_page
2
+ - pages = commence.brethren
3
+ - unless pages.to_a.empty?
4
+ %div{:class => (defined?(klass) && klass) || nav_brethren_class}
5
+ %dl
6
+ - pages.each do |p|
7
+ %dt<
8
+ = link_to p.data.title, p
9
+ - if p.data.blurb
10
+ %dd= p.data.blurb
11
+
12
+ -#
13
+ - This partial renders links with blurbs into a <dl> to serve as
14
+ a related links table of contents.
15
+ - You probably need a class in order to render this properly.
16
+ - For a compact form without blurbs, see also `_nav_brethren_index.haml.
17
+ - :klass - pass in this local to specify a class for the containing div.
18
+ - :start - pass in this local to specify a different starting point.
@@ -0,0 +1,14 @@
1
+ - commence = (defined?(start) && start) || current_page
2
+ - pages = commence.brethren
3
+ - unless pages.to_a.empty?
4
+ %div{:class => (defined?(klass) && klass) || nav_brethren_index_class}
5
+ %ul
6
+ - pages.each do |p|
7
+ %li= link_to p.data.title, p
8
+
9
+ -#
10
+ This partial renders brethren into an <ul> to serve as a related-pages type
11
+ of table of contents.
12
+ - You probably need a class in order to render this properly.
13
+ - :klass - pass in this local to specify a class for the containing div.
14
+ - :start - pass in this local to specify a different starting point.
@@ -0,0 +1,16 @@
1
+ - commence = (defined?(start) && start) || current_page
2
+ - pages = commence.legitimate_children
3
+ - unless pages.to_a.empty?
4
+ %div{:class => (defined?(klass) && klass) || nav_legitimate_children_class}
5
+ %dl
6
+ - pages.each do |p|
7
+ %dt= link_to p.data.title, p
8
+ - if p.data.blurb
9
+ %dd= p.data.blurb
10
+
11
+ -#
12
+ This partial renders links with blurbs into a <dl> to serve as a high-level
13
+ table of contents.
14
+ - You probably need a class in order to render this properly.
15
+ - :klass - pass in this local to specify a class for the containing div.
16
+ - :start - pass in this local to specify a different starting point.
@@ -0,0 +1,21 @@
1
+ - p_prev = current_page.brethren_previous
2
+ - p_next = current_page.brethren_next
3
+ - b_prev = (defined?(label_previous) && label_previous) || nav_prev_next_label_prev
4
+ - b_next = (defined?(label_next) && label_next) || nav_prev_next_label_next
5
+ %div{:class => (defined?(klass) && klass) || nav_prev_next_class}
6
+ - if p_prev.nil?
7
+ %span= b_prev
8
+ - else
9
+ = link_to b_prev, p_prev
10
+ - if p_next.nil?
11
+ %span= b_next
12
+ - else
13
+ = link_to b_next, p_next
14
+
15
+ -#
16
+ This partial renders a div with two spans that are suitable for use as
17
+ previous and next buttons when properly styled.
18
+ - You probably need a class in order to render this properly.
19
+ - :klass - pass in this local to specify a class for the containing div.
20
+ - :label_previous - the label for the Previous button. Default is "Previous".
21
+ - :label_next - the label for the Next button. Default is "Next".
@@ -0,0 +1,21 @@
1
+ - commence = (defined?(start) && start) || current_page
2
+ - pages = commence.legitimate_children
3
+ - if defined?(recurse) && recurse
4
+ - unless pages.to_a.empty?
5
+ %ul
6
+ - pages.each do |p|
7
+ %li<
8
+ = link_to p.data.title, p
9
+ = partial 'partials/toc_index', :locals => { :start => p, :recurse => true }
10
+ - else
11
+ %ul{:class => (defined?(klass) && klass) || nav_toc_index_class}
12
+ %li<
13
+ = link_to commence.data.title, commence
14
+ = partial 'partials/toc_index', :locals => { :start => commence, :recurse => true }
15
+
16
+ -#
17
+ - This partial renders nested links into an <ul>. The top level item is the
18
+ start page followed by the entire directory structure below it.
19
+ - You probably need a class in order to render this properly.
20
+ - :start - pass in this local to specify the starting page.
21
+ - :klass - pass in this local to specify a class for the containing div.
@@ -0,0 +1,61 @@
1
+ .hll { background-color: #ffffcc }
2
+ .c { color: #999988; font-style: italic } /* Comment */
3
+ .err { color: #a61717; background-color: #e3d2d2 } /* Error */
4
+ .k { color: #000000; font-weight: bold } /* Keyword */
5
+ .o { color: #000000; font-weight: bold } /* Operator */
6
+ .cm { color: #999988; font-style: italic } /* Comment.Multiline */
7
+ .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
8
+ .c1 { color: #999988; font-style: italic } /* Comment.Single */
9
+ .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
10
+ .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
11
+ .ge { color: #000000; font-style: italic } /* Generic.Emph */
12
+ .gr { color: #aa0000 } /* Generic.Error */
13
+ .gh { color: #999999 } /* Generic.Heading */
14
+ .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
15
+ .go { color: #888888 } /* Generic.Output */
16
+ .gp { color: #555555 } /* Generic.Prompt */
17
+ .gs { font-weight: bold } /* Generic.Strong */
18
+ .gu { color: #aaaaaa } /* Generic.Subheading */
19
+ .gt { color: #aa0000 } /* Generic.Traceback */
20
+ .kc { color: #000000; font-weight: bold } /* Keyword.Constant */
21
+ .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
22
+ .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
23
+ .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
24
+ .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
25
+ .kt { color: #445588; font-weight: bold } /* Keyword.Type */
26
+ .m { color: #009999 } /* Literal.Number */
27
+ .s { color: #d01040 } /* Literal.String */
28
+ .na { color: #008080 } /* Name.Attribute */
29
+ .nb { color: #0086B3 } /* Name.Builtin */
30
+ .nc { color: #445588; font-weight: bold } /* Name.Class */
31
+ .no { color: #008080 } /* Name.Constant */
32
+ .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
33
+ .ni { color: #800080 } /* Name.Entity */
34
+ .ne { color: #990000; font-weight: bold } /* Name.Exception */
35
+ .nf { color: #990000; font-weight: bold } /* Name.Function */
36
+ .nl { color: #990000; font-weight: bold } /* Name.Label */
37
+ .nn { color: #555555 } /* Name.Namespace */
38
+ .nt { color: #000080 } /* Name.Tag */
39
+ .nv { color: #008080 } /* Name.Variable */
40
+ .ow { color: #000000; font-weight: bold } /* Operator.Word */
41
+ .w { color: #bbbbbb } /* Text.Whitespace */
42
+ .mf { color: #009999 } /* Literal.Number.Float */
43
+ .mh { color: #009999 } /* Literal.Number.Hex */
44
+ .mi { color: #009999 } /* Literal.Number.Integer */
45
+ .mo { color: #009999 } /* Literal.Number.Oct */
46
+ .sb { color: #d01040 } /* Literal.String.Backtick */
47
+ .sc { color: #d01040 } /* Literal.String.Char */
48
+ .sd { color: #d01040 } /* Literal.String.Doc */
49
+ .s2 { color: #d01040 } /* Literal.String.Double */
50
+ .se { color: #d01040 } /* Literal.String.Escape */
51
+ .sh { color: #d01040 } /* Literal.String.Heredoc */
52
+ .si { color: #d01040 } /* Literal.String.Interpol */
53
+ .sx { color: #d01040 } /* Literal.String.Other */
54
+ .sr { color: #009926 } /* Literal.String.Regex */
55
+ .s1 { color: #d01040 } /* Literal.String.Single */
56
+ .ss { color: #990073 } /* Literal.String.Symbol */
57
+ .bp { color: #999999 } /* Name.Builtin.Pseudo */
58
+ .vc { color: #008080 } /* Name.Variable.Class */
59
+ .vg { color: #008080 } /* Name.Variable.Global */
60
+ .vi { color: #008080 } /* Name.Variable.Instance */
61
+ .il { color: #009999 } /* Literal.Number.Integer.Long */