❤️A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题 https://hugoloveit.com/
  • JavaScript 62.1%
  • HTML 24.6%
  • SCSS 10.3%
  • CSS 3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dillon 517e0b1093
feat(comment): show the comments of a self-hosted Remark42 server (#1150)
* 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.


---------
2026-12-03 08:54:07 +08:00
.github docs: install the latest release and recommend Hugo Modules (#1141) 2026-12-01 12:57:17 +08:00
archetypes feat(seo): let a page override its canonical URL with canonicalURL (#1138) 2026-11-30 23:32:19 +08:00
assets feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
docs ci(metrics): serve the measured site with brotli, as hosts and CDNs do (#1149) 2026-12-03 08:35:42 +08:00
exampleSite feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
i18n feat(comment): give Waline the theme colors, show its page views and comment counts, and upgrade it to v3.16.3 (#1140) 2026-11-30 23:56:55 +08:00
images docs: refresh the device preview and drop the Sponsor and Stargazers sections (#1100) 2026-11-27 02:04:40 +08:00
layouts feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
scripts ci(metrics): serve the measured site with brotli, as hosts and CDNs do (#1149) 2026-12-03 08:35:42 +08:00
tests feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
.gitattributes feat(comment): show the replies to a Mastodon post as comments (#1125) 2026-11-28 18:43:16 +08:00
.gitignore ci: record Lighthouse, axe-core and build-time baselines for the example site (#1093) 2026-11-24 17:09:47 +08:00
.hvm build(hugo): bump hvm to v1.0.0 and lock Hugo to v0.170.1 (#1061) 2026-11-21 19:28:52 +08:00
.nvmrc build(deps): upgrade Node, sass-embedded, pagefind, Playwright and html-proofer (#1079) 2026-11-22 19:25:14 +08:00
CHANGELOG.md feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
CONTRIBUTING.md docs: fix broken links and outdated notes (#1131) 2026-11-28 20:49:39 +08:00
Gemfile build(deps): upgrade Node, sass-embedded, pagefind, Playwright and html-proofer (#1079) 2026-11-22 19:25:14 +08:00
Gemfile.lock build(deps): upgrade Node, sass-embedded, pagefind, Playwright and html-proofer (#1079) 2026-11-22 19:25:14 +08:00
go.mod
hugo.toml feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
LICENSE
lighthouserc.json ci: record Lighthouse, axe-core and build-time baselines for the example site (#1093) 2026-11-24 17:09:47 +08:00
metrics-budget.json ci(metrics): post Metrics results as a pull request comment (#1128) 2026-11-28 19:29:37 +08:00
netlify.toml ci: record Lighthouse, axe-core and build-time baselines for the example site (#1093) 2026-11-24 17:09:47 +08:00
package-lock.json chore(search): remove Lunr.js and make Fuse.js the default search engine (#1136) 2026-11-30 13:17:10 +08:00
package.json chore(search): remove Lunr.js and make Fuse.js the default search engine (#1136) 2026-11-30 13:17:10 +08:00
playwright.config.mjs fix(search): complete Pagefind integration and add regression coverage 2026-10-22 11:41:40 -07:00
README.md feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
README.zh-cn.md feat(comment): show the comments of a self-hosted Remark42 server (#1150) 2026-12-03 08:54:07 +08:00
SECURITY.md docs: add CHANGELOG, CONTRIBUTING and SECURITY files (#1091) 2026-11-24 16:53:28 +08:00
theme.toml docs: fix broken links and outdated notes (#1131) 2026-11-28 20:49:39 +08:00

LoveIt

LoveIt Theme | Hugo

GitHub release (latest by date) Hugo License Netlify Status CI Nightly

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.

Hugo Theme LoveIt

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/height and 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

Languages Compatibility

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:

Author

Dillon