programming-pages 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/elements/indices.html +16 -15
- data/_includes/scripts/indices.js +1 -1
- data/_includes/scripts/search.js +26 -8
- data/_includes/styles/kbd.css +20 -0
- data/_includes/styles/tweaks.css +36 -1
- data/_layouts/layout.html +1 -1
- data/_layouts/page.html +1 -1
- data/assets/site.css +1 -0
- data/screenshot.png +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d57b487009256e4b0e49d71617734cf316bfa4f5704a89c3cf1171ef13b62720
|
4
|
+
data.tar.gz: 663ae09708451c5dda16b720ff4ede925502f186104dd38a07d6325a6486f4a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e018ffd284f4e54e37410a202e1e785e379aa9a2fc15977b7e00c801490ec821adb0578733bc41d452ea82111b412aeb57c0df9be5417ed58096d30409b6364
|
7
|
+
data.tar.gz: 55a2609e7492ffb36adf12d142ab3ce533229f98e0f4e2824bd2079ad33237bd508ab79c7a0f2a1abbe745066fd75a44f69b35fa750109ff0374dcb127397625
|
@@ -1,11 +1,3 @@
|
|
1
|
-
<div class="ui inverted large menu">
|
2
|
-
<div class="item" style="padding-top: 1.6em;">
|
3
|
-
{% include elements/search.html %}
|
4
|
-
</div>
|
5
|
-
</div>
|
6
|
-
|
7
|
-
<div class="ui fitted inverted divider"></div>
|
8
|
-
|
9
1
|
{% assign collection_list = site.collections %}
|
10
2
|
|
11
3
|
{% assign ordered = '' | split: '' %}
|
@@ -25,13 +17,6 @@
|
|
25
17
|
{% assign endered = endered | sort: 'tab-order' | reverse %}
|
26
18
|
{% assign collection_list = ordered | concat: unorder | concat: endered %}
|
27
19
|
|
28
|
-
<div id="collection-tabs" class="ui inverted stackable pointing secondary menu">
|
29
|
-
{% for collection in collection_list %}
|
30
|
-
{% capture tab_class %}{% if forloop.first %}active {% endif %}item{% endcapture %}
|
31
|
-
<a class="{{ tab_class }}" data-tab="{{ collection.label | downcase }}">{{ collection.title }}</a>
|
32
|
-
{% endfor %}
|
33
|
-
</div>
|
34
|
-
|
35
20
|
{% for collection in collection_list %}
|
36
21
|
{% capture tab_class %}ui {% if forloop.first %}active {% endif %}inverted tab segment{% endcapture %}
|
37
22
|
<div class="{{ tab_class }}" data-tab="{{ collection.label | downcase }}">
|
@@ -212,3 +197,19 @@ so our strategy is to:
|
|
212
197
|
<br>
|
213
198
|
</div>
|
214
199
|
{% endfor %}
|
200
|
+
|
201
|
+
|
202
|
+
{%- comment %} these fixed items (search & collection tabs) need to be above the tab segments {% endcomment -%}
|
203
|
+
|
204
|
+
<div id="collection-tabs" class="ui inverted stackable pointing secondary fixed menu">
|
205
|
+
{% for collection in collection_list %}
|
206
|
+
{% capture tab_class %}{% if forloop.first %}active {% endif %}item{% endcapture %}
|
207
|
+
<a class="{{ tab_class }}" data-tab="{{ collection.label | downcase }}">{{ collection.title }}</a>
|
208
|
+
{% endfor %}
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<div class="ui inverted large fixed menu">
|
212
|
+
<div class="item">
|
213
|
+
{% include elements/search.html %}
|
214
|
+
</div>
|
215
|
+
</div>
|
@@ -3,7 +3,7 @@ set_indices_scrolltop = function() {
|
|
3
3
|
var active_item = $('#active-page-index').first();
|
4
4
|
if (active_item.length < 1) return;
|
5
5
|
|
6
|
-
var y = active_item.position().top;
|
6
|
+
var y = active_item.position().top - 50; {% comment %} an arbitrary amount below the collection-tabs element {% endcomment %}
|
7
7
|
$('#sidebar-fixed').scrollTop(y);
|
8
8
|
}
|
9
9
|
|
data/_includes/scripts/search.js
CHANGED
@@ -1,23 +1,41 @@
|
|
1
|
+
{% capture NL %}
|
2
|
+
{% endcapture%}
|
3
|
+
|
4
|
+
{% assign searchable_docs = site.pages | concat: site.documents | where_exp:'it','it.title.size > 0' %}
|
5
|
+
|
1
6
|
site_search_init = function() {
|
2
7
|
var search_content = [
|
3
|
-
{% for
|
4
|
-
|
5
|
-
|
6
|
-
{% capture url %}{{ doc.url }}#/{{ collection
|
7
|
-
{ title
|
8
|
-
|
9
|
-
|
8
|
+
{% for doc in searchable_docs %}
|
9
|
+
{% assign collection = doc.collection %}
|
10
|
+
{% if collection == 'posts' %}{% continue %}{% endif %}
|
11
|
+
{% assign url = doc.url %}{% if collection.size > 0 %}{% capture url %}{{ doc.url }}#/{{ collection | downcase }}/{% endcapture %}{% endif %}
|
12
|
+
{% assign title = doc.title | default: doc.name %}
|
13
|
+
{% assign category = doc.category | default: collection | default: '?' %}
|
14
|
+
{% assign tags = doc.search_tags %}
|
15
|
+
{% assign description = doc.description %}
|
16
|
+
{% comment %} placing string values in single quotes, so need to escape any within the string {% endcomment %}
|
17
|
+
{% if title == "'" %}{% assign title = "\'" %} {% comment %} allow title to be single char, assume other fields are not {% endcomment %}
|
18
|
+
{% elsif title contains "'" %}{% assign title = title | split: "'" | join: "\'" %}
|
19
|
+
{% endif %}
|
20
|
+
{% if tags contains "'" %}{% assign tags = tags | split: "'" | join: "\'" %}{% endif %}
|
21
|
+
{% if description.size > 0 %}{% assign description = description | split: NL | first | truncatewords: 7 | markdownify | rstrip %}{% endif %}
|
22
|
+
{% if description contains "'" %}{% assign description = description | split: "'" | join: "\'" %}{% endif %}
|
23
|
+
{% capture tags %}{% if tags.size > 0 %}, tags: '{{ tags }}'{% endif %}{% endcapture %}
|
24
|
+
{% capture desc %}{% if description.size > 0 %}, description: '{{ description }}'{% endif %}{% endcapture %}
|
25
|
+
{ title: '{{ title }}', category: '{{ category }}'{{ tags }}{{ desc }}, url: '{{ site.baseurl }}{{ url }}' },
|
10
26
|
{% endfor %}
|
11
27
|
];
|
12
28
|
|
13
29
|
{% comment %} urls are auto-followed, so no callback needed {% endcomment %}
|
14
30
|
$('#site-search').search({
|
31
|
+
type: 'category',
|
15
32
|
source: search_content,
|
33
|
+
searchFields: [ 'title', 'tags', 'category', 'description' ],
|
16
34
|
selectFirstResult: true,
|
17
35
|
});
|
18
36
|
|
19
37
|
{% comment %} set up shortut key for search input focus {% endcomment %}
|
20
|
-
Mousetrap.bind('s', function() { $(
|
38
|
+
Mousetrap.bind('s', function() { $('#site-search .prompt').focus(); return false; });
|
21
39
|
};
|
22
40
|
|
23
41
|
$(site_search_init);
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*!
|
2
|
+
* Remixed from StackOverflow <kbd> css, user Jin
|
3
|
+
* https://meta.superuser.com/questions/4788/css-for-the-new-kbd-style
|
4
|
+
* https://creativecommons.org/licenses/by-sa/3.0/
|
5
|
+
*/
|
6
|
+
kbd {
|
7
|
+
background-color: #f7f7f7;
|
8
|
+
border-radius: 3px;
|
9
|
+
border: 1px solid #ccc;
|
10
|
+
box-shadow: 0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
|
11
|
+
color: #333;
|
12
|
+
display: inline-block;
|
13
|
+
font-family: Arial,Helvetica,sans-serif;
|
14
|
+
font-size: 75%;
|
15
|
+
line-height: 140%;
|
16
|
+
margin: 0 .1em;
|
17
|
+
padding: .1em .6em;
|
18
|
+
text-shadow: 0 1px 0 #fff;
|
19
|
+
user-select: none;
|
20
|
+
}
|
data/_includes/styles/tweaks.css
CHANGED
@@ -111,6 +111,41 @@ sup:target::before {
|
|
111
111
|
font-size: /* 10 - 14px */ calc(10px + 4 * ((100vw - 320px) / (1910 - 320)));
|
112
112
|
}
|
113
113
|
|
114
|
+
/* add space underneath indices so bottom-most item can scroll into view */
|
115
|
+
#collection-indices {
|
116
|
+
padding-bottom: 75vh;
|
117
|
+
}
|
118
|
+
#collection-indices .ui.large.fixed.menu .item {
|
119
|
+
padding-top: 1.4em;
|
120
|
+
}
|
121
|
+
|
122
|
+
/* for sidebar fixed, keep search and tabs fixed at top */
|
123
|
+
#sidebar-fixed #collection-indices .ui.large.fixed.menu {
|
124
|
+
top: 3.5rem;
|
125
|
+
}
|
126
|
+
#sidebar-fixed #collection-indices .ui.tab.segment {
|
127
|
+
top: 5rem;
|
128
|
+
margin-top: 0;
|
129
|
+
}
|
130
|
+
#sidebar-fixed #collection-tabs {
|
131
|
+
top: 5.5rem;
|
132
|
+
background-color: #1b1c1d; /* FIXME: this should pull the semantic sass variable for inverted backgrounds: @black */
|
133
|
+
}
|
134
|
+
|
135
|
+
/* for sidebar retractable, items still need to be positioned, since they've been fixed */
|
136
|
+
/* FIXME: this is clunky and brittle */
|
137
|
+
#sidebar-retractable #collection-indices .ui.large.fixed.menu {
|
138
|
+
top: 0;
|
139
|
+
}
|
140
|
+
#sidebar-retractable #collection-indices .ui.tab.segment {
|
141
|
+
top: 8.5rem; /* TODO: use liquid to make this {{ num_collections*2.5+1 }}; */
|
142
|
+
margin-top: 0;
|
143
|
+
}
|
144
|
+
#sidebar-retractable #collection-tabs {
|
145
|
+
top: 2.5rem;
|
146
|
+
background-color: rgba(255,255,255,.08); /* FIXME: this should pull the semantic sass variable for .ui.inverted.menu a.item:hover: @invertedHoverBackground */
|
147
|
+
}
|
148
|
+
|
114
149
|
/* tweaks to existing semantic-ui rules */
|
115
150
|
#sidebar-retractable.ui.push.sidebar {
|
116
151
|
z-index: 100; /* underneath top fixed menu */
|
@@ -167,7 +202,7 @@ blockquote {
|
|
167
202
|
blockquote p {
|
168
203
|
display: inline;
|
169
204
|
}
|
170
|
-
code,
|
205
|
+
code, pre, samp {
|
171
206
|
font-family: Consolas,'Lucida Console','Andale Mono',monospace;
|
172
207
|
}
|
173
208
|
code.highlighter-rouge {
|
data/_layouts/layout.html
CHANGED
@@ -27,7 +27,7 @@ layout: page
|
|
27
27
|
{% endif %}
|
28
28
|
|
29
29
|
<div class="ui basic segment"><span class="anchor" id="description"> </span>
|
30
|
-
{% assign lines = page.description | split:
|
30
|
+
{% assign lines = page.description | newline_to_br | split: '<br />' %}
|
31
31
|
<p class="larger text">
|
32
32
|
{{ lines.first | markdownify | remove: '<p>' | remove: '</p>' }}
|
33
33
|
</p>
|
data/_layouts/page.html
CHANGED
data/assets/site.css
CHANGED
data/screenshot.png
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: programming-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pixeldroid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-pages
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- _includes/scripts/semantic-ui/sticky.min.js
|
93
93
|
- _includes/scripts/semantic-ui/tab.min.js
|
94
94
|
- _includes/scripts/semantic-ui/transition.min.js
|
95
|
+
- _includes/styles/kbd.css
|
95
96
|
- _includes/styles/semantic-ui/_version.css
|
96
97
|
- _includes/styles/semantic-ui/breadcrumb.min.css
|
97
98
|
- _includes/styles/semantic-ui/container.min.css
|