simple-jekyll-theme 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ {% if site.tags.size > 1 %}
2
+ <div class="separator"></div>
3
+ <div id="blog-list-mini" class="no-select">
4
+ <!-- https://longqian.me/2017/02/09/github-jekyll-tag/ -->
5
+ <!-- https://stackoverflow.com/questions/13025281/how-to-get-a-sorted-tags-list-in-jekyll -->
6
+ <h2>All Tags</h2>
7
+ <div class="tag" style="margin-bottom: 10px">
8
+ {% capture temptags %}
9
+ {% for tag in site.tags %}
10
+ {{ tag[1].size | plus: 1000 }}:{{ tag[0] }}{% unless forloop.last %},{% endunless %}
11
+ {% endfor %}
12
+ {% endcapture %}
13
+ {% assign sortedtemptags = temptags | split:',' | sort | reverse %}
14
+ {% for temptag in sortedtemptags %}
15
+ {% assign tagitems = temptag | split: ':' %}
16
+ <a href="{{ site.url }}/tags/{{ tagitems[1] | slugify }}"><code>{{ tagitems[1] | rstrip }}({{ tagitems[0] | to_integer | minus: 1000}})</code></a>
17
+ {% endfor %}
18
+ </div>
19
+ </div>
20
+ {% endif %}
@@ -0,0 +1,108 @@
1
+ {% capture tocWorkspace %}
2
+ {% comment %}
3
+ Version 1.0.12
4
+ https://github.com/allejo/jekyll-toc
5
+
6
+ "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
7
+
8
+ Usage:
9
+ {% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
10
+
11
+ Parameters:
12
+ * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
13
+
14
+ Optional Parameters:
15
+ * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
16
+ * class (string) : '' - a CSS class assigned to the TOC
17
+ * id (string) : '' - an ID to assigned to the TOC
18
+ * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
19
+ * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
20
+ * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
21
+ * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
22
+ * baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
23
+ * anchor_class (string) : '' - add custom class(es) for each anchor element
24
+ * skipNoIDs (bool) : false - skip headers that do not have an `id` attribute
25
+
26
+ Output:
27
+ An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
28
+ generate the table of contents and will NOT output the markdown given to it
29
+ {% endcomment %}
30
+
31
+ {% capture my_toc %}{% endcapture %}
32
+ {% assign orderedList = include.ordered | default: false %}
33
+ {% assign skipNoIDs = include.skipNoIDs | default: false %}
34
+ {% assign minHeader = include.h_min | default: 1 %}
35
+ {% assign maxHeader = include.h_max | default: 6 %}
36
+ {% assign nodes = include.html | split: '<h' %}
37
+ {% assign firstHeader = true %}
38
+
39
+ {% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}
40
+
41
+ {% for node in nodes %}
42
+ {% if node == "" %}
43
+ {% continue %}
44
+ {% endif %}
45
+
46
+ {% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
47
+
48
+ {% if headerLevel < minHeader or headerLevel > maxHeader %}
49
+ {% continue %}
50
+ {% endif %}
51
+
52
+ {% assign _workspace = node | split: '</h' %}
53
+
54
+ {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
55
+ {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
56
+ {% assign html_id = _idWorkspace[0] %}
57
+
58
+ {% assign _classWorkspace = _workspace[0] | split: 'class="' %}
59
+ {% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
60
+ {% assign html_class = _classWorkspace[0] %}
61
+
62
+ {% if html_class contains "no_toc" %}
63
+ {% continue %}
64
+ {% endif %}
65
+
66
+ {% if firstHeader %}
67
+ {% assign firstHeader = false %}
68
+ {% assign minHeader = headerLevel %}
69
+ {% endif %}
70
+
71
+ {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
72
+ {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
73
+
74
+ {% assign indentAmount = headerLevel | minus: minHeader %}
75
+ {% assign space = '' %}
76
+ {% for i in (1..indentAmount) %}
77
+ {% assign space = space | prepend: ' ' %}
78
+ {% endfor %}
79
+
80
+ {% if include.item_class and include.item_class != blank %}
81
+ {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
82
+ {% endif %}
83
+
84
+ {% capture anchor_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
85
+ {% capture anchor_body %}{{ anchor_body | replace: "|", "\|" }}{% endcapture %}
86
+
87
+ {% if html_id %}
88
+ {% capture list_item %}[{{ anchor_body }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% endcapture %}
89
+ {% elsif skipNoIDs == true %}
90
+ {% continue %}
91
+ {% else %}
92
+ {% capture list_item %}{{ anchor_body }}{% endcapture %}
93
+ {% endif %}
94
+
95
+ {% capture my_toc %}{{ my_toc }}
96
+ {{ space }}{{ listModifier }} {{ listItemClass }} {{ list_item }}{% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
97
+ {% endfor %}
98
+
99
+ {% if include.class and include.class != blank %}
100
+ {% capture my_toc %}{:.{{ include.class }}}
101
+ {{ my_toc | lstrip }}{% endcapture %}
102
+ {% endif %}
103
+
104
+ {% if include.id %}
105
+ {% capture my_toc %}{: #{{ include.id }}}
106
+ {{ my_toc | lstrip }}{% endcapture %}
107
+ {% endif %}
108
+ {% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
@@ -0,0 +1,10 @@
1
+ ---
2
+ # Jekyll layout that compresses HTML
3
+ # v3.1.0
4
+ # http://jch.penibelst.de/
5
+ # © 2014–2015 Anatol Broder
6
+ # MIT License
7
+ ---
8
+
9
+ {% capture _LINE_FEED %}
10
+ {% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs == "all" %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "<!-- -->" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}{% unless _pre_before contains "</pre>" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %} <table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile"> <thead> <tr> <td>Step <td>Bytes <tbody> <tr> <td>raw <td>{{ content | size }}{% if _profile_endings %} <tr> <td>endings <td>{{ _profile_endings }}{% endif %}{% if _profile_startings %} <tr> <td>startings <td>{{ _profile_startings }}{% endif %}{% if _profile_comments %} <tr> <td>comments <td>{{ _profile_comments }}{% endif %}{% if _profile_collapse %} <tr> <td>collapse <td>{{ _profile_collapse }}{% endif %}{% if _profile_clippings %} <tr> <td>clippings <td>{{ _profile_clippings }}{% endif %} </table>{% endif %}{% endif %}
@@ -0,0 +1,41 @@
1
+ ---
2
+ layout: compress
3
+ ---
4
+
5
+ <!DOCTYPE html>
6
+ <html lang="{{ site.lang }}">
7
+ {% include head.html %}
8
+ <body>
9
+ {% if site.google-tag-manager-id %}
10
+ <!-- Google Tag Manager (noscript) -->
11
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ site.google-tag-manager-id }}"
12
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
13
+ <!-- End Google Tag Manager (noscript) -->
14
+ {% endif %}
15
+
16
+ {% if site.font-awesome-kit %}{% else %}
17
+ {% include icons.html %}
18
+ {% endif %}
19
+
20
+ <div id="main-header" class="no-select">
21
+ <div class="container">
22
+ <a {% if page.layout != 'home' %}href="{{ site.url }}/index.html"{% endif %}>{{ site.title }}</a>
23
+ </div>
24
+ </div>
25
+
26
+ {% include navigation.html %}
27
+
28
+ <div class="container">
29
+
30
+ {{ content }}
31
+
32
+ {% include footer.html %}
33
+ </div>
34
+
35
+ {% if page.content contains '```' or page.layout == 'post' %}
36
+ <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>
37
+ {% endif %}
38
+ <script src="{{ site.url }}/assets/js/main.min.js"></script>
39
+ </body>
40
+ </html>
41
+
@@ -0,0 +1,25 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% if page.content.size > 0 %}
6
+ {{ content }}
7
+ <div class="separator"></div>
8
+ {% endif %}
9
+
10
+ <h1 class="header">Posts</h1>
11
+ <div id="blog-list" data-page="{{ paginator.page }}" data-totalPages="{{ paginator.total_pages }}">
12
+ {% for post in paginator.posts %}
13
+ {% include post-card.html %}
14
+ {% endfor %}
15
+ </div>
16
+
17
+ {% if paginator.total_pages > 1 %}
18
+ <button id="loadmore-btn">Load more...</button>
19
+ {% endif %}
20
+
21
+ {% include tag-cloud.html %}
22
+
23
+ {% if paginator.total_pages > 1 %}
24
+ <script src="{{ site.url }}/assets/js/pagination.min.js" defer></script>
25
+ {% endif %}
@@ -0,0 +1,59 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ <h1 class="header">{{ page.title }}</h1>
5
+ <div class="page-meta no-select">
6
+ <span class="date">{{ page.date | date: "%b %-d, %Y" }}</span>
7
+ {% if page.tags.size > 0 %}
8
+ <span class="tag">
9
+ {%- if site.font-awesome-kit -%}
10
+ <i class="fas fa-tag"></i>
11
+ {%- else -%}
12
+ <svg class="icon"><use xlink:href="#icon-tag-solid"></use></svg>
13
+ {%- endif -%}
14
+ {% for tag in page.tags %}<a href="{{ site.url }}/tags/{{ tag | slugify }}"><code>{{ tag }}</code></a>{% endfor %}
15
+ </span>
16
+ {% endif %}
17
+
18
+ <p>
19
+ <em>{{ page.description }}</em>
20
+ </p>
21
+ </div>
22
+
23
+ {% if page.toc %}
24
+ <div id="toc">
25
+ <h2 class="no-select">Contents</h2>
26
+ {% include toc.html html=content class='no-select' id='toc-list' skipNoIDs=true h_max=2 %}
27
+ </div>
28
+ {% endif %}
29
+
30
+ {{ content }}
31
+
32
+ {% if page.comments %}
33
+ <div class="separator"></div>
34
+ {% include comment.html %}
35
+ {% endif %}
36
+
37
+ {% if site.posts.size > 1 %}
38
+ <div class="separator"></div>
39
+ <div id="blog-list-mini" class="no-select">
40
+ <h2>Latest Posts</h2>
41
+ <ul>
42
+ {% for post in site.categories.posts limit:3 %}
43
+ {% if post.url != page.url %}
44
+ <li>
45
+ <a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a>
46
+ </li>
47
+ {% endif %}
48
+ {% endfor %}
49
+ </ul>
50
+ </div>
51
+ {% endif %}
52
+
53
+ <button id="share-btn" fallback-text="Link Copied" aria-label="Share This Post">
54
+ {% if site.font-awesome-kit %}
55
+ <i class="fas fa-share"></i>
56
+ {% else %}
57
+ <svg class="icon"><use xlink:href="#icon-share-solid"></use></svg>
58
+ {% endif %}
59
+ </button>
@@ -0,0 +1,19 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <h1 class="header">
6
+ {% if site.font-awesome-kit %}
7
+ <i class="fas fa-tag" style="font-size: 80%"></i>
8
+ {% else %}
9
+ <svg class="icon"><use xlink:href="#icon-tag-solid"></use></svg>
10
+ {% endif %}
11
+ {{ page.tag }}
12
+ </h1>
13
+ <div id="blog-list">
14
+ {% for post in site.tags[page.tag] %}
15
+ {% include post-card.html %}
16
+ {% endfor %}
17
+ </div>
18
+
19
+ {% include tag-cloud.html %}
@@ -0,0 +1,246 @@
1
+ // Blog
2
+
3
+ @mixin blog-critical{
4
+
5
+ .post-meta, .page-meta {
6
+ @include color(color, --gray-text, $gray_text);
7
+ font-size: $small;
8
+ }
9
+
10
+ .date{
11
+ margin-right: 10px;
12
+ }
13
+
14
+ .tag{
15
+ @include gray-link {display: inline-block;};
16
+ i, .icon {
17
+ font-size: 80%;
18
+ margin-right: 5px;
19
+ margin-left: 10px;
20
+ }
21
+ code {
22
+ margin: 0 5px;
23
+ white-space: nowrap;
24
+ }
25
+ }
26
+
27
+
28
+ #blog-list {
29
+ display: flex;
30
+ flex-direction: column;
31
+ align-items: center;
32
+
33
+ a{
34
+ text-decoration: none;
35
+ display: block;
36
+ width: 100%;
37
+ .card {
38
+ padding: 2% 5%;
39
+ margin: 10px auto;
40
+ }
41
+ .post-meta{
42
+ font-size: $footnotesize;
43
+ }
44
+ .post-title {
45
+ color: $blue;
46
+ font-size: $Large;
47
+ font-weight: 700;
48
+ }
49
+ .post-description {
50
+ font-size: $small
51
+ }
52
+ }
53
+
54
+ a:hover{
55
+ color: inherit;
56
+ .card{
57
+ @include float-card;
58
+ margin-top: 5px;
59
+ margin-bottom: 15px;
60
+ transition: 0.3s;
61
+ }
62
+ .post-title{
63
+ color: $blue_hover;
64
+ }
65
+ }
66
+
67
+ a:active {
68
+ .card {
69
+ margin: 10px auto;
70
+ box-shadow: none;
71
+ transition: none;
72
+ }
73
+ }
74
+ }
75
+
76
+
77
+ #loadmore-btn {
78
+ padding: 20px 0;
79
+ margin: 10px auto;
80
+ width: 100%;
81
+ color: $blue;
82
+ font-size: $large;
83
+ font-weight: 600;
84
+ background: none;
85
+ border: none;
86
+ }
87
+
88
+
89
+ #blog-list-mini{
90
+ padding: 2% 5%;
91
+ margin: 10px;
92
+ @include float-card;
93
+ }
94
+
95
+ @media only screen and (min-width: 1250px) and (min-height: 500px) {
96
+ #toc {
97
+ width: 13%;
98
+ max-width: 250px;
99
+ max-height: calc(100% - 300px);
100
+ position: fixed;
101
+ right: 2%;
102
+ top: 100px;
103
+ font-size: $footnotesize;
104
+ @include float-card;
105
+ padding: 15px;
106
+ overflow-y: scroll;
107
+ // https://stackoverflow.com/a/7993098/10365842
108
+ a {
109
+ display:inline-block;
110
+ text-decoration: none;
111
+ text-overflow: ellipsis;
112
+ overflow: hidden;
113
+ white-space: nowrap;
114
+ width: calc(100%);
115
+ }
116
+ h2 {
117
+ font-size: $normalsize;
118
+ }
119
+ ul {
120
+ padding-left: 20px;
121
+ list-style: none;
122
+ }
123
+ }
124
+
125
+ .active {
126
+ color: $blue;
127
+ }
128
+ }
129
+
130
+ }
131
+
132
+
133
+
134
+ @mixin blog-noncritical{
135
+
136
+ iframe {
137
+ border: none;
138
+ }
139
+
140
+ .iframecontainer {
141
+ height: 0;
142
+ padding-bottom: 56.25%;
143
+ width: 100%;
144
+ position: relative;
145
+ }
146
+
147
+ .iframecontainer > iframe {
148
+ position: absolute;
149
+ width: 95%;
150
+ height: 100%;
151
+ left: 2.5%;
152
+ box-shadow: 0 3px 20px rgba(0,0,0,0.1);
153
+
154
+ &[src*="slides"] {
155
+ width: 100%;
156
+ left: 0;
157
+ box-shadow: none;
158
+ }
159
+ }
160
+
161
+ #loadmore-btn{
162
+ &:hover {
163
+ @include float-card;
164
+ margin-top: 5px;
165
+ margin-bottom: 15px;
166
+ transition: 0.3s;
167
+ cursor: pointer;
168
+ color: $blue_hover;
169
+ }
170
+
171
+ &:active {
172
+ margin: 10px auto;
173
+ box-shadow: none;
174
+ transition: none;
175
+ }
176
+
177
+ &:disabled {
178
+ color: $gray_text;
179
+ @include color(color, --gray-text, $gray_text);
180
+ }
181
+ }
182
+
183
+ #share-btn{
184
+ position: fixed;
185
+ right: 60px;
186
+ bottom: 60px;
187
+ height: 50px;
188
+ width: 50px;
189
+ border-radius: 50%;
190
+ border: none;
191
+ color: #fff;
192
+ background-color: $blue;
193
+ box-shadow: 0 0 10px $blue_hover;
194
+ z-index: 10;
195
+
196
+ i, .icon {
197
+ position: absolute;
198
+ left: 50%;
199
+ top: 50%;
200
+ transform: translate(-50%, -50%);
201
+ font-size: 150%;
202
+ }
203
+
204
+ &:hover{
205
+ background-color: $blue_hover;
206
+ cursor: pointer;
207
+ }
208
+
209
+ &:active{
210
+ box-shadow: none;
211
+ }
212
+
213
+ @include phone {
214
+ right: 30px;
215
+ &:hover{
216
+ background-color: $blue;
217
+ }
218
+ }
219
+ }
220
+
221
+ .shared:before {
222
+ content: attr(fallback-text);
223
+ color: $blue;
224
+ font-size: $footnotesize;
225
+ font-weight: 600;
226
+ display: inline-block;
227
+ width: 100px;
228
+ position: relative;
229
+ left: 50%;
230
+ transform: translate(-50%, -50px);
231
+ text-align: center;
232
+ padding: 5px;
233
+ z-index: 1;
234
+ opacity: 0;
235
+ transition: opacity 0.3s;
236
+ border-radius: 5px;
237
+ @include color(background-color, --dark-frosted-glass, rgba(245, 247, 249, 0.5));
238
+ @include frosted-glass;
239
+ }
240
+
241
+ .shared:hover:before {
242
+ opacity: 1;
243
+ }
244
+
245
+ }
246
+