1
0
forked from extern/slate
slate/README.md

166 lines
4.5 KiB
Markdown
Raw Normal View History

2017-05-16 22:25:01 +02:00
# slate theme for hugo
slate is a single-page speed dial theme for [Hugo](http://gohugo.io/). Supports using image logos or url text for the contents of the tiles.
2017-05-16 22:25:01 +02:00
## Examples
You can visit a live demo at https://gesquive.github.io/hugo-slate-demo/ or view
screen shots of the [Image](https://raw.githubusercontent.com/gesquive/slate/master/images/icon_tiles.png) and [Text](https://raw.githubusercontent.com/gesquive/slate/master/images/text_tiles.png) tile display modes.
## Features
2017-05-16 22:25:01 +02:00
- Rotating image background
2017-05-19 05:25:08 +02:00
- [Image](https://raw.githubusercontent.com/gesquive/slate/master/images/icon_tiles.png) and [Text](https://raw.githubusercontent.com/gesquive/slate/master/images/text_tiles.png) tile display mode
- Tag based navigation/filtering
2017-05-16 22:25:01 +02:00
## Installation
2017-05-16 22:25:01 +02:00
### Installing this theme
2017-05-16 22:25:01 +02:00
mkdir themes
cd themes
2017-05-19 05:25:08 +02:00
git clone https://github.com/gesquive/slate
2017-05-16 22:25:01 +02:00
### Build with this theme
2017-05-16 22:25:01 +02:00
hugo server -t slate
## Configuration
The following configuration site params are available:
- **BackgroundImages**: (_optional_) specifies a list of backgrounds to rotate through, if not provided, then the specified background style will be used
- **BackgroundStyle**: (_optional_) The [background CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/background) style to use. (default value is `radial-gradient(ellipse farthest-side at center top, #FCFCFC 0%, #657383 100%)`)
- **OpenLinksInNewWindow**: (_optional_) boolean to set if tile links open in a new window/tab. (default values is `false`)
- **Favicon**: (_optional_) path to the favicon
2017-05-16 22:25:01 +02:00
**config.toml**
``` toml
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "slate"
[ params ]
BackgroundImages = [
"bg/b1920-000.jpg",
"bg/b1920-001.jpg",
"bg/b1920-002.jpg",
"bg/b1920-003.jpg",
"bg/b1920-004.jpg"
]
BackgroundStyle = "#000000;"
OpenLinksInNewWindow = true
2017-05-19 15:21:09 +02:00
Favicon = "favicon.ico"
2017-05-16 22:25:01 +02:00
# list of nav tags
[[ params.nav ]]
name = "favorites"
tag = "favorite"
icon = "star"
2017-05-16 22:25:01 +02:00
```
Example : [config.toml](https://github.com/gesquive/hugo-slate-demo/blob/master/config.toml)
2017-05-16 22:25:01 +02:00
### Links
2017-05-16 22:25:01 +02:00
All links are defined in the `data/links.yml` data file. Valid attributes are:
- **name**: the name displayed below the tile
- **url**: the url href, also used for text when no img is specified
- **tags**: (_optional_) list of tags to apply to this tile
- **img**: (_optional_) path to tile image, this will replace any text in the tile
- **txt_color**: (_optional_) css used to set the [`color`](https://developer.mozilla.org/en-US/docs/Web/CSS/color) of a tile, a random value is chosen if none is specified
- **bg_color**: (_optional_) css used to set the [`background-color`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) of a tile.
2017-05-16 22:25:01 +02:00
Example of link definitions in the data file.
``` yaml
2017-05-16 22:25:01 +02:00
tiles:
-
name: 'google'
url: 'https://google.com'
img: 'google.svg'
tags: ['favorite', 'search']
-
name: 'bing'
url: 'https://bing.com'
img: 'bing.svg'
txt_color: '#ffffff'
bg_color: '#ffb900'
tags: ['search']
-
name: 'amazon'
url: 'https://amazon.com'
img: 'amazon.svg'
bg_color: '#ffffff'
txt_color: '#ff9900'
tags: ['favorite', 'shopping']
-
name: 'reddit'
url: 'https://reddit.com'
img: 'reddit.svg'
bg_color: '#5f99cf'
txt_color: '#ffffff'
-
name: 'spotify'
url: 'https://web.spotify.com'
img: 'spotify.svg'
bg_color: '#191414'
txt_color: '#1db954'
tags: ['favorite', 'music']
-
name: 'google music'
url: 'https://play.google.com/music/listen'
img: 'google-music.png'
bg_color: '#ffffff'
txt_color: '#ff5722'
tags: ['music']
-
name: 'pandora'
url: 'https://pandora.com'
img: 'pandora.svg'
bg_color: '#005483'
txt_color: '#ffffff'
tags: ['music']
2017-05-16 22:25:01 +02:00
```
### Navigation
2017-05-16 22:25:01 +02:00
Along the left side of the screen is a navigation bar that can be used to filter the links. The filtering occurs on the tag attribute of the links. For example, when the 'favorite' tag is selected, only the links with the 'favorite' tag attribute will be shown.
A nav filter is defined as:
2017-05-16 22:25:01 +02:00
- **name**: The name displayed in the UI
- **tag**: the tag name to filter links with
- **icon**: the [font-awesome](http://fontawesome.io/icons/) name of the icon to display
Example of a menu definition in main config file.
``` toml
[[ params.nav ]]
name = "favorites"
tag = "favorite"
icon = "star"
[[ params.nav ]]
name = "search"
tag = "search"
icon = "search"
[[ params.nav ]]
name = "shopping"
tag = "shopping"
icon = "shopping-basket"
[[ params.nav ]]
name = "music"
tag = "music"
icon = "headphones"
```