- JavaScript 62.1%
- HTML 24.6%
- SCSS 10.3%
- CSS 3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* feat(comment): show the comments of a self-hosted Remark42 server `type = "remark42"` with the `host` of a Remark42 server loads `web/embed.mjs` from that server and shows the comments of the page in its iframe, kept by the permalink of the page. `window.remark_config` gets the site theme before the script loads, and the comments follow the theme attribute of the body afterwards through `REMARK42.changeTheme`, so they also change with the system color scheme in the auto mode. The widget is shown in the language of the page when Remark42 has a translation for it (the new `remark42Locale` key of each translation file), and `siteId` (`remark` by default), `locale`, `maxShownComments`, `showEmailSubscription`, `showRssSubscription`, `simpleView` and `noFooter` set its options. A `host` that is not the http(s) URL of a server prints one build warning, as the Comentario `url` does: both are now checked by `function/server-url.html`. * fix(comment): take the Remark42 locale from the site language and reject numeric hosts browsers refuse - The locale comes from the language of the site rather than a translation key, which Hugo took from the default language for a language without a translation file of the theme: Finnish now shows Finnish and Danish English, also when the default language is not English. - A host whose last label is a number must be a dotted-decimal IPv4 address (https://256.1.1.1 warns), for Comentario as well. - The guides say that Remark42 serves web/embed.mjs since 1.17.0. * fix(comment): accept a trailing dot after an IPv4 host and catch fullwidth numeric hosts A server URL such as http://192.168.0.1.:8080, which browsers load, was refused once the host was checked as an IPv4 address; the address is now compared without the trailing dot. Fullwidth digits, letters and dots, which browsers read as ASCII ones, make a numeric last label too, so https://256.1.1.1 warns instead of rendering a widget that cannot load. * fix(comment): let a Chinese script subtag choose the Remark42 locale over the region zh-Hans-HK is Simplified Chinese, so it now shows Remark42 in `zh` rather than `zh-tw`; a region selects Traditional Chinese only when the language tag has no script. * fix(comment): ignore private-use and extension subtags when choosing the Remark42 locale zh-Hans-x-hant is Simplified Chinese: the script and the region of a language tag are read only before its first singleton. * fix(comment): let any Chinese script subtag, not only Hans, keep the region from choosing zh-tw zh-Latn-HK has a script, so the Hong Kong region no longer makes it Traditional Chinese; only Hant does, and a region decides only when the tag has no script. --------- |
||
| .github | ||
| archetypes | ||
| assets | ||
| docs | ||
| exampleSite | ||
| i18n | ||
| images | ||
| layouts | ||
| scripts | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .hvm | ||
| .nvmrc | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| Gemfile | ||
| Gemfile.lock | ||
| go.mod | ||
| hugo.toml | ||
| LICENSE | ||
| lighthouserc.json | ||
| metrics-budget.json | ||
| netlify.toml | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.mjs | ||
| README.md | ||
| README.zh-cn.md | ||
| SECURITY.md | ||
| theme.toml | ||
LoveIt Theme | Hugo
English README | 简体中文说明
LoveIt is a clean, elegant but advanced blog theme for Hugo.
It is based on the original LeaveIt Theme and KeepIt Theme.
Since the three themes have a similar look, if you have questions about their differences, read Why choose LoveIt so that you can choose the one that works best for you.
Demo Site
To see this theme in action, here is a live demo site which is rendered with LoveIt theme.
Why choose LoveIt
Compared to the original LeaveIt theme and the KeepIt theme, the LoveIt theme has the following modifications.
- Custom Header
- Custom CSS Style
- A new home page, compatible with the latest version of Hugo
- A lot of style detail adjustments, including color, font size, margins, code preview style
- More readable dark mode
- Some beautiful CSS animations
- Easy-to-use and self-expanding table of contents
- More social links, share sites and comment system
- Search supported by Fuse.js, algolia or Pagefind
- Copy code to clipboard with one click
- Extended Markdown syntax for Font Awesome icons
- Extended Markdown syntax for ruby annotation
- Extended Markdown syntax for fraction
- Mathematical formula supported by KaTeX
- Diagram syntax shortcode supported by Pele or mermaid
- Interactive data visualization shortcode supported by ECharts
- Mapbox shortcode supported by Mapbox GL JS
- Embedded music player supported by APlayer and MetingJS
- Bilibili player supported
- Kinds of admonitions shortcode supported
- Custom style shortcodes supported
- CDN for all third-party libraries supported
- ...
In short, if you prefer the design language and freedom of the LoveIt theme, if you want to use the extended Font Awesome icons conveniently, if you want to embed mathematical formulas, flowcharts, music or Bilibili videos in your posts, the LoveIt theme may be more suitable for you.
I hope you will LoveIt ❤️!
Features
Performance and SEO
- 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
- Google Analytics supported
- Fathom Analytics supported
- Plausible Analytics supported
- Yandex Metrica supported
- Search engine verification supported (Google, Bing, Yandex and Baidu)
- CDN for third-party libraries supported
- Responsive images processed by Hugo, with WebP copies,
width/heightand native lazy loading
Appearance and Layout
- Desktop/Mobile Responsive layout
- Light/Dark mode
- Globally consistent design language
- Pagination supported
- Easy-to-use and self-expanding table of contents
- Multilanguage supported and i18n ready
- Right-to-left languages supported
- Beautiful CSS animation
- Accessibility: skip link, reduced motion and semantic controls
Social and Comment Systems
- Gravatar supported by Gravatar
- Local Avatar supported
- Up to 84 social links supported
- Up to 30 share sites supported
- Disqus comment system supported by Disqus
- Gitalk comment system supported by Gitalk
- Valine comment system supported by Valine
- Facebook comments system supported by Facebook
- Telegram comments system supported by Telegram Comments
- Commento comment system supported by Commento
- utterances comment system supported by utterances
- giscus comment system supported by giscus
- Waline comment system supported by Waline
- Twikoo comment system supported by Twikoo
- Mastodon comments: the replies to a post on Mastodon or another Fediverse server
- Comentario comment system supported by Comentario
- Remark42 comment system supported by Remark42
Extended Features
- Search supported by Fuse.js, algolia or Pagefind
- Twemoji supported
- Automatically highlighting code
- Copy code to clipboard with one click
- Images gallery supported by lightGallery
- Extended Markdown syntax for Font Awesome icons
- Extended Markdown syntax for ruby annotation
- Extended Markdown syntax for fraction
- Mathematical formula supported by KaTeX
- Diagrams shortcode supported by Pele or mermaid
- Interactive data visualization shortcode supported by ECharts
- Mapbox shortcode supported by Mapbox GL JS
- Music player shortcode supported by APlayer and MetingJS
- Bilibili player shortcode
- Kinds of admonitions shortcode
- Custom style shortcode
- Custom script shortcode
- Animated typing supported by TypeIt
- Cookie consent banner supported by cookieconsent
- Person shortcode
- ...
Quick Start
Install Hugo 0.146.0 or later, Dart Sass, Go and Git. Then create a site that uses the latest release of LoveIt as a Hugo Module:
hugo new site my_website
cd my_website
hugo mod init github.com/username/my_website
hugo mod get github.com/dillonzq/LoveIt
Add theme = "github.com/dillonzq/LoveIt" to hugo.toml, then run hugo server.
To install the theme as a Git submodule or a .zip file instead, and to configure it,
see the installation guide.
Documentation
Build Documentation Locally:
npm ci --ignore-scripts
npm run dev
Development uses .hvm to pin Hugo and npm to provide Dart Sass. Run npm run build for production; see the development guide for version overrides, search and tests.
Compatibility
| LoveIt branch or version | Supported Hugo versions |
|---|---|
| master(Unstable) | >= 0.146.0 |
| 0.4.X(Recommended) | >= 0.146.0 |
| 0.3.X | 0.128.0 - 0.145.0 |
| 0.2.X(Outdated) | 0.68.0 - 0.127.0 |
Multilingual and i18n
LoveIt supports the following languages:
- English
- Simplified Chinese
- Traditional Chinese
- French
- Polish
- Portuguese (Brazil)
- Italian
- Spanish
- German
- Serbian
- Russian
- Romanian
- Vietnamese
- Arabic
- Catalan
- Thai
- Telugu
- Indonesian
- Turkish
- Korean
- Hindi
- Dutch
- Bengali
- Japanese
- Swedish
- Ukrainian
- Contribute with a new language
Questions, ideas, bugs, pull requests
All feedback is welcome! Head over to the issue tracker.
Before opening a pull request, read the contributing guide. Report security vulnerabilities privately as described in the security policy. Changes between versions are listed in the changelog.
License
LoveIt is licensed under the MIT license. Check the LICENSE file for details.
The MIT license covers the theme's own code only. Bundled third-party libraries keep their own licenses, listed in assets/lib/VERSION.md. Some of them are not permissive:
- TypeIt and lightGallery are dual-licensed under GPL-3.0 or a paid commercial license. TypeIt runs the home page subtitle animation, which is on by default; lightGallery is off by default. A commercial site that cannot meet GPL-3.0 should buy a commercial license or turn these features off. Turning a feature off only keeps its library out of the generated site; the theme source still contains it, and redistributing that source must follow the library's license.
- Valine is GPL-2.0.
- Mapbox GL JS is proprietary and follows the Mapbox Terms of Service.
Special Thanks
Thanks to the authors of following resources included in the theme:
- modern-normalize
- Font Awesome
- Simple Icons
- algoliasearch
- Fuse.js
- Pagefind
- Twemoji
- emoji-data
- lightGallery
- Sharer.js
- TypeIt
- KaTeX
- mermaid
- Pele
- ECharts
- Mapbox GL JS
- APlayer
- MetingJS
- Gitalk
- Valine
- Waline
- Twikoo
- DOMPurify
- cookieconsent
