From 7e6e8a28eaf35752f7e5a04b9ebed4ad2f1342ac Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 10 Apr 2021 02:50:22 +0300 Subject: README: update --- README.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 107 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 760ae02..2819313 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ 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]. @@ -10,16 +12,113 @@ I use it for [egor-tensin.github.io], [blog], [sorting-algorithms]. [blog]: https://github.com/egor-tensin/blog/tree/gh-pages [sorting-algorithms]: https://github.com/egor-tensin/sorting-algorithms/tree/gh-pages -API ---- +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.3.7 + 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' %} +``` -See the _config.yml files in the projects above to see which `site` values are -used. -Otherwise this theme is irrelevant for anybody but me of course, so it's not -worth documenting. +The line above would output both hello.hpp and hello.cpp to the page. -Typesetting math ----------------- +### Typesetting math [MathJax] can be used to typeset mathematics using LaTeX. To use MathJax, set `mathjax` to `true` in page's front matter. -- cgit v1.2.3