hugo-theme-relearn/README.md

56 lines
2.0 KiB
Markdown
Raw Normal View History

2016-04-11 00:25:22 +02:00
# Hugo Learn Theme
2016-03-17 12:05:36 +01:00
This repository contains a theme for [Hugo](https://gohugo.io/), based on great [Grav Learn Theme](http://learn.getgrav.org/).
2016-04-11 01:07:42 +02:00
Visit the [theme documentation](https://matcornic.github.io/hugo-learn-doc/basics/what-is-this-hugo-theme/) to see what is going on. It is actually built with this theme.
### Installation
Navigate to your themes folder in your Hugo site and use the following commands:
```
$ cd themes
$ git clone https://github.com/matcornic/hugo-theme-learn.git
```
2016-10-23 19:01:52 +02:00
![Overview](https://github.com/matcornic/hugo-theme-learn/raw/master/images/tn.png)
2016-04-12 02:48:31 +02:00
# Main functionalities
- Handle two levels of documentation
- Tip/Note/Info and Warning boxes
- Resize images
- Preview of original image size
- Add shadow or border on images
- Automatic table of contents
- Create buttons (typically used to provide a link to a demo)
# Search
To use the `search` functionality, you just have to put a `lunr` index which respects this format :
```json
[
{
"uri": "/docs/01-start/index",
"title": "Get started",
"content": "\n\nGet started\n\nAll you need to know...\n",
"tags": ["start", "intro"]
},
...
]
```
into a `static/json/search.json` file in your hugo project.
And set `search = true` in your config.toml
To generate your lunr index, you can see this project https://github.com/gwleclerc/lunr-hugo which parse your markdown files and extract toml and yaml headers to create index with corresponding format.
In order to generate the index of your static site launch the following comand after installing `lunr-hugo` using `npm`
```
lunr-hugo -i "<content directory>/**/*.md" -o static/json/search.json -l <header format (yaml or toml)>
```
# TODO
2016-10-02 18:36:15 +02:00
- [Handling more than 2 levels in documentation](https://github.com/matcornic/hugo-theme-learn/issues/11)
- [Handling videos](https://github.com/matcornic/hugo-theme-learn/issues/13)
- [Add optional button to create doc issue (like github)](https://github.com/matcornic/hugo-theme-learn/issues/14)