A simple hugo blog theme based on blank
In your Hugo site themes
directory, run:
git clone https://github.com/charyan/springbok
Next, open hugo.toml
in the base of the Hugo site and ensure the theme option is set to springbok
.
theme = "springbok"
The home page shows the name of the site, a list of posts with their name and tags. In the footer, we have the following links: home, tags, rss and about.
We can add the following parameters in the YAML front matter:
- lastmod : Last update to the post, shown only if different than date
- author : shown if set
- type : if set to "special", will not show reading time, post date, update date and author
The tags page show all tags used in the posts in alphabetical order.
Create about.md
in your hugo site's content
directory. The page must have the parameter type
set to special
.
+++
title = "About"
type = "special"
+++
Hello, this is my about page.
The filename shortcode can be used to add a filename and a language to a code block. It works with markdown code blocks and the highlight shortcode.
The first parameter is the filename and the second (optional) is the language.
usage: {{< filename FILENAME [LANGUAGE] >}}
Markdown code block with language
{{< filename hello.cpp "C++" >}}
```cpp
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
```
Highlight shortcode
{{< filename hello.cpp >}}
{{< highlight cpp >}}
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
{{< /highlight >}}
To create a code block with a language but no filename, you can use an empty string.
{< filename "" "C++" >}
KaTeX is used to render TeX on each page. See layouts/partials/katex.html
and the KaTeX documentation for more.
Dark mode based on browser preferences.
Add the parameter toc = true
to add a table of content to a post.
This theme is based on blank under the MIT license. It is licensed under the GNU GPL version 3.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.