LoveIt/README.md

150 lines
5.5 KiB
Markdown
Raw Normal View History

2019-08-06 17:49:02 +02:00
# LoveIt Hugo Theme
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
LoveIt is a clean, elegant, simple but not simpler blog theme for Hugo based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) and [KeepIt Theme](https://github.com/liuzc/LeaveIt/) developed by [Dillon](https://dillonzq.com).
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
![hugo-theme-LoveIt](https://github.com/dillonzq/LoveIt/blob/master/images/screenshot.png)
## Demo
2019-02-03 12:30:34 +01:00
2019-02-25 01:04:37 +01:00
To see this theme in action, Here is a live [demo site](https://suspicious-archimedes-ab369d.netlify.com) which is rendered with this theme.
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
People that are using **LoveIt**:
2019-03-11 16:39:26 +01:00
2019-08-06 17:49:02 +02:00
* [Dillon](https://dillonzq.com)
2019-03-11 16:39:26 +01:00
2019-08-06 17:49:02 +02:00
## Features
2019-02-03 12:30:34 +01:00
* Optimized for performance: 99/100 on mobile and 100/100 on desktop in Google PageSpeed Insights
* Optimized SEO performance with a correct SEO SCHEMA based on JSON-LD
* A More coerent style beetwen page and sections
2019-02-25 01:13:36 +01:00
* Multilanguage support
* Pagination support
2019-03-14 11:40:45 +01:00
* Google Analytics support
2019-03-15 10:25:08 +01:00
* Disqus Comment System
* Gitalk Comment System
2019-04-30 09:38:40 +02:00
* Valine Comment System
2019-03-15 11:08:28 +01:00
* Gravatar Support
2019-03-27 10:52:06 +01:00
* Local Avatar Support
2019-03-14 11:40:45 +01:00
* Share post support
2019-03-24 10:20:09 +01:00
* Search engine verification support (Google, Bind, Yandex and Baidu)
2019-02-03 12:30:34 +01:00
* Added configuration file for use on [Netlify](https://www.netlify.com)
2019-02-25 01:13:36 +01:00
* Dark/Light mode
2019-03-24 10:20:09 +01:00
* Up to 54 social sites supported out-of-the-box [see the list here](https://github.com/Fastbyte01/KeepIt/wiki/List-of-social-platforms-supported-out-of-box)
2019-03-14 11:40:45 +01:00
* Translation ready
2019-02-03 12:30:34 +01:00
* Wrap Image with Figure Tag without Shortcode. Thanks [Junian.Net](https://www.junian.net/hugo-image-figure-wrap/)
* Load images with Lazy Load By [lazysizes](https://github.com/aFarkas/lazysizes)
* Automatically highlighting code By [Google code-prettify](https://github.com/google/code-prettify), Customizable styles via CSS. See the [themes gallery](https://rawgit.com/google/code-prettify/master/styles/index.html).
* Automagical image gallery with [lightGallery](https://github.com/sachinchoolur/lightGallery)
* ...
2019-08-06 17:49:02 +02:00
## Getting Started
2019-02-03 12:30:34 +01:00
Clone this repository to your hugo theme directory.
```bash
2019-08-06 17:49:02 +02:00
cd themes
git clone https://github.com/dillonzq/LoveIt.git
2019-02-03 12:30:34 +01:00
```
2019-03-27 10:52:06 +01:00
Next, open config.toml in the base of the Hugo site and ensure the theme option is set to KeepIt:
2019-08-06 17:49:02 +02:00
2019-02-03 12:30:34 +01:00
```bash
2019-08-06 17:49:02 +02:00
theme = "LoveIt"
2019-02-03 12:30:34 +01:00
```
2019-08-06 17:49:02 +02:00
2019-02-03 12:30:34 +01:00
For more information read the [official setup guide](https://gohugo.io/documentation/) of Hugo.
2019-08-06 17:49:02 +02:00
## Site Configuration
2019-02-03 12:30:34 +01:00
Take a look in the `exampleSite` folder.
This directory contains an example config file and the content for the demo. It serves as an example setup for your documentation.
Copy the `config.toml` in the root directory of your website. Overwrite the existing config file if necessary.
2019-08-06 17:49:02 +02:00
## Content Suggestions
2019-02-03 12:30:34 +01:00
A few suggestions to help you get a good looking site quickly:
* Keep blog posts in the content/posts directory, for example: content/posts/my-first-post.md
* Keep static pages in the content directory, for example: content/about.md
* Keep media like images in the static directory, for example: static/images/2019/10/screenshot.png
2019-08-06 17:49:02 +02:00
## Customizing styles for your website
2019-02-03 12:30:34 +01:00
If you want to change some styling to fit your own website needs, you can edit them:
* `assets/css/_varibales/default.scss`: You can override the variables in `_variables.scss` to customize the style
* `assets/css/_custom.scss` : You can put your custom css in this file
2019-08-06 17:49:02 +02:00
## Favicons, Browserconfig, Manifest
2019-02-03 12:30:34 +01:00
It is recommended to put your own favicons
* apple-touch-icon.png (180x180)
* favicon-32x32.png (32x32)
* favicon-16x16.png (16x16)
* mstile-150x150.png (150x150)
* android-chrome-192x192.png (192x192)
* android-chrome-512x512.png (512x512)
2019-08-06 17:49:02 +02:00
into `/static`. Theyre easily created via [https://realfavicongenerator.net/](https://realfavicongenerator.net/).
2019-02-03 12:30:34 +01:00
Customize browserconfig.xml and site.webmanifest to set theme-color and background-color for example.
2019-08-06 17:49:02 +02:00
## Tips
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
### Set production environment when generating site
2019-02-03 12:30:34 +01:00
Because some functions are only in production mode, So you **need to add a production** environment variables when generating your site.
2019-08-06 17:49:02 +02:00
2019-02-03 12:30:34 +01:00
```bash
2019-08-06 17:49:02 +02:00
HUGO_ENV=production hugo --gc --minify
2019-02-03 12:30:34 +01:00
```
2019-08-06 17:49:02 +02:00
### Hugo “extended” Sass/SCSS version required
2019-02-03 12:30:34 +01:00
This theme write style with scss, So you must download and install the “extended” Sass/SCSS version
2019-08-06 17:49:02 +02:00
### How to toggle dark-light mode
2019-02-26 00:47:18 +01:00
* You can click the sun logo to toggle dark-light mode. In the desktop version the sun logo is to the right and in the mobile version is positioned to the left, close to the site title.
2019-02-03 12:40:34 +01:00
* If you want to make your own theme toggle-able element, you can create an element with a class `.theme-switch`. See [here](https://github.com/Fastbyte01/KeepIt/blob/master/assets/js/main.js#L32)
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
## Home Post model
2019-02-03 12:30:34 +01:00
If you want to show posts on index instead of a personal profile, just open config.toml in the base of the Hugo site, add the following line to config.toml
2019-08-06 17:49:02 +02:00
2019-02-03 12:30:34 +01:00
```toml
2019-08-06 17:49:02 +02:00
[params]
home_mode = "post" # post or other
2019-02-03 12:30:34 +01:00
```
2019-08-06 17:49:02 +02:00
## Add logo and cover for SEO
2019-02-03 12:40:34 +01:00
Add a logo image (127x40) and a cover image (800x600). This images are used for SEO.
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
## Questions, ideas, bugs, pull requests
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
All feedback is welcome! Head over to the [issue tracker](https://github.com/dillonzq/LoveIt/issues).
For more configuration info or other tips you can see the [wiki](https://github.com/dillonzq/LoveIt/wiki).
## License
2019-03-11 16:39:26 +01:00
2019-02-03 12:30:34 +01:00
LeaveIt is licensed under the MIT license. Check the LICENSE file for details.
The following resources are included in the theme:
2019-08-06 17:49:02 +02:00
* [lazysizes](https://github.com/aFarkas/lazysizes)
* [lightGallery](https://github.com/sachinchoolur/lightGallery)
* [code-prettify](https://github.com/google/code-prettify)
## Author
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
[Dillon](https://dillonzq.com)
2019-02-03 12:30:34 +01:00
2019-08-06 17:49:02 +02:00
## See Also
2019-02-03 12:30:34 +01:00
* [Hermitt](https://github.com/Track3/hermit)
* [Goa](https://github.com/shenoybr/hugo-goa)