├── .gitignore
├── 404.md
├── Gemfile
├── LICENSE
├── README.md
├── _config.yml
├── _includes
├── disqus.html
├── footer.html
├── head.html
├── header.html
├── icons.html
├── post_nav.html
└── tags_list.html
├── _layouts
├── default.html
├── home.html
├── page.html
├── post.html
└── tags.html
├── _posts
├── 2014-11-28-markdown-and-html.md
├── 2014-11-29-feature-images.md
└── 2014-11-30-sample-post.md
├── _sass
├── base
│ ├── _global.scss
│ ├── _utility.scss
│ └── _variables.scss
├── external
│ ├── _reset.scss
│ └── _syntax.scss
├── includes
│ ├── _footer.scss
│ ├── _header.scss
│ ├── _post_nav.scss
│ └── _tag_list.scss
├── layouts
│ ├── _index.scss
│ ├── _posts.scss
│ ├── _search.scss
│ └── _tags.scss
└── type-theme.scss
├── about.md
├── assets
├── css
│ └── main.scss
├── favicon.ico
├── img
│ ├── avatar.png
│ ├── sample_feature_img.png
│ ├── sample_feature_img_2.png
│ └── sample_feature_img_3.png
└── js
│ ├── katex_init.js
│ └── search.js
├── feed.xml
├── index.html
├── search.html
└── tags.html
/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 | *.gem
3 | .bundle
4 | .sass-cache
5 | _site
6 | Gemfile.lock
7 |
--------------------------------------------------------------------------------
/404.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: "Page not found"
4 | permalink: /404.html
5 | hide: true
6 | ---
7 | Sorry, the requested page wasn't found on the server.
8 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 | gem 'github-pages', group: :jekyll_plugins
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Rohan Chandra
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Type Theme
2 |
3 | 
4 |
5 | A free and open-source [Jekyll](https://jekyllrb.com) theme. Great for blogs and easy to customize.
6 |
7 | [Demo](https://rohanchandra.github.io/type-theme/)
8 |
9 | ## Usage
10 |
11 | 1. Fork and clone the [Type Theme repo](https://github.com/rohanchandra/type-theme): `git clone https://github.com/rohanchandra/type-theme`
12 | 2. [Install Jekyll](https://jekyllrb.com/docs/installation/): `gem install jekyll`
13 | 3. Install the theme's dependencies: `bundle install`
14 | 4. Customize the theme (see below)
15 | 5. Run the Jekyll server: `jekyll serve`
16 |
17 | ## Customizing Type Theme
18 |
19 | Open `_config.yml` in a text editor to change most of the blog's settings.
20 |
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 |
23 | ```yml
24 | theme:
25 | title: Type Theme
26 | avatar:
27 | gravatar:
28 | ```
29 |
30 | Notice the avatar variable is left intentionally blank.
31 |
32 | Below is a summary of the configuration options in Type Theme.
33 |
34 | ### Site configuration
35 | The most common configurations, included here for guidance, are:
36 |
37 | Jekyll website *without* a subpath (such as a GitHub Pages website for a given username):
38 |
39 | ```yml
40 | # SITE CONFIGURATION
41 | baseurl: ""
42 | url: "https://username.github.io"
43 | ```
44 |
45 | Jekyll website *with* subpath (like the Type Theme demo page):
46 |
47 | ```yml
48 | # SITE CONFIGURATION
49 | baseurl: "/sub-directory"
50 | url: "https://username.github.io/"
51 | ```
52 |
53 | Please configure this in `_config.yml` before using the theme.
54 |
55 | ### Meta
56 |
57 | Meta variables hold basic information about your Jekyll site which will be used throughout the site and as meta properties for search engines, browsers, and the site's RSS feed.
58 |
59 | Change these variables in `_config.yml`:
60 |
61 | | Variable | Example | Description | Optional |
62 | | ----------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------- |
63 | | title | My Jekyll Blog | Name of website | Yes |
64 | | avatar | assets/img/avatar.png | Path of avatar image, to be displayed in the theme's header | Yes |
65 | | gravatar | f9879d71855b5ff21e4963273a886bfc | [MD5 hash of your email address](https://secure.gravatar.com/site/implement/hash/) to load your Gravatar in the theme's header | Yes |
66 | | description | My blog posts | Short description, primarily used by search engines | Yes |
67 |
68 | ### Header and footer text
69 |
70 | Change these variables in `_config.yml`:
71 |
72 |
73 | | Variable | Example | Description | Optional |
74 | | ------------------------- | ----------------------------------- | ----------------------------------------------------------------------- | -------- |
75 | | header_text | Welcome to my Jekyll blog | HTML (shown below the navigation) with a background colour for emphasis | Yes |
76 | | header_text_feature_image | assets/img/sample_feature_img_3.png | Background image for the header text | Yes |
77 | | footer_text | Copyright 2014 | HTML (shown at end of the site) with lighter text | Yes |
78 |
79 | ### Icons
80 |
81 | Add your username on selected websites in the icon section of the `_config.yml` file to display the site's icon from [Font Awesome](https://fortawesome.github.io/Font-Awesome/) in the header navigation. All icon variables should be your username enclosed in quotes (e.g. "username"), except for the following variables:
82 |
83 |
84 | | Variable | Example | Description | Optional |
85 | | -------------- | ----------------------------------------------- | ------------------------------------------------------ | -------- |
86 | | rss | true | Takes boolean value (true/false) to show RSS feed icon | Yes |
87 | | email_address | type@example.com | Email address | Yes |
88 | | linkedin | https://www.linkedin.com/in/FirstLast | Full URL to profile on LinkedIn | Yes |
89 | | stack_exchange | https://stackoverflow.com/users/0000/first-last | Full URL to profile on Stack Exchange | Yes |
90 |
91 | ### Scripts
92 |
93 | Change these variables in `_config.yml`:
94 |
95 |
96 | | Variable | Example | Description | Optional |
97 | | ---------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | -------- |
98 | | google_analytics | UA-123456-01 | Google Analytics [tracking ID](https://support.google.com/analytics/answer/1032385?hl=en) | Yes |
99 | | disqus_shortname | shortname | Disqus [shortname](https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname-) | Yes |
100 | | katex | true | Takes boolean value (true/false) to conditionally load [KaTeX](https://khan.github.io/KaTeX/) scripts required for math typesetting | Yes |
101 |
102 | Scripts listed here are only loaded if you provide a value in the `_config.yml` file.
103 |
104 | ### Localization strings
105 |
106 | Change localization string variables in `_config.yml`.
107 |
108 | English text used in the theme (such as the "continue reading" label) has been grouped so you can quickly translate the theme or change labels to suit your needs.
109 |
110 | ### Colours, typography, padding
111 |
112 | 
113 |
114 |
115 | | Variable | Example | Description | Optional |
116 | | ------------ | -------------------------- | ------------------------------------ | ------------------------------------------------------------ |
117 | | google_fonts | "Playfair+Display:400,700\ | PT+Sans:400,700,700italic,400italic" | [Google Fonts](https://www.google.com/fonts) to load for use |
118 |
119 | Navigate to the `_sass > base` directory and open `_variables.scss` to change colours, typography and padding used in the theme with CSS.
120 |
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 |
123 | ```css
124 | // Typography
125 | $font-family-main: 'PT Sans', Helvetica, Arial, sans-serif;
126 | $font-family-headings: 'Playfair Display', Helvetica, Arial, sans-serif;
127 | ```
128 |
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 |
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";` includes 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 project. 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 | ```
152 |
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 | ```
172 |
173 | ## Posts and pages in Type Theme
174 | Please refer to the [Jekyll docs for writing posts](https://jekyllrb.com/docs/posts/). Non-standard features are documented below.
175 |
176 | ### Math typesetting
177 | Wrap math expressions with `$$` signs in your posts and make sure you have set the `katex` variable in `_config.yml` to `true` for math typesetting.
178 |
179 | For inline math typesetting, type your math expression on the *same line* as your content. For example:
180 |
181 | ```latex
182 | Type math within a sentence $$2x^2 + x + c$$ to display inline
183 | ```
184 |
185 | For display math typesetting, type your math expression on a *new line*. For example:
186 |
187 | ```latex
188 | $$
189 | \bar{y} = {1 \over n} \sum_{i = 1}^{n}y_i
190 | $$
191 | ```
192 |
193 | Type Theme makes use for [KaTeX](https://khan.github.io/KaTeX/) for typesetting.
194 |
195 | ### Feature images
196 |
197 | 
198 |
199 | Add a feature image by specifying a path to an image in the [front matter](http://jekyllrb.com/docs/frontmatter/) in the form of `feature-img: "img/PATH_TO_IMAGE.png"`.
200 |
201 | For example:
202 |
203 | ```yml
204 | ---
205 | layout: post
206 | title: Hello World
207 | feature-img: "assets/img/sample_feature_img.png"
208 | ---
209 | ```
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 |
222 | ### Hiding pages from navigation
223 |
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).
225 |
226 | For example:
227 |
228 | ```yml
229 | ---
230 | layout: page
231 | title: "Error 404: Page not found"
232 | permalink: /404.html
233 | hide: true
234 | ---
235 | ```
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 |
255 | ### Tags
256 |
257 | Post tags should be placed between `[]` in your post metadata. Separate each tag with a comma.
258 |
259 | For example:
260 |
261 | ```yml
262 | ---
263 | layout: post
264 | title: Markdown and HTML
265 | tags: [sample, markdown, html]
266 | ---
267 | ```
268 |
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`.
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 |
282 | ### Subtitles
283 | A subtitle can be displayed below your title on permalink post pages.
284 |
285 | To enable this feature, add `subtitle` to your post metadata.
286 |
287 | For example:
288 |
289 | ```yml
290 | ---
291 | layout: post
292 | title: "This is a title"
293 | subtitle: "This is a subtitle"
294 | ---
295 | ```
296 |
297 | ## License
298 | [The MIT License (MIT)](https://github.com/rohanchandra/type-theme/blob/master/LICENSE)
299 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | # SITE CONFIGURATION
2 | baseurl: "/type-theme"
3 | url: "https://rohanchandra.github.io/"
4 |
5 | # THEME-SPECIFIC CONFIGURATION
6 | theme_settings:
7 | # Meta
8 | title: Type Theme
9 | avatar: assets/img/avatar.png
10 | favicon: assets/favicon.ico
11 | gravatar: # Email MD5 hash
12 | description: "A website with blog posts and pages" # used by search engines
13 |
14 | # Header and footer text
15 | header_text: >
16 |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
17 |
18 |
Remove all header text in _config.yml to disable this feature.