jekyll-theme-type 1.1 → 1.2

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
- SHA1:
3
- metadata.gz: a887f9c28935122ea7323b0c1c6b3da01271e277
4
- data.tar.gz: d3b5750a6bb40c7b9f0a2900e185176b18204331
2
+ SHA256:
3
+ metadata.gz: 7e8ee31c08e816cc07a6f281e63490a5ed50499ea4333dc6190d070fdc6cfe2a
4
+ data.tar.gz: d3827ae17395e8fd35ae888147cf33a9ef9d7f848de87419bd0b58599559074c
5
5
  SHA512:
6
- metadata.gz: 366a9adf069be4eb262ffe8b18a021fb909057335610978d35a2f67d7b0fd440e2974ce3960f58302c39f00840d77108db7c9ad9f7a5f91d21f4886a410f8d15
7
- data.tar.gz: b46f93b306d3e5069a0f9f6a76e97b85468cb9700b03ec56c06570a6f83cb174985ea10620eb8b25064247d1a807bb8865df41a168842ac02fc1cb71c50cf772
6
+ metadata.gz: 27de480cd93ec1feb799898d3e290082481225f45b335bc13c35f122da5eafdb0bbe21ff5d8d551ad31d3f012d4c8180a4ad6cd3cb2c3f6b765e4587b438fe65
7
+ data.tar.gz: 10b10f6cfbe5bfaee24e0cb13c8116428d2b030b5f5fe0f78de71bbb3c589e981a415a7b8ba6aa3f472271bf24e6871e9d798aac7fdd46f68e105ca76f5db84c
data/README.md CHANGED
@@ -20,7 +20,7 @@ Open `_config.yml` in a text editor to change most of the blog's settings.
20
20
 
21
21
  If a variable in this document is marked as "optional", disable the feature by removing all text from the variable. For example, to prevent the avatar from rendering in the header, the avatar line should read:
22
22
 
23
- ```
23
+ ```yml
24
24
  theme:
25
25
  title: Type Theme
26
26
  avatar:
@@ -36,7 +36,7 @@ The most common configurations, included here for guidance, are:
36
36
 
37
37
  Jekyll website *without* a subpath (such as a GitHub Pages website for a given username):
38
38
 
39
- ```
39
+ ```yml
40
40
  # SITE CONFIGURATION
41
41
  baseurl: ""
42
42
  url: "https://username.github.io"
@@ -44,7 +44,7 @@ url: "https://username.github.io"
44
44
 
45
45
  Jekyll website *with* subpath (like the Type Theme demo page):
46
46
 
47
- ```
47
+ ```yml
48
48
  # SITE CONFIGURATION
49
49
  baseurl: "/sub-directory"
50
50
  url: "https://username.github.io/"
@@ -120,7 +120,7 @@ Navigate to the `_sass > base` directory and open `_variables.scss` to change co
120
120
 
121
121
  Once you have loaded a Google Font in `config.yml`, you can integrate the fonts into your CSS by changing the font-family in `_variables.scss`. For example, after loading the Playfair Display and PT Sans fonts from Google:
122
122
 
123
- ```
123
+ ```css
124
124
  // Typography
125
125
  $font-family-main: 'PT Sans', Helvetica, Arial, sans-serif;
126
126
  $font-family-headings: 'Playfair Display', Helvetica, Arial, sans-serif;
@@ -128,9 +128,47 @@ $font-family-headings: 'Playfair Display', Helvetica, Arial, sans-serif;
128
128
 
129
129
  Mozilla's [ColorPicker](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Colors/Color_picker_tool) is a helpful tool to get your preferred colours in hexadecimal or RGBA form for use in `_variables.scss`.
130
130
 
131
- ### Favicon
131
+ ### Customize style when using the remote_theme
132
+
133
+ If you're using Type Theme as a `remote_theme`, you can override variables and styles.
134
+ To do so, simply create a `assets/css/main.scss` file on your website with the following content:
135
+
136
+ ```scss
137
+ // assets/css/main.scss
138
+ ---
139
+ ---
140
+
141
+ @import "type-theme";
142
+ ```
143
+
144
+ `@import "type-theme";` is including the theme styles, so you can add custom imports before and after it, depending on your needs.
145
+ Best practice is to put your custom files in the `_sass` folder of your progect. Jekyll will automatically look for them there.
146
+ For example, say you wanted to override some theme variables and add some custom styles, you can create the following files:
147
+
148
+ ```scss
149
+ // _sass/_variables.scss
150
+ $background-color: black;
151
+ ```
132
152
 
133
- To change your favicon, usually displayed in the browser, place an ICO file named `favicon.ico` in the root directory of your blog.
153
+ ```sass
154
+ // _sass/_custom.sass
155
+
156
+ // SASS is supported as well, just note the file extension is .sass
157
+ .feature-image header
158
+ height: 300px
159
+ ```
160
+
161
+ Then import them both into `main.scss`:
162
+
163
+ ```scss
164
+ // assets/css/main.scss
165
+ ---
166
+ ---
167
+
168
+ @import "variables";
169
+ @import "type-theme";
170
+ @import "custom";
171
+ ```
134
172
 
135
173
  ## Posts and pages in Type Theme
136
174
  Please refer to the [Jekyll docs for writing posts](https://jekyllrb.com/docs/posts/). Non-standard features are documented below.
@@ -140,13 +178,13 @@ Wrap math expressions with `$$` signs in your posts and make sure you have set t
140
178
 
141
179
  For inline math typesetting, type your math expression on the *same line* as your content. For example:
142
180
 
143
- ```
181
+ ```latex
144
182
  Type math within a sentence $$2x^2 + x + c$$ to display inline
145
183
  ```
146
184
 
147
185
  For display math typesetting, type your math expression on a *new line*. For example:
148
186
 
149
- ```
187
+ ```latex
150
188
  $$
151
189
  \bar{y} = {1 \over n} \sum_{i = 1}^{n}y_i
152
190
  $$
@@ -162,7 +200,7 @@ Add a feature image by specifying a path to an image in the [front matter](http:
162
200
 
163
201
  For example:
164
202
 
165
- ```
203
+ ```yml
166
204
  ---
167
205
  layout: post
168
206
  title: Hello World
@@ -170,13 +208,24 @@ feature-img: "assets/img/sample_feature_img.png"
170
208
  ---
171
209
  ```
172
210
 
211
+ By default, the page title is displayed on top of the feature image, as well as on the browser's tab. You can change the feature image's displayed title by specifying a `feature-title` in the front matter:
212
+
213
+ ```yml
214
+ ---
215
+ layout: post
216
+ title: Short title
217
+ feature-title: A much longer title
218
+ feature-img: "assets/img/sample_feature_img.png"
219
+ ---
220
+ ```
221
+
173
222
  ### Hiding pages from navigation
174
223
 
175
- In the Front Matter of a page, add `hide: true` to prevent the page from showing up in the header's navigation bar (visitors can still visit the URL through other means).
224
+ In the front matter of a page, add `hide: true` to prevent the page from showing up in the header's navigation bar (visitors can still visit the URL through other means).
176
225
 
177
226
  For example:
178
227
 
179
- ```
228
+ ```yml
180
229
  ---
181
230
  layout: page
182
231
  title: "Error 404: Page not found"
@@ -185,13 +234,31 @@ hide: true
185
234
  ---
186
235
  ```
187
236
 
237
+ ### Sorting pages in navigation
238
+
239
+ You can configure this theme to **sort your pages** in the header's navigation bar.
240
+
241
+ - Set `site_navigation_sort` in theme settings to a property name e.g. `'order'`
242
+ - In the front matter of a non-hidden page, add `order: n`
243
+
244
+ For example:
245
+
246
+ ```yml
247
+ ---
248
+ layout: page
249
+ title: Team
250
+ permalink: /team/
251
+ order: 4
252
+ ---
253
+ ```
254
+
188
255
  ### Tags
189
256
 
190
257
  Post tags should be placed between `[]` in your post metadata. Seperate each tag with a comma.
191
258
 
192
259
  For example:
193
260
 
194
- ```
261
+ ```yml
195
262
  ---
196
263
  layout: post
197
264
  title: Markdown and HTML
@@ -201,6 +268,17 @@ tags: [sample, markdown, html]
201
268
 
202
269
  A tags listing will be automatically generated using the `tags.html` file provided in Type theme. If you're not using the tags feature it is safe to delete `tags.html`.
203
270
 
271
+ ### Search
272
+
273
+ The search feature can be activated in the `_config.yml` file by changing its value from `false` to `true`.
274
+
275
+ ```yml
276
+ #Scripts
277
+ search: true
278
+ ```
279
+
280
+ Once activated, the search bar will appear in the header. This feature uses [Lunr](https://lunrjs.com/) and searches through the title, tags and content of your posts.
281
+
204
282
  ### Subtitles
205
283
  A subtitle can be displayed below your title on permalink post pages.
206
284
 
@@ -208,7 +286,7 @@ To enable this feature, add `subtitle` to your post metadata.
208
286
 
209
287
  For example:
210
288
 
211
- ```
289
+ ```yml
212
290
  ---
213
291
  layout: post
214
292
  title: "This is a title"
@@ -1,5 +1,5 @@
1
- {% if site.theme_settings.katex %}
2
- <script src="{{ "/assets/js/katex_init.js" | prepend: site.baseurl }}"></script>
1
+ {% if site.theme_settings.katex and page.id %}
2
+ <script src="{{ "/assets/js/katex_init.js" | relative_url }}"></script>
3
3
  {% endif %}
4
4
 
5
5
  {% if site.theme_settings.footer_text %}
@@ -5,19 +5,19 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
 
7
7
  <!-- CSS -->
8
- <link rel="stylesheet" href="{{ "/assets/css/main.css" | prepend: site.baseurl }}">
8
+ <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
9
9
 
10
10
  <!--Favicon-->
11
- <link rel="shortcut icon" href="{{ "/favicon.ico" | prepend: site.baseurl }}" type="image/x-icon">
11
+ <link rel="shortcut icon" href="{{ site.baseurl }}/{{ site.theme_settings.favicon }}" type="image/x-icon">
12
12
 
13
13
  <!-- Canonical -->
14
- <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
14
+ <link rel="canonical" href="{{ page.url | replace:'index.html','' | relative_url }}">
15
15
 
16
16
  <!-- RSS -->
17
- <link rel="alternate" type="application/atom+xml" title="{{ site.theme_settings.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
17
+ <link rel="alternate" type="application/atom+xml" title="{{ site.theme_settings.title }}" href="{{ "/feed.xml" | relative_url }}" />
18
18
 
19
19
  <!-- Font Awesome -->
20
- <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
20
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
21
21
 
22
22
  <!-- Google Fonts -->
23
23
  {% if site.theme_settings.google_fonts %}
@@ -25,9 +25,9 @@
25
25
  {% endif %}
26
26
 
27
27
  <!-- KaTeX -->
28
- {% if site.theme_settings.katex %}
29
- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.8.3/katex.min.css">
30
- <script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.8.3/katex.min.js"></script>
28
+ {% if site.theme_settings.katex and page.id %}
29
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0-alpha/dist/katex.min.css" integrity="sha384-BTL0nVi8DnMrNdMQZG1Ww6yasK9ZGnUxL1ZWukXQ7fygA1py52yPp9W4wrR00VML" crossorigin="anonymous">
30
+ <script src="https://cdn.jsdelivr.net/npm/katex@0.10.0-alpha/dist/katex.min.js" integrity="sha384-y6SGsNt7yZECc4Pf86XmQhC4hG2wxL6Upkt9N1efhFxfh6wlxBH0mJiTE8XYclC1" crossorigin="anonymous"></script>
31
31
  {% endif %}
32
32
 
33
33
  <!-- Google Analytics -->
@@ -15,17 +15,35 @@
15
15
  </div>
16
16
  <nav class="site-nav">
17
17
  <ul>
18
- {% for page in site.pages %}
18
+ {% if site.theme_settings.site_navigation_sort %}
19
+ {% assign site_pages = site.pages | sort: site.theme_settings.site_navigation_sort %}
20
+ {% else %}
21
+ {% assign site_pages = site.pages %}
22
+ {% endif %}
23
+ {% for page in site_pages %}
19
24
  {% if page.title and page.hide != true %}
20
25
  <li>
21
- <a class="page-link" href="{{ page.url | prepend: site.baseurl }}">
26
+ <a class="page-link" href="{{ page.url | relative_url }}">
22
27
  {{ page.title }}
23
28
  </a>
24
29
  </li>
25
30
  {% endif %}
26
31
  {% endfor %}
27
- <!-- Social icons from Font Awesome, if enabled -->
32
+ <!-- Social icons from Font Awesome, if enabled -->
28
33
  {% include icons.html %}
34
+
35
+ <!-- Search bar -->
36
+ {% if site.theme_settings.search %}
37
+ <li>
38
+ <form action="{{ site.baseurl }}/search.html" method="get">
39
+ <input type="text" id="search-box" name="query" placeholder="Search" class="">
40
+ <button type="submit" class="">
41
+ <i class="fa fa-fw fa-search"></i>
42
+ </button>
43
+ </form>
44
+ </li>
45
+ {% endif %}
29
46
  </ul>
30
47
  </nav>
48
+
31
49
  </header>
@@ -1,7 +1,7 @@
1
1
  {% if site.theme_settings.rss %}
2
2
  <li>
3
- <a href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" title="{{ site.theme_settings.str_rss_follow }}">
4
- <i class="fa fa-fw fa-rss"></i>
3
+ <a href="{{ "/feed.xml" | relative_url }}" title="{{ site.theme_settings.str_rss_follow }}">
4
+ <i class="fas fa-fw fa-rss"></i>
5
5
  </a>
6
6
  </li>
7
7
  {% endif %}
@@ -9,7 +9,7 @@
9
9
  {% if site.theme_settings.email_address %}
10
10
  <li>
11
11
  <a href="mailto:{{ site.theme_settings.email_address }}" title="{{ site.theme_settings.str_email }}">
12
- <i class="fa fa-fw fa-envelope"></i>
12
+ <i class="fas fa-fw fa-envelope"></i>
13
13
  </a>
14
14
  </li>
15
15
  {% endif %}
@@ -17,7 +17,7 @@
17
17
  {% if site.theme_settings.behance %}
18
18
  <li>
19
19
  <a href="https://www.behance.net/{{ site.theme_settings.behance }}" title="{{ site.theme_settings.str_follow_on }} Behance">
20
- <i class="fa fa-fw fa-behance"></i>
20
+ <i class="fab fa-fw fa-behance"></i>
21
21
  </a>
22
22
  </li>
23
23
  {% endif %}
@@ -25,7 +25,7 @@
25
25
  {% if site.theme_settings.bitbucket %}
26
26
  <li>
27
27
  <a href="https://bitbucket.org/{{ site.theme_settings.bitbucket }}" title="{{ site.theme_settings.str_follow_on }} Bitbucket">
28
- <i class="fa fa-fw fa-bitbucket"></i>
28
+ <i class="fab fa-fw fa-bitbucket"></i>
29
29
  </a>
30
30
  </li>
31
31
  {% endif %}
@@ -33,7 +33,7 @@
33
33
  {% if site.theme_settings.dribbble %}
34
34
  <li>
35
35
  <a href="https://dribbble.com/{{ site.theme_settings.dribbble }}" title="{{ site.theme_settings.str_follow_on }} Dribbble">
36
- <i class="fa fa-fw fa-dribbble"></i>
36
+ <i class="fab fa-fw fa-dribbble"></i>
37
37
  </a>
38
38
  </li>
39
39
  {% endif %}
@@ -41,7 +41,7 @@
41
41
  {% if site.theme_settings.facebook %}
42
42
  <li>
43
43
  <a href="https://www.facebook.com/{{ site.theme_settings.facebook }}" title="{{ site.theme_settings.str_follow_on }} Facebook">
44
- <i class="fa fa-fw fa-facebook"></i>
44
+ <i class="fab fa-fw fa-facebook"></i>
45
45
  </a>
46
46
  </li>
47
47
  {% endif %}
@@ -49,7 +49,7 @@
49
49
  {% if site.theme_settings.flickr %}
50
50
  <li>
51
51
  <a href="https://www.flickr.com/photos/{{ site.theme_settings.flickr }}" title="{{ site.theme_settings.str_follow_on }} Flickr">
52
- <i class="fa fa-fw fa-flickr"></i>
52
+ <i class="fab fa-fw fa-flickr"></i>
53
53
  </a>
54
54
  </li>
55
55
  {% endif %}
@@ -57,7 +57,7 @@
57
57
  {% if site.theme_settings.github %}
58
58
  <li>
59
59
  <a href="https://github.com/{{ site.theme_settings.github }}" title="{{ site.theme_settings.str_follow_on }} GitHub">
60
- <i class="fa fa-fw fa-github"></i>
60
+ <i class="fab fa-fw fa-github"></i>
61
61
  </a>
62
62
  </li>
63
63
  {% endif %}
@@ -65,7 +65,7 @@
65
65
  {% if site.theme_settings.google_plus %}
66
66
  <li>
67
67
  <a href="https://plus.google.com/{{ site.theme_settings.google_plus }}" title="{{ site.theme_settings.str_follow_on }} Google+">
68
- <i class="fa fa-fw fa-google-plus"></i>
68
+ <i class="fab fa-fw fa-google-plus"></i>
69
69
  </a>
70
70
  </li>
71
71
  {% endif %}
@@ -73,7 +73,7 @@
73
73
  {% if site.theme_settings.instagram %}
74
74
  <li>
75
75
  <a href="http://instagram.com/{{ site.theme_settings.instagram }}" title="{{ site.theme_settings.str_follow_on }} Instagram">
76
- <i class="fa fa-fw fa-instagram"></i>
76
+ <i class="fab fa-fw fa-instagram"></i>
77
77
  </a>
78
78
  </li>
79
79
  {% endif %}
@@ -81,7 +81,7 @@
81
81
  {% if site.theme_settings.linkedin %}
82
82
  <li>
83
83
  <a href="{{ site.theme_settings.linkedin }}" title="{{ site.theme_settings.str_follow_on }} LinkedIn">
84
- <i class="fa fa-fw fa-linkedin"></i>
84
+ <i class="fab fa-fw fa-linkedin"></i>
85
85
  </a>
86
86
  </li>
87
87
  {% endif %}
@@ -89,7 +89,7 @@
89
89
  {% if site.theme_settings.pinterest %}
90
90
  <li>
91
91
  <a href="http://www.pinterest.com/{{ site.theme_settings.pinterest }}" title="{{ site.theme_settings.str_follow_on }} Pinterest">
92
- <i class="fa fa-fw fa-pinterest"></i>
92
+ <i class="fab fa-fw fa-pinterest"></i>
93
93
  </a>
94
94
  </li>
95
95
  {% endif %}
@@ -97,7 +97,7 @@
97
97
  {% if site.theme_settings.reddit %}
98
98
  <li>
99
99
  <a href="https://www.reddit.com/user/{{ site.theme_settings.reddit }}" title="{{ site.theme_settings.str_follow_on }} Reddit">
100
- <i class="fa fa-fw fa-reddit"></i>
100
+ <i class="fab fa-fw fa-reddit"></i>
101
101
  </a>
102
102
  </li>
103
103
  {% endif %}
@@ -105,7 +105,7 @@
105
105
  {% if site.theme_settings.soundcloud %}
106
106
  <li>
107
107
  <a href="https://soundcloud.com/{{ site.theme_settings.soundcloud }}" title="{{ site.theme_settings.str_follow_on }} SoundCloud">
108
- <i class="fa fa-fw fa-soundcloud"></i>
108
+ <i class="fab fa-fw fa-soundcloud"></i>
109
109
  </a>
110
110
  </li>
111
111
  {% endif %}
@@ -113,7 +113,7 @@
113
113
  {% if site.theme_settings.stack_exchange %}
114
114
  <li>
115
115
  <a href="{{ site.theme_settings.stack_exchange }}" title="{{ site.theme_settings.str_follow_on }} Stack Exchange">
116
- <i class="fa fa-fw fa-stack-exchange"></i>
116
+ <i class="fab fa-fw fa-stack-exchange"></i>
117
117
  </a>
118
118
  </li>
119
119
  {% endif %}
@@ -121,7 +121,7 @@
121
121
  {% if site.theme_settings.steam %}
122
122
  <li>
123
123
  <a href="http://steamcommunity.com/id/{{ site.theme_settings.steam }}" title="{{ site.theme_settings.str_follow_on }} Steam">
124
- <i class="fa fa-fw fa-steam"></i>
124
+ <i class="fab fa-fw fa-steam"></i>
125
125
  </a>
126
126
  </li>
127
127
  {% endif %}
@@ -129,7 +129,7 @@
129
129
  {% if site.theme_settings.tumblr %}
130
130
  <li>
131
131
  <a href="http://{{ site.theme_settings.tumblr }}.tumblr.com/" title="{{ site.theme_settings.str_follow_on }} Tumblr">
132
- <i class="fa fa-fw fa-tumblr"></i>
132
+ <i class="fab fa-fw fa-tumblr"></i>
133
133
  </a>
134
134
  </li>
135
135
  {% endif %}
@@ -137,7 +137,7 @@
137
137
  {% if site.theme_settings.gitlab %}
138
138
  <li>
139
139
  <a href="https://gitlab.com/{{ site.theme_settings.gitlab }}" title="{{ site.theme_settings.str_follow_on }} Gitlab">
140
- <i class="fa fa-fw fa-gitlab"></i>
140
+ <i class="fab fa-fw fa-gitlab"></i>
141
141
  </a>
142
142
  </li>
143
143
  {% endif %}
@@ -145,7 +145,7 @@
145
145
  {% if site.theme_settings.twitter %}
146
146
  <li>
147
147
  <a href="https://twitter.com/{{ site.theme_settings.twitter }}" title="{{ site.theme_settings.str_follow_on }} Twitter">
148
- <i class="fa fa-fw fa-twitter"></i>
148
+ <i class="fab fa-fw fa-twitter"></i>
149
149
  </a>
150
150
  </li>
151
151
  {% endif %}
@@ -153,7 +153,7 @@
153
153
  {% if site.theme_settings.wordpress %}
154
154
  <li>
155
155
  <a href="https://{{ site.theme_settings.wordpress }}.wordpress.com/" title="{{ site.theme_settings.str_follow_on }} WordPress">
156
- <i class="fa fa-fw fa-wordpress"></i>
156
+ <i class="fab fa-fw fa-wordpress"></i>
157
157
  </a>
158
158
  </li>
159
159
  {% endif %}
@@ -161,7 +161,15 @@
161
161
  {% if site.theme_settings.youtube %}
162
162
  <li>
163
163
  <a href="https://www.youtube.com/user/{{ site.theme_settings.youtube }}" title="{{ site.theme_settings.str_follow_on }} YouTube">
164
- <i class="fa fa-fw fa-youtube"></i>
164
+ <i class="fab fa-fw fa-youtube"></i>
165
+ </a>
166
+ </li>
167
+ {% endif %}
168
+
169
+ {% if site.theme_settings.gitter %}
170
+ <li>
171
+ <a href="https://gitter.im/{{ site.theme_settings.gitter }}" title="{{ site.theme_settings.str_follow_on }} Gitter">
172
+ <i class="fab fa-fw fa-gitter"></i>
165
173
  </a>
166
174
  </li>
167
175
  {% endif %}
@@ -2,7 +2,7 @@
2
2
  <footer>
3
3
  <div class="tags">
4
4
  {% for tag in include.tags %}
5
- <a class="tag" href="{{site.baseurl}}/tags#{{tag}}">#{{tag}}</a>
5
+ <a class="tag" href="{{site.baseurl}}/tags#{{ tag | cgi_escape }}">#{{tag}}</a>
6
6
  {% endfor %}
7
7
  </div>
8
8
  </footer>
@@ -15,7 +15,7 @@ layout: default
15
15
  <div class="post-teaser">
16
16
  <header>
17
17
  <h1>
18
- <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">
18
+ <a class="post-link" href="{{ post.url | relative_url }}">
19
19
  {{ post.title }}
20
20
  </a>
21
21
  </h1>
@@ -25,7 +25,7 @@ layout: default
25
25
  </header>
26
26
  <div class="excerpt">
27
27
  {{ post.excerpt }}
28
- <a class="button" href="{{ post.url | prepend: site.baseurl }}">
28
+ <a class="button" href="{{ post.url | relative_url }}">
29
29
  {{ site.theme_settings.str_continue_reading }}
30
30
  </a>
31
31
  </div>
@@ -36,13 +36,13 @@ layout: default
36
36
  {% if paginator.total_pages > 1 %}
37
37
  <div class="pagination">
38
38
  {% if paginator.previous_page %}
39
- <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="button" >
39
+ <a href="{{ paginator.previous_page_path | relative_url | replace: '//', '/' }}" class="button" >
40
40
  <i class="fa fa-chevron-left"></i>
41
41
  {{ site.theme_settings.str_previous_page }}
42
42
  </a>
43
43
  {% endif %}
44
44
  {% if paginator.next_page %}
45
- <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="button" >
45
+ <a href="{{ paginator.next_page_path | relative_url | replace: '//', '/' }}" class="button" >
46
46
  {{ site.theme_settings.str_next_page }}
47
47
  <i class="fa fa-chevron-right"></i>
48
48
  </a>
@@ -3,8 +3,8 @@ layout: default
3
3
  ---
4
4
  <article {% if page.feature-img %}class="feature-image"{% endif %}>
5
5
  <header style="background-image: url('{{ site.baseurl }}/{{ page.feature-img }}')">
6
- <h1 class="title">{{ page.title }}</h1>
7
- {% if page.subtitle %}<h2 class="subtitle">{{ page.subtitle }}</h3>{% endif %}
6
+ <h1 class="title">{{ page.feature-title | default: page.title }}</h1>
7
+ {% if page.subtitle %}<h2 class="subtitle">{{ page.subtitle }}</h2>{% endif %}
8
8
  </header>
9
9
  <section class="post-content">{{ content }}</section>
10
10
  </article>
@@ -3,8 +3,8 @@ layout: default
3
3
  ---
4
4
  <article {% if page.feature-img %}class="feature-image"{% endif %}>
5
5
  <header style="background-image: url('{{ site.baseurl }}/{{ page.feature-img }}')">
6
- <h1 class="title">{{ page.title }}</h1>
7
- {% if page.subtitle %}<h2 class="subtitle">{{ page.subtitle }}</h3>{% endif %}
6
+ <h1 class="title">{{ page.feature-title | default: page.title }}</h1>
7
+ {% if page.subtitle %}<h2 class="subtitle">{{ page.subtitle }}</h2>{% endif %}
8
8
  <p class="meta">
9
9
  {{ page.date | date: "%B %-d, %Y" }}
10
10
  {% if page.author %} - {{ page.author }}{% endif %}
@@ -0,0 +1,31 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ {% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
6
+ {% assign tag_words = site_tags | split:',' | sort %}
7
+
8
+ <!-- cycles through tag list and creates subheader for each tag name -->
9
+ {% for item in (0..site.tags.size) %}
10
+ {% unless forloop.last %}
11
+ {% capture this_word %}{{ tag_words[item] | strip_newlines }}{% endcapture %}
12
+ <h2 id="{{ this_word | cgi_escape }}" class="tag-title">
13
+ #{{ this_word }}
14
+ </h2>
15
+ <!-- lists all posts corresponding to specific tag -->
16
+ {% for post in site.tags[this_word] %}
17
+ {% if post.title != null %}
18
+ <div class="tagged-post">
19
+ <h3 class="title">
20
+ <a href="{{ post.url | relative_url }}">
21
+ {{ post.title }}
22
+ </a>
23
+ </h3>
24
+ <div class="meta">
25
+ {{ post.date | date: "%B %-d, %Y" }}
26
+ </div>
27
+ </div>
28
+ {% endif %}
29
+ {% endfor %}
30
+ {% endunless %}
31
+ {% endfor %}
@@ -1,33 +1,37 @@
1
1
  // Typography
2
- $font-family-main: 'Source Sans Pro', Helvetica, Arial, sans-serif;
3
- $font-family-headings: 'Source Sans Pro', Helvetica, Arial, sans-serif;
4
- $font-size: 1.25em;
2
+ $font-family-main: 'Source Sans Pro', Helvetica, Arial, sans-serif !default;
3
+ $font-family-headings: 'Source Sans Pro', Helvetica, Arial, sans-serif !default;
4
+ $font-size: 1.25em !default;
5
5
 
6
6
  // Padding
7
- $padding-large: 20%;
8
- $padding-small: 5%;
9
- $padding-x-small: 3%;
7
+ $padding-large: 20% !default;
8
+ $padding-small: 5% !default;
9
+ $padding-x-small: 3% !default;
10
10
 
11
11
  // Brand colours
12
- $brand-color: #fff;
13
- $background-color: #fff;
14
- $border-color: rgba(0, 0, 0, 0.1); // rgba recommended if using feature images
12
+ $brand-color: #fff !default;
13
+ $background-color: #fff !default;
14
+ $border-color: rgba(0, 0, 0, 0.1) !default; // rgba recommended if using feature images
15
15
 
16
16
  // Typography colours
17
- $text-color: #383838;
18
- $link-color: #1ABC9C;
19
- $selection-color: #D4D4D4; // visible when highlighting text
17
+ $text-color: #383838 !default;
18
+ $link-color: #1ABC9C !default;
19
+ $selection-color: #D4D4D4 !default; // visible when highlighting text
20
20
 
21
21
  // Tags color
22
- $tags-color: #b0b0b0;
22
+ $tags-color: #b0b0b0 !default;
23
+
24
+ //Search color
25
+ $search-color: #999 !default;
23
26
 
24
27
  // Header colours
25
- $header-link-color: #383838;
28
+ $header-link-color: #383838 !default;
26
29
 
27
30
  // Feature image for articles
28
- $feature-image-text-color: #fff;
29
- $feature-image-size: cover; // options include "cover", "contain", "auto"
31
+ $feature-image-text-color: #fff !default;
32
+ $feature-image-size: cover !default; // options include "cover", "contain", "auto"
30
33
 
31
34
  // Header description box
32
- $header-desc-background-color: #1ABC9C;
33
- $header-desc-text-color: #FFF;
35
+ $header-desc-background-color: #1ABC9C !default;
36
+ $header-desc-text-color: #FFF !default;
37
+ $header-desc-link-color: #02453D !default;
@@ -50,4 +50,40 @@
50
50
  }
51
51
  }
52
52
  }
53
+
54
+ /* --- Search form --- */
55
+ form {
56
+ border: 0;
57
+ border-bottom: 2px solid $search-color;
58
+ outline: 0;
59
+
60
+ *:focus {
61
+ outline: none;
62
+ }
63
+
64
+ input{
65
+ &[type=text] {
66
+ box-sizing: border-box;
67
+ border: 0;
68
+ outline: 0;
69
+ color: $search-color;
70
+ }
71
+
72
+ &::-moz-placeholder {
73
+ color: $search-color;
74
+ opacity: 1;
75
+ }
76
+
77
+ &:-ms-input-placeholder, &::-webkit-input-placeholder {
78
+ color: $search-color;
79
+ }
80
+ }
81
+
82
+ button {
83
+ border: none;
84
+ font-size: 0.9em;
85
+ background-color: $brand-color;
86
+ color: $search-color;
87
+ }
88
+ }
53
89
  }
@@ -12,6 +12,9 @@
12
12
  .call-out p:last-child {
13
13
  margin-bottom: 0;
14
14
  }
15
+ .call-out a {
16
+ color: $header-desc-link-color
17
+ }
15
18
  // Post listing
16
19
  .posts {
17
20
  .post-teaser {
@@ -0,0 +1,15 @@
1
+ .search {
2
+ h1, h2, h3, h4, h5 {
3
+ margin-bottom: 0;
4
+ }
5
+ a.search-link {
6
+ &:hover {
7
+ text-decoration: none;
8
+ color: $text-color;
9
+ }
10
+ }
11
+ #not-found {
12
+ text-align: center;
13
+ font-weight: bold;
14
+ }
15
+ }
@@ -11,6 +11,7 @@
11
11
  @import 'layouts/posts';
12
12
  @import 'layouts/index';
13
13
  @import 'layouts/tags';
14
+ @import 'layouts/search';
14
15
 
15
16
  // Partials
16
17
  @import 'includes/header';
Binary file
@@ -16,11 +16,12 @@ Array.prototype.forEach.call(elements, function(element) {
16
16
  if (element.type.indexOf('mode=display') != -1){
17
17
  katexElement.className += "math-display";
18
18
  textToRender = '\\displaystyle {' + textToRender + '}';
19
+ katex.render(textToRender, katexElement, {displayMode: true});
19
20
  } else {
20
21
  katexElement.className += "math-inline";
22
+ katex.render(textToRender, katexElement);
21
23
  }
22
24
 
23
- katex.render(textToRender, katexElement);
24
25
  element.parentNode.insertBefore(katexElement, element);
25
26
  }
26
27
  });
@@ -0,0 +1,93 @@
1
+ (function () {
2
+ var SEARCH_BOX_ID = "search-box";
3
+ var NO_RESULTS_MESSAGE_ID = "not-found";
4
+ var SEARCH_RESULTS_CONTAINER_ID = "search-results";
5
+ var QUERY_VARIABLE_URL_STRING = "query";
6
+
7
+ function getQueryVariable(queryParam) {
8
+ var query = window.location.search.substring(1);
9
+ var vars = query.split("&");
10
+ for (var i = 0; i < vars.length; i++) {
11
+ var pair = vars[i].split("=");
12
+ var param = pair[0];
13
+ var value = pair[1];
14
+
15
+ if (param === queryParam) {
16
+ return decodeURIComponent(value.replace(/\+/g, "%20"));
17
+ }
18
+ }
19
+ }
20
+
21
+ function getSearchTerm() {
22
+ return getQueryVariable(QUERY_VARIABLE_URL_STRING);
23
+ }
24
+
25
+ function setSearchBoxValue(searchBoxValue) {
26
+ document.getElementById(SEARCH_BOX_ID).setAttribute("value", searchBoxValue);
27
+ }
28
+
29
+ function showNoResultsMessage() {
30
+ document.getElementById(NO_RESULTS_MESSAGE_ID).style.display = "block";
31
+ }
32
+
33
+ function setSearchResultsHTML(innerHTML) {
34
+ var searchResults = document.getElementById(SEARCH_RESULTS_CONTAINER_ID);
35
+ searchResults.innerHTML = innerHTML;
36
+ }
37
+
38
+ function createPostListingHTML(postItem) {
39
+ var headingHTML = "<h2><a class='search-link' href='" + postItem.url + "''>" + postItem.title + "</a></h2>";
40
+ var metaHTML = "<div class='meta'>" + postItem.date + "</div>";
41
+ var descriptionHTML = "<p>" + postItem.content.substring(0, 150) + "...</p>";
42
+ return headingHTML + metaHTML + descriptionHTML;
43
+ }
44
+
45
+ function displaySearchResults(results, store) {
46
+ if (results.length) {
47
+ var postsListingHTML = "";
48
+ for (var i = 0; i < results.length; i++) {
49
+ var postItem = store[results[i].ref];
50
+ postsListingHTML += createPostListingHTML(postItem);
51
+ }
52
+ setSearchResultsHTML(postsListingHTML);
53
+ } else {
54
+ showNoResultsMessage();
55
+ }
56
+ }
57
+
58
+ function addPostToSearchIndex(lunrIndex, key, postJSON) {
59
+ lunrIndex.add({
60
+ "id": key,
61
+ "title": postJSON.title,
62
+ "author": postJSON.author,
63
+ "category": postJSON.category,
64
+ "content": postJSON.content
65
+ });
66
+ }
67
+
68
+ function search(searchTerm) {
69
+ setSearchBoxValue(searchTerm);
70
+
71
+ var lunrIndex = lunr(function () {
72
+ this.field("id");
73
+ this.field("title", {
74
+ boost: 10
75
+ });
76
+ this.field("author");
77
+ this.field("category");
78
+ this.field("content");
79
+ });
80
+
81
+ for (var key in window.store) {
82
+ addPostToSearchIndex(lunrIndex, key, window.store[key])
83
+ }
84
+
85
+ var results = lunrIndex.search(searchTerm);
86
+ displaySearchResults(results, window.store);
87
+ }
88
+
89
+ var searchTerm = getSearchTerm();
90
+ if (searchTerm) {
91
+ search(searchTerm);
92
+ }
93
+ })();
@@ -0,0 +1,33 @@
1
+ ---
2
+ layout: page
3
+ title: Search
4
+ hide: true
5
+ ---
6
+
7
+ <div class="search">
8
+ <div id="search-results"></div>
9
+ <p id="not-found" style="display: none">
10
+ {{ site.theme_settings.str_search_no_results }}
11
+ </p>
12
+ </div>
13
+
14
+
15
+ <script>
16
+ window.store = {
17
+ {% for post in site.posts %}
18
+ "{{ post.url | slugify }}": {
19
+ "title": "{{ post.title | xml_escape }}",
20
+ "tags": "{{ post.tags | join: ', ' }}",
21
+ "date": "{{ post.date | date: '%B %-d, %Y' }}",
22
+ "author": "{{ post.author | xml_escape }}",
23
+ "category": "{{ post.category | xml_escape }}",
24
+ "content": {{ post.content | strip_html | strip_newlines | jsonify }},
25
+ "url": "{{ site.baseurl }}/{{ post.url | xml_escape }}"
26
+ }
27
+ {% unless forloop.last %},{% endunless %}
28
+ {% endfor %}
29
+ };
30
+ </script>
31
+
32
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/0.7.1/lunr.min.js"></script>
33
+ <script src="{{ site.baseurl }}/assets/js/search.js"></script>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-type
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rohan Chandra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-17 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.4'
19
+ version: 3.8.5
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.4'
26
+ version: 3.8.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jekyll-paginate
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.1'
33
+ version: 1.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.1'
40
+ version: 1.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.12'
47
+ version: 2.0.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.12'
54
+ version: 2.0.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: 12.3.2
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: 12.3.2
69
69
  description:
70
70
  email:
71
71
  - hellorohan@outlook.com
@@ -86,6 +86,7 @@ files:
86
86
  - _layouts/home.html
87
87
  - _layouts/page.html
88
88
  - _layouts/post.html
89
+ - _layouts/tags.html
89
90
  - _sass/base/_global.scss
90
91
  - _sass/base/_utility.scss
91
92
  - _sass/base/_variables.scss
@@ -97,14 +98,18 @@ files:
97
98
  - _sass/includes/_tag_list.scss
98
99
  - _sass/layouts/_index.scss
99
100
  - _sass/layouts/_posts.scss
101
+ - _sass/layouts/_search.scss
100
102
  - _sass/layouts/_tags.scss
101
103
  - _sass/type-theme.scss
102
104
  - assets/css/main.scss
105
+ - assets/favicon.ico
103
106
  - assets/img/avatar.png
104
107
  - assets/img/sample_feature_img.png
105
108
  - assets/img/sample_feature_img_2.png
106
109
  - assets/img/sample_feature_img_3.png
107
110
  - assets/js/katex_init.js
111
+ - assets/js/search.js
112
+ - search.html
108
113
  homepage: https://github.com/rohanchandra/type-theme
109
114
  licenses:
110
115
  - MIT
@@ -124,8 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
129
  - !ruby/object:Gem::Version
125
130
  version: '0'
126
131
  requirements: []
127
- rubyforge_project:
128
- rubygems_version: 2.6.8
132
+ rubygems_version: 3.0.4
129
133
  signing_key:
130
134
  specification_version: 4
131
135
  summary: A free and open-source Jekyll theme. Great for blogs and easy to customize.