2018-04-27 07:08:35 +00:00
# Binario [WIP]
2018-04-25 18:30:37 +00:00
**Binario** is a responsive card-based & code-light Hugo theme.
2018-11-26 19:10:09 +00:00
**[Demo](https://binario.netlify.com/)**
2018-04-26 18:39:01 +00:00
![Binario theme screenshot ](https://github.com/vimux/binario/blob/master/images/tn.png )
2018-04-25 18:30:37 +00:00
**Features:**
* Responsive
* Card-based list layout
2019-01-20 17:55:19 +00:00
* Color themes
2018-05-28 06:29:46 +00:00
* Internal Hugo templates for Open Graph and Twitter Cards meta data, Google Analytics, and Disqus comments
2018-05-25 10:03:05 +00:00
* Table of contents
2018-05-25 14:35:12 +00:00
* Related content
2018-05-27 12:01:09 +00:00
* MathJax
2018-04-25 18:30:37 +00:00
2019-01-15 15:20:19 +00:00
## Table of Contents
- [Installation ](#installation )
2019-01-17 15:22:50 +00:00
- [Option A. Git clone ](#option-a-git-clone )
- [Option B. Git submodule ](#option-b-git-submodule )
- [Option C. Download ZIP and manual install ](#option-c-download-zip-and-manual-install )
2019-01-15 15:20:19 +00:00
- [Configuration ](#configuration )
- [Config.toml example ](#configtoml-example )
- [Front Matter example ](#front-matter-example )
- [Configuration options ](#configuration-options )
- [Columns ](#columns )
2019-01-19 14:16:18 +00:00
- [Custom CSS ](#custom-css )
2019-01-15 15:20:19 +00:00
- [Post Meta ](#post-meta )
- [Related Content ](#related-content )
- [Share Buttons ](#share-buttons )
- [Thumbnail Image ](#thumbnail-image )
- [Footer Social Icons ](#footer-social-icons )
- [Web App Manifest ](#web-app-manifest )
- [Contributing ](#contributing )
- [License ](#license )
2018-06-20 07:49:27 +00:00
## Installation
2019-01-15 15:20:19 +00:00
*First of all, you will need to [install Hugo ](https://gohugo.io/getting-started/quick-start/#step-1-install-hugo ) and [create new site ](https://gohugo.io/getting-started/quick-start/#step-2-create-a-new-site ). Also, you have git installed on your machine and you are familiar with basic git usage. After that, you ready to install **Binario** .*
2018-06-20 07:49:27 +00:00
2019-01-14 13:08:53 +00:00
There are three different ways you can install **Binario** . Choose one of the installation methods listed below and follow the instructions.
2018-06-20 07:49:27 +00:00
2019-01-15 15:20:19 +00:00
- **A**. [Git clone ](#option-a-git-clone )
- **B**. [Git submodule ](#option-b-git-submodule )
- **C**. [Download ZIP and manual install ](#option-c-download-zip-and-manual-install )
2018-06-20 07:49:27 +00:00
2019-01-15 15:20:19 +00:00
*For more information read the "[Install and Use Themes](https://gohugo.io/themes/installing-and-using-themes/)"*.
2018-06-20 07:49:27 +00:00
2019-01-15 15:20:19 +00:00
### Option A. Git clone
2018-06-20 07:49:27 +00:00
In your Hugo site directory, run:
```
2019-01-15 15:20:19 +00:00
git clone https://github.com/vimux/binario themes/binario
2018-06-20 07:49:27 +00:00
```
Next, edit your `config.toml` configuration file and add parameter:
```
theme = "binario"
```
2019-01-15 15:20:19 +00:00
### Option B. Git submodule
2018-06-20 07:49:27 +00:00
In your Hugo site directory, run:
```
2019-01-15 15:20:19 +00:00
git submodule add https://github.com/vimux/binario themes/binario
2018-06-20 07:49:27 +00:00
```
Next, edit your `config.toml` configuration file and add parameter:
```
theme = "binario"
```
2019-01-15 15:20:19 +00:00
*You can [read the GitHub documentation for submodules ](https://github.com/blog/2104-working-with-submodules ) or those found on [Git's website ](https://git-scm.com/book/en/v2/Git-Tools-Submodules ) for more information*
2018-06-20 07:49:27 +00:00
2019-01-15 15:20:19 +00:00
### Option C. Download ZIP and manual install
2019-01-24 15:15:18 +00:00
**[Download ZIP](https://github.com/vimux/binario/archive/master.zip)** and extract to the `themes/binario` within your Hugo website.
2018-06-20 07:49:27 +00:00
Next, edit your `config.toml` configuration file and add parameter:
```
theme = "binario"
```
2019-01-14 13:08:53 +00:00
***
2019-01-15 15:20:19 +00:00
You can run your site in Hugo server mode:
2019-01-14 13:08:53 +00:00
```
hugo server
```
2019-01-17 15:22:50 +00:00
Now you can go to [localhost:1313 ](http://localhost:1313 ) webpage and the Binario theme should be visible.
2019-01-19 14:16:18 +00:00
After you make sure that **Binario** works, you may start customizing the theme if it's needed. You can change [number of columns ](#columns ), activate [footer social icons ](#footer-social-icons ), [share buttons ](#share-buttons ) and [much more ](#configuration-options ).
2019-01-14 13:08:53 +00:00
2018-04-27 07:08:35 +00:00
## Configuration
2019-01-17 15:22:50 +00:00
Hugo uses the `config.toml` , `config.yaml` , or `config.json` (if found in the site root) as the default site config file. Here is Binario configuration example in TOML with all available theme-specific config params:
2019-01-14 13:08:53 +00:00
2018-04-27 07:08:35 +00:00
### Config.toml example
```toml
baseurl = "/"
2018-05-28 06:29:46 +00:00
title = "Binario"
2018-04-27 07:08:35 +00:00
languageCode = "en-us"
paginate = "10" # Number of posts per page
theme = "binario"
disqusShortname = "" # Enable comments by entering your Disqus shortname
googleAnalytics = "" # Enable Google Analytics by entering your tracking id
2018-11-18 16:00:23 +00:00
[Author] # Used in authorbox
name = "John Doe"
bio = "John Doe's true identity is unknown. Maybe he is a successful blogger or writer."
avatar = "img/avatar.png"
2018-04-27 07:08:35 +00:00
[Params]
2019-01-20 17:55:19 +00:00
description = "Responsive card-based & code-light Hugo theme" # Site Description. Used in meta description
2019-01-03 15:23:18 +00:00
copyright = "Binario" # Copyright holder, otherwise will use .Site.Title
2018-07-10 12:50:06 +00:00
opengraph = true # Enable OpenGraph if true
twitter_cards = true # Enable Twitter Cards if true
2019-01-14 13:08:53 +00:00
columns = 2 # Set the number of cards columns. Possible values: 1, 2, 3
2018-07-10 12:50:06 +00:00
mainSections = ["post"] # Set main page sections
2018-11-15 19:21:34 +00:00
post_meta = ["date", "categories"] # Enable post meta fields in given order
dateFormat = "January 02, 2006" # Change the format of dates
2019-01-27 04:52:55 +00:00
colorTheme = "" # dark-green, dark-blue, dark-red, dark-violet
2019-01-18 16:53:31 +00:00
customCSS = ["css/custom.css"] # Include custom CSS files
2019-02-17 22:10:19 +00:00
mainMenuAlignment = "right" # Align main menu (desktop version) to the right side
2018-11-18 16:00:23 +00:00
authorbox = true # Show authorbox at bottom of single pages if true
2018-07-10 12:50:06 +00:00
toc = true # Enable Table of Contents for all site pages
tocOpen = true # Open Table of Contents block. Optional
comments = true # Enable comments for all site pages
2018-11-15 14:11:46 +00:00
related = true # Enable Related content for single pages
2019-01-13 16:31:10 +00:00
relatedMax = 5 # Set the maximum number of posts that can be displayed in related block. Optional
2018-07-10 12:50:06 +00:00
mathjax = true # Enable MathJax for all site pages
2018-08-08 18:30:27 +00:00
mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" # Specify MathJax path. Optional
2018-07-10 12:50:06 +00:00
mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional
2019-01-14 14:26:42 +00:00
hideNoPostsWarning = false # Don't show no posts empty state warning in main page, if true
2018-04-28 07:58:53 +00:00
2018-05-24 20:52:05 +00:00
[Params.Social]
2018-07-10 12:50:06 +00:00
email = "example@example.com"
facebook = "username"
twitter = "username"
telegram = "username"
instagram = "username"
pinterest = "username"
vk = "username"
linkedin = "username"
github = "username"
gitlab = "username"
stackoverflow = "numberid"
mastodon = "username"
medium = "username"
2018-05-24 20:52:05 +00:00
2018-06-11 18:41:16 +00:00
[Params.Share] # Post Share block
2018-07-10 12:50:06 +00:00
facebook = true
twitter = true
reddit = true
telegram = true
linkedin = true
vk = true
pocket = true
2018-06-11 18:41:16 +00:00
2018-06-04 07:26:09 +00:00
# Web App Manifest settings
# https://www.w3.org/TR/appmanifest/
# https://developers.google.com/web/fundamentals/web-app-manifest/
[Params.Manifest]
2018-07-10 12:50:06 +00:00
name = "Binario"
shortName = "Binario"
display = "browser"
backgroundColor = "#2a2a2a"
themeColor = "#1b1b1b"
description = "Responsive card-based & code-light Hugo theme"
orientation = "portrait"
startUrl = "/"
scope = "/"
2018-06-04 07:26:09 +00:00
2018-04-28 07:58:53 +00:00
[outputFormats]
[outputFormats.MANIFEST]
mediaType = "application/json"
baseName = "manifest"
isPlainText = true
notAlternative = true
[outputs]
2018-07-31 17:40:03 +00:00
home = ["HTML", "RSS", "MANIFEST"]
2018-04-27 07:08:35 +00:00
```
2019-01-15 15:20:19 +00:00
For more information about Hugo configuration files and all common configuration settings, please read "[Configure Hugo](https://gohugo.io/getting-started/configuration)" from Hugo official documentation.
2019-01-14 13:08:53 +00:00
2018-11-26 19:10:09 +00:00
### Front Matter example
2019-01-14 13:08:53 +00:00
Hugo supports three formats for front matter: `yaml` , `toml` and `json` . Here is Front Matter example in YAML:
2018-11-26 19:10:09 +00:00
```yaml
---
2018-12-21 14:15:32 +00:00
# Common-Defined params
2018-11-26 19:10:09 +00:00
title: "Example article title"
date: "2017-08-21"
2018-12-21 14:15:32 +00:00
lastmod: "2018-12-21"
2018-11-26 19:10:09 +00:00
description: "Example article description"
categories:
- "Category 1"
- "Category 2"
tags:
- "Tag"
- "Another tag"
2018-11-27 20:30:08 +00:00
menu: main # Add page to a menu. Options: main, footer
2018-12-21 14:15:32 +00:00
# Theme-Defined params
comments: true # Enable/disable Disqus comments for specific post
authorbox: true # Enable/disable Authorbox for specific post
toc: true # Enable/disable Table of Contents for specific post
mathjax: true # Enable/disable MathJax for specific post
related: true # Enable/disable Related content for specific post
2018-11-26 19:10:09 +00:00
---
```
2019-01-15 15:20:19 +00:00
For more information about front matter variables and formats read "[Hugo Front Matter](https://gohugo.io/content-management/front-matter)" from Hugo official documentation.
### Configuration options
2019-01-14 13:08:53 +00:00
2019-01-15 15:20:19 +00:00
Binario includes some customizable configuration options that may be useful.
2019-01-14 13:08:53 +00:00
2019-01-15 15:20:19 +00:00
#### Columns
2019-01-14 13:08:53 +00:00
2019-01-24 15:15:18 +00:00
By default, Binario works with two columns card layout (if it possible by screen size) for list pages, but you can also use one or three columns layout. Change `Params.columns` to preferable value (from 1 to 3). You can also change this option for specific list pages in frontmatter params.
2019-01-15 15:20:19 +00:00
2019-01-19 14:16:18 +00:00
#### Custom CSS
If you want to include custom CSS files, you need to assign an array of references in site config file (`config.toml` by default) like following:
```toml
[Params]
customCSS = ["css/custom.css"]
```
Of course, you can reference as many CSS files as you want. Their paths need to be relative to the `static` folder of your Hugo site:
```toml
[Params]
customCSS = ["css/custom.css", "css/another.css"]
```
All these CSS files will be added through the `head.html` partial after the built-in CSS file.
2019-01-15 15:20:19 +00:00
#### Post Meta
You may activate post meta fields with `.Site.Params.post_meta` parameter.
#### Related Content
Binario uses default Related Content Hugo feature to provide "See Also"-like section. You can activate "Related Content" section with `.Site.Params.related` parameter.
More information available at [Hugo Related Content ](https://gohugo.io/content-management/front-matter )
#### Share Buttons
2019-01-14 13:08:53 +00:00
To display share buttons, set up `[Params.Share]` specific parameters in your site config file.
Available share buttons: Facebook, Twitter, Reddit, Telegram, LinkedIn, VK, Pocket
2019-01-15 15:20:19 +00:00
#### Thumbnail Image
You can add thumbnail image to your content page. Just put `thumbnail.*` image file in [page bundle ](https://gohugo.io/content-management/page-bundles/ ).
#### Footer Social Icons
2019-01-14 13:08:53 +00:00
2019-01-15 15:20:19 +00:00
With Binario, you have the option to display social icons in the footer. To display them, set up `[Params.Social]` specific parameters in your site config file.
2019-01-14 13:08:53 +00:00
Available social services: Email, Facebook, Twitter, Telegram, Instagram, Pinterest, VK, LinkedIn, GitHub, GitLab, Stack Overflow, Mastodon, Medium
2018-11-28 15:22:51 +00:00
2019-01-15 15:20:19 +00:00
#### Web App Manifest
[Web App Manifest ](https://developers.google.com/web/fundamentals/web-app-manifest/ ) is a simple json file with basic site info like name, description, icons, etc. This file tells the browser about your web application and how it should behave when "installed" (as PWA) on the users mobile device or desktop.
To activate Web App Manifest you need to define `MANIFEST` custom output format & specify `[Params.Manifest]` parameters in your site config file.
First of all, you should define `MANIFEST` custom output format [`config.toml`]:
```toml
[outputFormats]
[outputFormats.MANIFEST]
mediaType = "application/json"
baseName = "manifest"
isPlainText = true
notAlternative = true
```
Then, include `MANIFEST` output format for `home` Kind attribute [`config.toml`]:
```toml
[outputs]
home = ["HTML", "RSS", "MANIFEST"]
```
After that, you can specify `[Params.Manifest]` parameters.
*To verify that your manifest file is configured properly and works well, run Hugo server and open Chrome DevTools (Press F12 in Chrome) → Application → Manifest*
2018-04-25 18:30:37 +00:00
## Contributing
Have a bug? [Please open a new issue ](https://github.com/vimux/binario/issues/new ).
2018-04-26 18:39:01 +00:00
Pull requests are very welcome too, but please make sure they match the existing [contributing guide ](https://github.com/vimux/binario/wiki/contributing ).
2018-04-25 18:30:37 +00:00
## License
Binario is licensed under the [MIT License ](https://github.com/vimux/binario/blob/master/LICENSE ).
2018-06-18 15:33:23 +00:00
* Social media icons based on [SuperTinyIcons ](https://github.com/edent/SuperTinyIcons ) [MIT]
2018-11-14 14:43:53 +00:00
* CSS Reset based on [Bootstrap Reboot ](https://github.com/twbs/bootstrap/blob/v4-dev/dist/css/bootstrap-reboot.css ) [MIT]