1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
jekyll-theme
============
[![Publish](https://github.com/egor-tensin/jekyll-theme/actions/workflows/jekyll.yml/badge.svg)](https://github.com/egor-tensin/jekyll-theme/actions/workflows/jekyll.yml)
My [Jekyll] theme.
I use it for [egor-tensin.github.io], [blog], [sorting-algorithms].
[Jekyll]: https://jekyllrb.com/
[egor-tensin.github.io]: https://github.com/egor-tensin/egor-tensin.github.io
[blog]: https://github.com/egor-tensin/blog/tree/gh-pages
[sorting-algorithms]: https://github.com/egor-tensin/sorting-algorithms/tree/gh-pages
Preview
-------
An example website can be viewed at https://egor-tensin.github.io/jekyll-theme/.
Configuration
-------------
The complete list of configuration options follows.
Put it in \_config.yml and adjust how you see fit.
```
settings:
project:
name: Test
description: This is a test project
license: MIT License
license_file: LICENSE.txt
author:
name: John Doe
email: John.Doe@example.com
navbar:
hide: false
3rdparty:
versions:
bootstrap: 3.4.1
jquery: 1.12.4
html5shiv: 3.7.3
respond: 1.4.2
minified: false
```
Features
--------
### Layouts
* `plain`: navbar at the top + footer at the bottom
* `default`: same as plain, but with a sidebar on the right.
* `page`: same as default, but with the page's header.
* `post`: same as default, but with the post's header and publication date.
### Navbar
Hide the navbar by setting either `site.settings.navbar.hide` or
`page.navbar.hide` to `true`.
Put a page on the navbar by defining setting `page.navbar_link` to `true` or
a custom HTML string.
Pages are sorted in the ascending order of `page.navbar_priority`.
If a page on the navbar is paginated, set `page.navbar_paginated` to `true` so
that it doesn't appear two or more times.
### Post feed
See [feed/index.html] for an example of how to easily create a paginated post
feed.
Basically, just include posts/posts.html.
[feed/index.html]: feed/index.html
### Category pages
See [life/index.html] or [work/index.html] for examples of how to create
category pages, with a list of posts belonging to the category.
Basically, just include categories/category.html and set the `category`
parameter to the category's name.
[life/index.html]: life/index.html
[work/index.html]: work/index.html
If you want to create a page with a list of all categories and the posts
belonging to them, see [archive/index.html] for an example.
Simply including categories/categories.html should do the job.
[archive/index.html]: archive/index.html
### Code snippets
See [Test post 3] for an example of how to conveniently embed snippets in your
pages.
Basically, you need to put something like this in the front matter:
```
snippets_root_directory: snippets
snippets_language: c++
snippets:
hello:
- hello.hpp
- hello.cpp
world:
- world.hpp
- world.cpp
```
[Test post 3]: _posts/2021-04-09-test-post3.md
And then you can just format an entire section of snippets using a single
`include`:
```
{% include snippets/section.html section_id='hello' %}
```
The line above would output both hello.hpp and hello.cpp to the page.
### Typesetting math
[MathJax] can be used to typeset mathematics using LaTeX.
To use MathJax, set `mathjax` to `true` in page's front matter.
Then you can do things like this:
```
This is an inline formula: $$y = kx + b$$.
This is a formula in a separate block:
$$
y = kx + b
$$
```
[MathJax]: https://www.mathjax.org/
Behind the scenes, Kramdown transforms these to `\(...\)` and `\[...\]`
sequences, to be processed by MathJax.
History
-------
This theme wasn't built from the ground up, it's a product of concurrent
evolution of my three Jekyll projects.
At one moment I got sick of the code duplication, so I just cloned the most
feature-reached project into this repository (tagged `from_jekyll_project`),
and removed everything that wasn't theme-related.
Then I made some minor tweaks to make it work with the other two projects, and
voilĂ !
I thought about several alternatives to cloning the whole repository.
1. Simply copying the latest versions of the relevant files would lose their
history.
2. Heavily rewriting repository history using `git filter-branch` or something
like this is painfully hard to get right for me.
License
-------
Distributed under the MIT License.
See [LICENSE.txt] for details.
This theme is build upon the Twitter Bootstrap framework, which is also MIT
Licensed and copyright 2015 Twitter.
[LICENSE.txt]: LICENSE.txt
|