jekyll-theme-scrawl 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a3d9878c8f40e26d7cd23e682e55a30c91b613e
4
- data.tar.gz: 5c84b1d082d36a024b365454e0edcc69994dc192
3
+ metadata.gz: 5ed9d604e2e2ffd3dc87b309cfe666c7767c04d4
4
+ data.tar.gz: 06b298dd02d51fe900668c02a231da79bd683e14
5
5
  SHA512:
6
- metadata.gz: '04831e36e032ed616db48477a5f440593006f34c06531b2de935cbaf5b2617e15cdab8f1b5a925314be4162ac6700efa1f29ead7babb64dbd98cd0c618d41bcd'
7
- data.tar.gz: d50be685003490e25739989bb78911a49b57177b5606e7710c2676a09abfb863fbfaca701b10524cf09fc4245400f737ece50df2f2e071d375ffd0a84295452e
6
+ metadata.gz: ae0dd7a823b8287f75a2e120682851f6508fc77a6154583fa4e16ab8a953744b9048789658356a549ed003039ae9218ce424b058f46fc071491b5351be1e11ad
7
+ data.tar.gz: 300d28932f451b3a4d06f4aaa7e98215cd0a12ffc616178624e6a54b42b3d89f541b51da15d0ce08e002806b8c4a3638d3409b93ac3f33197d33ad556e1362c4
@@ -1,8 +1,14 @@
1
1
  document.addEventListener('turbolinks:load', function() {
2
- anchors.add();
2
+ anchors.options.visible = 'touch';
3
+ anchors.add('section h2[id], section h3[id], section h4[id], section h5[id], section h6[id]');
3
4
 
4
5
  $('toc', 'body').html(function () {
5
- var $headers = $(':header[id]');
6
+ var selector = $(this).data('selector');
7
+ if (!selector) {
8
+ selector = ':header[id]';
9
+ }
10
+
11
+ var $headers = $(this).nextAll(selector);
6
12
 
7
13
  if (!$headers.length) {
8
14
  return;
@@ -22,7 +28,7 @@ document.addEventListener('turbolinks:load', function() {
22
28
  };
23
29
 
24
30
  var buildRecursively = function (parent, headers, bullet) {
25
- var $previous = null;
31
+ var $previous = parent.$;
26
32
  while (headers.length) {
27
33
  var $header = $(headers[0]);
28
34
  var tagName = $header.prop('tagName');
@@ -42,7 +48,7 @@ document.addEventListener('turbolinks:load', function() {
42
48
  '$': $('<ol>'),
43
49
  'count': 0
44
50
  };
45
- buildRecursively(child, headers, bullet + parent.count + ".");
51
+ buildRecursively(child, headers, (parent.count > 0 ? bullet + parent.count + "." : ''));
46
52
  $previous.append(child.$);
47
53
  } else {
48
54
  return;
@@ -50,13 +56,13 @@ document.addEventListener('turbolinks:load', function() {
50
56
  }
51
57
  };
52
58
 
53
- var $toc = $('<ol>');
59
+ var $toc = $('<div class="toc">');
54
60
  buildRecursively(
55
- {'tagName': 'H1', '$': $toc, 'count': 0},
61
+ {'tagName': 'H0', '$': $toc, 'count': 0},
56
62
  $headers.toArray(),
57
63
  ""
58
64
  );
59
65
 
60
- return $('<div class="toc">').append($toc);
66
+ return $toc;
61
67
  });
62
68
  })
@@ -0,0 +1,22 @@
1
+ {% if site.pages %}
2
+ {% if page.nav_pages %}
3
+ {% assign docs = page.nav_pages %}
4
+ {% else %}
5
+ {% assign docs = site.pages %}
6
+ {% endif %}
7
+
8
+ {% assign docs = docs | where_exp: 'doc', 'doc.hide_in_nav != true' %}
9
+ {% assign docs = docs | where_exp: 'doc', 'doc.title' %}
10
+
11
+ <nav>
12
+ {% include nav_category.html docs=docs category_key='' category_title='' %}
13
+
14
+ {% if scrawl and scrawl.categories %}
15
+ {% assign ordered_categories = scrawl.categories | sort: 'order' %}
16
+ {% for category in ordered_categories %}
17
+ {% assign category_key = category.key | default: category.title %}
18
+ {% include nav_category.html docs=docs category_key=category.key category_title=category.title %}
19
+ {% endfor %}
20
+ {% endif %}
21
+ </nav>
22
+ {% endif %}
@@ -0,0 +1,19 @@
1
+ {% assign docs = include.docs | sort: 'order' %}
2
+ {% assign categories_with_pages = docs | group_by: 'category' | map: 'name' %}
3
+
4
+ {% if categories_with_pages contains include.category_key %}
5
+ <div class="nav-category">
6
+ {% if include.category_title and include.category_title != '' %}
7
+ <h2>{{ include.category_title }}</h2>
8
+ {% endif %}
9
+
10
+ <ul>
11
+ {% for doc in docs %}
12
+ {% assign doc_category = doc.category | default: '' %}
13
+ {% if doc_category == include.category_key %}
14
+ <li><a href="{{ doc.url | relative_url }}">{{ doc.title }}</a></li>
15
+ {% endif %}
16
+ {% endfor %}
17
+ </ul>
18
+ </div>
19
+ {% endif %}
@@ -0,0 +1,65 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ site.lang | default: "en-US" }}">
3
+ {% assign scrawl = site.data.scrawl %}
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+
9
+ <title>
10
+ {% if page.title == "Home" %}
11
+ {{ site.title }}
12
+ {% else %}
13
+ {{ page.title }} &middot; {{ site.title }}
14
+ {% endif %}
15
+ </title>
16
+
17
+ {% seo title=false %}
18
+
19
+ <link rel="stylesheet" href="{{ '/assets/styles.css?v=' | append: site.github.build_revision | relative_url }}">
20
+
21
+ <script src="{{ '/assets/scripts.js?v=' | append: site.github.build_revision | relative_url }}" defer></script>
22
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous" defer></script>
23
+ </head>
24
+ <body class="{{ page.width | default: site.default_width | default: 'fixed' }}">
25
+
26
+ <div class="container">
27
+ <header>
28
+ {% if site.title and site.title != page.title %}
29
+ <h1><a href="{{ "/" | absolute_url }}">{{ site.title }}</a></h1>
30
+ {% endif %}
31
+
32
+ {% if site.description %}
33
+ <p><small>{{ site.description | markdownify }}</small></p>
34
+ {% endif %}
35
+
36
+ {% include nav.html %}
37
+
38
+ </header>
39
+
40
+ <section class="markdown-body">
41
+ {{ content }}
42
+
43
+ <footer>
44
+ {% if site.github.private != true and site.github.license %}
45
+ <p>
46
+ This site is open source. {% github_edit_link "Improve this page" %}.
47
+ </p>
48
+ {% endif %}
49
+ </footer>
50
+ </section>
51
+
52
+ </div>
53
+
54
+ {% if site.google_analytics %}
55
+ <script>
56
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
57
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
58
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
59
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
60
+ ga('create', '{{ site.google_analytics }}', 'auto');
61
+ ga('send', 'pageview');
62
+ </script>
63
+ {% endif %}
64
+ </body>
65
+ </html>
data/_layouts/page.html CHANGED
@@ -1,77 +1,11 @@
1
- <!DOCTYPE html>
2
- <html lang="{{ site.lang | default: "en-US" }}">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width, initial-scale=1">
1
+ ---
2
+ layout: default
3
+ ---
7
4
 
8
- <title>
9
- {% if page.title == "Home" %}
10
- {{ site.title }}
11
- {% else %}
12
- {{ page.title }} &middot; {{ site.title }}
13
- {% endif %}
14
- </title>
5
+ {{ '# ' | append: page.title | markdownify }}
15
6
 
16
- {% seo title=false %}
7
+ {% if page.toc != false %}
8
+ <toc data-selector="{{ page.toc_selector | default: site.toc_selector | default: 'h2[id], h3[id], h4[id]' }}"></toc>
9
+ {% endif %}
17
10
 
18
- <link rel="stylesheet" href="{{ '/assets/styles.css?v=' | append: site.github.build_revision | relative_url }}">
19
-
20
- <script src="{{ '/assets/scripts.js?v=' | append: site.github.build_revision | relative_url }}" defer></script>
21
- <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous" defer></script>
22
- </head>
23
- <body class="{{ page.width | default: site.default_width | default: 'fixed' }}">
24
-
25
- <div class="container">
26
- <header>
27
- {% if site.title and site.title != page.title %}
28
- <h1><a href="{{ "/" | absolute_url }}">{{ site.title }}</a></h1>
29
- {% endif %}
30
-
31
- {% if site.description %}
32
- <p><small>{{ site.description | markdownify }}</small></p>
33
- {% endif %}
34
-
35
- {% if site.pages %}
36
- {% if page.nav_pages %}
37
- {% assign docs = page.nav_pages %}
38
- {% else %}
39
- {% assign docs = site.pages %}
40
- {% endif %}
41
- {% assign docs = docs | sort: 'order' %}
42
- <ul>
43
- {% for doc in docs %}
44
- {% if doc.hide_in_nav != true and doc.title %}
45
- <li><a href="{{ doc.url | relative_url }}">{{ doc.title }}</a></li>
46
- {% endif %}
47
- {% endfor %}
48
- </ul>
49
- {% endif %}
50
- </header>
51
-
52
- <section class="markdown-body">
53
- {{ content }}
54
-
55
- <footer>
56
- {% if site.github.private != true and site.github.license %}
57
- <p>
58
- This site is open source. {% github_edit_link "Improve this page" %}.
59
- </p>
60
- {% endif %}
61
- </footer>
62
- </section>
63
-
64
- </div>
65
-
66
- {% if site.google_analytics %}
67
- <script>
68
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
69
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
70
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
71
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
72
- ga('create', '{{ site.google_analytics }}', 'auto');
73
- ga('send', 'pageview');
74
- </script>
75
- {% endif %}
76
- </body>
77
- </html>
11
+ {{ content }}
@@ -0,0 +1,13 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% assign scrawl = site.data.scrawl %}
6
+
7
+ {{ '# ' | append: page.title | markdownify }}
8
+
9
+ <div class="sitemap">
10
+ {% include nav.html %}
11
+ </div>
12
+
13
+ {{ content }}
data/_sass/scrawl.scss CHANGED
@@ -25,17 +25,33 @@ header p {
25
25
  margin-bottom: 20px;
26
26
  }
27
27
 
28
- header ul {
28
+ nav ul {
29
29
  font-size: 16px;
30
30
  line-height: 1.5;
31
31
  }
32
32
 
33
- header ul li {
34
- padding: 3px 0;
33
+ nav ul li {
34
+ padding: 2px 0;
35
35
  }
36
36
 
37
- footer {
37
+ header nav h2 {
38
+ font-style: normal;
39
+ font-weight: bold;
40
+ color: #888;
41
+ padding-top: 15px;
42
+ padding-bottom: 4px;
43
+ font-size: 14px;
44
+ }
45
+
46
+ nav div:first-child h2 {
47
+ padding-top: 0;
48
+ }
49
+
50
+ footer p:first-child {
38
51
  text-align: right;
52
+ border-top: 1px solid #dbdddf;
53
+ margin-top: 25px;
54
+ padding-top: 15px;
39
55
  }
40
56
 
41
57
  .toc span {
@@ -55,6 +71,34 @@ footer {
55
71
  padding-left: 32px;
56
72
  }
57
73
 
74
+ a.anchorjs-link:hover {
75
+ text-decoration: none;
76
+ }
77
+
78
+ .sitemap {
79
+ nav {
80
+ padding: 0;
81
+ margin: 0;
82
+ list-style: none;
83
+
84
+ display: flex;
85
+
86
+ flex-flow: row wrap;
87
+ }
88
+
89
+ h2 {
90
+ border: 0;
91
+ padding: 0;
92
+ margin-top: 0;
93
+ }
94
+
95
+ .nav-category {
96
+ padding: 5px;
97
+ width: 230px;
98
+ margin-top: 10px;
99
+ }
100
+ }
101
+
58
102
  body.fluid {
59
103
  section {
60
104
  left: 295px;
metadata CHANGED
@@ -1,169 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-scrawl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Light
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-09 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: jekyll
14
+ name: github-pages
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.7'
19
+ version: '183'
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
- version: '3.7'
27
- - !ruby/object:Gem::Dependency
28
- name: jekyll-coffeescript
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.1'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.1'
41
- - !ruby/object:Gem::Dependency
42
- name: jekyll-gist
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.5'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.5'
55
- - !ruby/object:Gem::Dependency
56
- name: jekyll-github-metadata
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '2.9'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '2.9'
69
- - !ruby/object:Gem::Dependency
70
- name: jekyll-paginate
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.1'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.1'
83
- - !ruby/object:Gem::Dependency
84
- name: jekyll-relative-links
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.5.3
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.5.3
97
- - !ruby/object:Gem::Dependency
98
- name: jekyll-optional-front-matter
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 0.3.0
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 0.3.0
111
- - !ruby/object:Gem::Dependency
112
- name: jekyll-readme-index
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 0.2.0
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 0.2.0
125
- - !ruby/object:Gem::Dependency
126
- name: jekyll-default-layout
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 0.1.4
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 0.1.4
139
- - !ruby/object:Gem::Dependency
140
- name: jekyll-titles-from-headings
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 0.5.1
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 0.5.1
153
- - !ruby/object:Gem::Dependency
154
- name: jekyll-seo-tag
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '2.0'
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '2.0'
26
+ version: '183'
167
27
  description:
168
28
  email:
169
29
  - matt.light@lightdatasys.com
@@ -179,8 +39,11 @@ files:
179
39
  - _includes/js/script.js
180
40
  - _includes/js/turbolinks.LICENSE.txt
181
41
  - _includes/js/turbolinks.js
42
+ - _includes/nav.html
43
+ - _includes/nav_category.html
44
+ - _layouts/default.html
182
45
  - _layouts/page.html
183
- - _layouts/post.html
46
+ - _layouts/sitemap.html
184
47
  - _sass/jekyll-theme-scrawl.scss
185
48
  - _sass/normalize.LICENSE.txt
186
49
  - _sass/normalize.scss
data/_layouts/post.html DELETED
@@ -1,11 +0,0 @@
1
- ---
2
- layout: page
3
- ---
4
-
5
- {{ '# ' | append: page.title | markdownify }}
6
-
7
- {% if toc != false %}
8
- <toc></toc>
9
- {% endif %}
10
-
11
- {{ content }}