# Theme Documentation - Basics


Discover what the Hugo - **LoveIt** theme is all about and the core-concepts behind it.

<!--more-->

## 1 Requirements

Install the latest edition of [:(far fa-file-archive): Hugo](https://gohugo.io/getting-started/installing/) for your OS (**Windows**, **Linux**, **macOS**).
The theme ships its styles compiled, so [Dart Sass](https://gohugo.io/functions/css/sass/#dart-sass) is needed only when you [customize the styles](#style-customization)
or use the [`style` shortcode](../theme-documentation-extended-shortcodes#1-style).

To install the theme as a [Hugo Module](#hugo-module), the recommended way, also install [Go](https://go.dev/doc/install) and [Git](https://git-scm.com/downloads).

{{< admonition note "LoveIt 0.4.X requires Hugo 0.146.0 or later" >}}
{{< version 0.4.0 >}}

**LoveIt 0.4.X** requires **Hugo 0.146.0 or later**.
When the theme compiles its styles, it does so with [**Dart Sass**](https://gohugo.io/functions/css/sass/#dart-sass):
install it next to Hugo, as the extended edition of Hugo is not enough, and Hugo 0.170.0 no longer ships one.
{{< version 0.4.3 changed >}} A site that keeps the theme styles builds without Dart Sass.

If you are upgrading from LoveIt 0.3.X, read [Upgrade from 0.3.X](#upgrade-from-0-3) first.
{{< /admonition >}}

## 2 Installation

The following steps are here to help you initialize your new website. If you don’t know Hugo at all, we strongly suggest you learn more about it by following this [great documentation for beginners](https://gohugo.io/getting-started/quick-start/).

### 2.1 Create Your Project

Hugo provides a `new` command to create a new website:

```bash
hugo new site my_website
cd my_website
```

### 2.2 Install the Theme

The **LoveIt** theme's repository is: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt).

Install a released version of the theme, as each method below does.
The `release` branch always points to the latest release.
The `master` branch is where the theme is developed, so it may contain unreleased and unstable changes.
To upgrade the theme later, see [Upgrade the Theme](#upgrade-the-theme).

#### 2.2.1 Hugo Module (Recommended) {#hugo-module}

With [Hugo Modules](https://gohugo.io/hugo-modules/), Hugo downloads the theme itself and records its version in `go.mod`,
so you do not keep a copy of the theme in your site. This needs [Go](https://go.dev/doc/install) and [Git](https://git-scm.com/downloads).
Make your site a Hugo Module with any module path, such as the path of your repository, then get the theme.
Hugo picks its latest release:

```bash
hugo mod init github.com/username/my_website
hugo mod get github.com/dillonzq/LoveIt
```

Commit `go.mod` and `go.sum` with your site.
The [basic configuration](#basic-configuration) below uses the theme with `theme = "github.com/dillonzq/LoveIt"`.

The following methods put the theme in the `themes/LoveIt` directory instead.
With them, set `theme = "LoveIt"` in the basic configuration.

#### 2.2.2 Git Submodule

Make your site directory a Git repository and add the `release` branch of the theme as a submodule:

```bash
git init
git submodule add -b release https://github.com/dillonzq/LoveIt.git themes/LoveIt
```

Your site repository records the version of the theme, and `-b release` lets you [upgrade it](#upgrade-the-theme) to the next release.

#### 2.2.3 Release .zip File

Open the [latest release](https://github.com/dillonzq/LoveIt/releases/latest) of the theme
and download its **:(far fa-file-archive): Source code (zip)**.
The archive extracts to a `LoveIt-x.y.z` directory (`x.y.z` is the version):
move it to the `themes` directory and rename it to `LoveIt`, so that the theme files are directly in `themes/LoveIt`.

#### 2.2.4 Git Clone

Or, clone the `release` branch of this repository to the `themes` directory:

```bash
git clone -b release https://github.com/dillonzq/LoveIt.git themes/LoveIt
```

{{< admonition warning "Deploying from a Git repository" >}}
Build services such as Netlify, Vercel, Cloudflare Pages and GitHub Actions build from your site's repository,
so the theme must be in it as a Hugo Module, a submodule or the committed files of a release .zip, as above.
A Hugo Module also needs Go on the build service.
If you `git clone` the theme into `themes/` inside your site repository and commit it,
Git records only a reference to the nested repository, not its files.
The site then builds on your computer but not on the service,
which reports errors such as `template for shortcode "typeit" not found`
or `found no layout file for "html" for kind "home"`.
If you have already committed such a clone, switch it to the `release` branch and turn it into a submodule
(`git submodule add` reuses the existing clone and records the commit it has checked out):

```bash
git -C themes/LoveIt fetch origin
git -C themes/LoveIt checkout -B release origin/release
git rm --cached themes/LoveIt
git submodule add -b release https://github.com/dillonzq/LoveIt.git themes/LoveIt
git commit -m "Add LoveIt as a submodule"
```

If you changed the theme in that clone, push your commits to a fork and use the fork's URL instead:
a build service can only fetch commits that exist in the submodule's repository.

With GitHub Actions, check out the submodules too (`submodules: true` for `actions/checkout`).
Also set the Hugo version the service uses (for example the `HUGO_VERSION` environment variable on Netlify and Vercel)
to one this theme supports: older Hugo versions report the same `found no layout file` warnings.
{{< /admonition >}}

{{< admonition note "LoveIt theme's 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     |

{{< /admonition >}}

### 2.3 Basic Configuration {#basic-configuration}

The following is a basic configuration for the LoveIt theme:

```toml
baseURL = "http://example.org/"

# Change the default theme to be used when building the site with Hugo
# the module path of the theme as a Hugo Module, or "LoveIt" for the theme in the "themes/LoveIt" directory
theme = "github.com/dillonzq/LoveIt"

# website title
title = "My New Hugo Site"

# language code ["en", "zh-CN", "fr", "pl", ...]
locale = "en"
# language name ["English", "简体中文", "Français", "Polski", ...]
label = "English"

# Menu config
[menu]
  [[menu.main]]
    weight = 1
    identifier = "posts"
    # you can add extra information before the name (HTML format is supported), such as icons
    pre = ""
    # you can add extra information after the name (HTML format is supported), such as icons
    post = ""
    name = "Posts"
    url = "/posts/"
    # title will be shown when you hover on this menu link
    title = ""
  [[menu.main]]
    weight = 2
    identifier = "tags"
    pre = ""
    post = ""
    name = "Tags"
    url = "/tags/"
    title = ""
  [[menu.main]]
    weight = 3
    identifier = "categories"
    pre = ""
    post = ""
    name = "Categories"
    url = "/categories/"
    title = ""

# Markup related configuration in Hugo
[markup]
  # Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting)
  [markup.highlight]
    # false is a necessary configuration (https://github.com/dillonzq/LoveIt/issues/158)
    noClasses = false
```

{{< admonition >}}
When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (**hugo.toml**) and set the theme as the default.
{{< /admonition >}}

### 2.4 Create Your First Post

Here is the way to create your first post:

```bash
hugo new posts/first_post.md
```

Feel free to edit the post file by adding some sample content and replacing the title value in the beginning of the file.

{{< admonition >}}
By default all posts and pages are created as a draft. If you want to render these pages, remove the property `draft: true` from the metadata, set the property `draft: false` or add `-D`/`--buildDrafts` parameter to `hugo` command.
{{< /admonition >}}

### 2.5 Launching the Website Locally

Launch by using the following command:

```bash
hugo serve
```

Go to `http://localhost:1313`.

![Basic configuration preview](basic-configuration-preview.png "Basic configuration preview")

{{< admonition tip >}}
When you run `hugo serve`, when the contents of the files change, the page automatically refreshes with the changes.
{{< /admonition >}}

{{< admonition >}}
Since the theme uses `.Scratch` in Hugo to implement some features,
it is highly recommended that you add `--disableFastRender` parameter to `hugo server` command for the live preview of the page you are editing.

```bash
hugo serve --disableFastRender
```

{{< /admonition >}}

### 2.6 Build the Website

When your site is ready to deploy, run the following command:

```bash
hugo
```

A `public` folder will be generated, containing all static content and assets for your website. It can now be deployed on any web server.

{{< admonition tip >}}
The website can be automatically published and hosted with [Netlify](https://gohugo.io/host-and-deploy/deploy-to-netlify/),
[GitHub Pages](https://gohugo.io/host-and-deploy/deploy-to-github-pages/), [AWS Amplify](https://gohugo.io/host-and-deploy/deploy-to-aws-amplify/),
[Render](https://gohugo.io/host-and-deploy/deploy-to-render/) and [more](https://gohugo.io/host-and-deploy/).
Set up Go on the service for a Hugo Module, and Dart Sass if the site [needs it](#1-requirements), as these guides describe.
{{< /admonition >}}

## 3 Configuration

### 3.1 Site Configuration {#site-configuration}

In addition to [Hugo global configuration](https://gohugo.io/configuration/) and [menu configuration](#basic-configuration), **LoveIt** lets you define the following parameters in your site configuration (here is a `hugo.toml`, whose values are default).

Please open the code block below to view the complete sample configuration :(far fa-hand-point-down)::

```toml
baseURL = "http://example.org/"

# Change the default theme to be used when building the site with Hugo
# the module path of the theme as a Hugo Module, or "LoveIt" for the theme in the "themes/LoveIt" directory
theme = "github.com/dillonzq/LoveIt"

# website title
title = "My New Hugo Site"

# language code ["en", "zh-CN", "fr", "pl", ...]
locale = "en"
# language name ["English", "简体中文", "Français", "Polski", ...]
label = "English"
# whether to include Chinese/Japanese/Korean
hasCJKLanguage = false

# copyright description used only for seo schema
copyright = ""

# whether to use robots.txt
enableRobotsTXT = true
# whether to use git commit log
enableGitInfo = true
# whether to use emoji code
enableEmoji = true

# Pagination config
[pagination]
  disableAliases = false
  pagerSize = 10
  path = "page"

# Menu config
[menu]
  [[menu.main]]
    weight = 1
    identifier = "posts"
    # you can add extra information before the name (HTML format is supported), such as icons
    pre = ""
    # you can add extra information after the name (HTML format is supported), such as icons
    post = ""
    name = "Posts"
    url = "/posts/"
    # title will be shown when you hover on this menu link
    title = ""
  [[menu.main]]
    weight = 2
    identifier = "tags"
    pre = ""
    post = ""
    name = "Tags"
    url = "/tags/"
    title = ""
  [[menu.main]]
    weight = 3
    identifier = "categories"
    pre = ""
    post = ""
    name = "Categories"
    url = "/categories/"
    title = ""

[params]
  # site default theme ["auto", "light", "dark"]
  defaultTheme = "auto"
  # public git repo url only then enableGitInfo is true
  gitRepo = ""
  # {{< version 0.1.1 >}} which hash function used for SRI, when empty, no SRI is used
  # ["sha256", "sha384", "sha512", "md5"]
  fingerprint = ""
  # {{< version 0.2.0 >}} date format
  dateFormat = "2006-01-02"
  # website title for Open Graph and Twitter Cards
  title = "My cool site"
  # website description for RSS, SEO, Open Graph and Twitter Cards
  description = "This is my cool site"
  # default images for Open Graph and Twitter Cards when a page has none (path under "static/" or "assets/", or a URL)
  images = []

# Author config
  [params.author]
    name = "xxxx"
    email = ""
    link = ""
    # {{< version 0.4.2 >}} author avatar shown in the post meta instead of the user icon (path under "static/" or "assets/", or URL)
    avatar = ""
    # {{< version 0.4.3 >}} job title of the author in the structured data (JSON-LD)
    jobTitle = ""
    # {{< version 0.4.3 >}} profile URLs of the author in the structured data (JSON-LD), such as GitHub, LinkedIn or Mastodon
    sameAs = []

  # Header config
  [params.header]
    # desktop header mode ["fixed", "normal", "auto"]
    desktopMode = "fixed"
    # mobile header mode ["fixed", "normal", "auto"]
    mobileMode = "auto"
    # {{< version 0.2.0 >}} Header title config
    [params.header.title]
      # URL of the LOGO
      logo = ""
      # title name
      name = "My cool site"
      # you can add extra information before the name (HTML format is supported), such as icons
      pre = ""
      # you can add extra information after the name (HTML format is supported), such as icons
      post = ""
      # {{< version 0.2.5 >}} whether to use typeit animation for title name
      typeit = false

  # Footer config
  [params.footer]
    enable = true
    # {{< version 0.2.0 >}} Custom content (HTML format is supported)
    custom = ''
    # {{< version 0.2.0 >}} whether to show Hugo and theme info
    hugo = true
    # {{< version 0.2.0 >}} whether to show copyright info
    copyright = true
    # {{< version 0.2.0 >}} whether to show the author
    author = true
    # Site creation time
    since = 2022
    # ICP info only in China (HTML format is supported)
    icp = ""
    # license info (HTML format is supported)
    license = ""

  # {{< version 0.2.0 >}} Section (all posts) page config
  [params.section]
    # special amount of posts in each section page
    paginate = 20
    # date format (month and day)
    dateFormat = "01-02"
    # amount of RSS pages
    rss = 10

  # {{< version 0.2.0 >}} List (category or tag) page config
  [params.list]
    # special amount of posts in each list page
    paginate = 20
    # date format (month and day)
    dateFormat = "01-02"
    # amount of RSS pages
    rss = 10

  # {{< version 0.2.0 >}} App icon config
  [params.app]
    # optional site title override for the app when added to an iOS home screen or Android launcher
    title = "My cool site"
    # whether to omit favicon resource links
    noFavicon = false
    # modern SVG favicon to use in place of older style .png and .ico files
    svgFavicon = ""
    # Android browser theme color
    themeColor = "#ffffff"
    # Safari mask icon color
    iconColor = "#5bbad5"
    # Windows v8-11 tile color
    tileColor = "#da532c"

  # {{< version 0.2.0 >}} Search config
  [params.search]
    enable = false
    # {{< version 0.4.3 changed >}} type of search engine ["fuse", "algolia", "pagefind"] ("lunr" is deprecated)
    type = "fuse"
    # max index length of the chunked content
    contentLength = 4000
    # placeholder of the search bar
    placeholder = ""
    # {{< version 0.2.1 >}} max number of results length
    maxResultLength = 10
    # {{< version 0.2.3 >}} snippet length of the result
    snippetLength = 30
    # {{< version 0.2.1 >}} HTML tag name of the highlight part in results
    highlightTag = "em"
    # {{< version 0.2.4 >}} whether to use the absolute URL based on the baseURL in search index
    absoluteURL = false
    [params.search.algolia]
      index = ""
      appID = ""
      searchKey = ""
    # {{< version 0.4.0 >}} {{< link "https://fusejs.io/api/options.html" "Fuse.js" >}} options
    [params.search.fuse]
      isCaseSensitive = false
      minMatchCharLength = 2
      findAllMatches = false
      location = 0
      threshold = 0.3
      distance = 100
      ignoreLocation = true # {{< version 0.4.3 changed >}} match anywhere in the content
    # {{< version 0.4.0 >}} {{< link "https://pagefind.app/" "Pagefind" >}} config
    [params.search.pagefind]
      # directory of the Pagefind index, relative to the baseURL
      basePath = "/_pagefind/"

  # Home page config
  [params.home]
    # {{< version 0.2.0 >}} amount of RSS pages
    rss = 10
    # Home page profile
    [params.home.profile]
      enable = true
      # Gravatar Email for preferred avatar in home page
      gravatarEmail = ""
      # URL of avatar shown in home page
      avatarURL = ""
      # {{< version 0.2.7 changed >}} title shown in home page (HTML format is supported)
      title = ""
      # subtitle shown in home page (HTML format is supported)
      subtitle = "This is my cool site"
      # whether to use typeit animation for subtitle
      typeit = true
      # {{< version 0.4.0 >}} extra text shown below the subtitle, such as a quote or a short summary (HTML format is supported)
      extra = ""
      # {{< version 0.4.0 >}} whether to show the extra text in italic
      extraItalic = true
      # whether to show social links
      social = true
      # {{< version 0.2.0 >}} disclaimer (HTML format is supported)
      disclaimer = ""
    # Home page posts
    [params.home.posts]
      enable = true
      # special amount of posts in each home posts page
      paginate = 6

  # Social config about the author
  [params.social]
    GitHub = ""
    Linkedin = ""
    X = "" # {{< version 0.3.1 >}}
    Twitter = "" # {{< version 0.3.1 deprecated >}}
    Instagram = ""
    Facebook = ""
    Telegram = ""
    Medium = ""
    Gitlab = ""
    Youtubelegacy = ""
    Youtubecustom = ""
    Youtubechannel = ""
    Tumblr = ""
    Quora = ""
    Keybase = ""
    Pinterest = ""
    Reddit = ""
    Codepen = ""
    FreeCodeCamp = ""
    Bitbucket = ""
    Stackoverflow = ""
    Weibo = ""
    Odnoklassniki = ""
    VK = ""
    Flickr = ""
    Xing = ""
    Snapchat = ""
    Soundcloud = ""
    Spotify = ""
    Bandcamp = ""
    Paypal = ""
    Fivehundredpx = ""
    Mix = ""
    Goodreads = ""
    Lastfm = ""
    Foursquare = ""
    Hackernews = ""
    Kickstarter = ""
    Patreon = ""
    Steam = ""
    Twitch = ""
    Strava = ""
    Skype = ""
    Whatsapp = ""
    Zhihu = ""
    Douban = ""
    Angellist = ""
    Slidershare = ""
    Jsfiddle = ""
    Deviantart = ""
    Behance = ""
    Dribbble = ""
    Wordpress = ""
    Vine = ""
    Googlescholar = ""
    Researchgate = ""
    Mastodon = ""
    Thingiverse = ""
    Devto = ""
    Gitea = ""
    XMPP = ""
    Matrix = ""
    Bilibili = ""
    Discord = ""
    DiscordInvite = ""
    Lichess = ""
    ORCID = ""
    Pleroma = ""
    Kaggle = ""
    MediaWiki = ""
    Plume = ""
    HackTheBox = ""
    RootMe = ""
    Malt = "" # {{< version 0.3.0 >}}
    TikTok = "" # {{< version 0.3.0 >}}
    TryHackMe = "" # {{< version 0.3.0 >}}
    Codeberg = "" # {{< version 0.3.0 >}}
    HuggingFace = "" # {{< version 0.3.1 >}}
    Threads = "" # {{< version 0.3.1 >}}
    LeetCode = "" # {{< version 0.3.1 >}}
    LeetCodeCN = ""
    Bluesky = "" # {{< version 0.3.1 >}}
    Email = ""
    Phone = ""
    RSS = "" # {{< version 0.2.0 >}}

  # {{< version 0.4.3 >}} Image config
  [params.image]
    # widths in pixels of the WebP copies in the srcset of content images
    # (Markdown images, the image shortcode, featured images), smallest to largest;
    # widths not below the width of an image become one copy at its own width, and the largest width
    # caps the copies; the src is the widest copy of at most 1024 pixels (else the narrowest copy);
    # [] turns the copies off
    widths = [480, 768, 1024, 1440, 1920]
    # sizes attribute of those images, which tells the browser how wide the image is shown
    # ("" uses the width of the content column of the theme)
    sizes = ""

  # {{< version 0.2.0 changed >}} Page global config
  [params.page]
    # {{< version 0.2.0 >}} whether to hide a page from home page
    hiddenFromHomePage = false
    # {{< version 0.2.0 >}} whether to hide a page from search results
    hiddenFromSearch = false
    # {{< version 0.4.3 >}} whether to ask search engines not to index a page, see "Search Engines and robots.txt" below
    hiddenFromSearchEngines = false
    # {{< version 0.2.0 >}} whether to enable twemoji
    twemoji = false
    # whether to enable lightgallery
    lightgallery = false
    # {{< version 0.2.0 >}} whether to enable the ruby extended syntax
    ruby = true
    # {{< version 0.2.0 >}} whether to enable the fraction extended syntax
    fraction = true
    # {{< version 0.2.0 >}} whether to enable the fontawesome extended syntax
    fontawesome = true
    # {{< version 0.4.2 >}} when to load the Font Awesome stylesheet and webfonts ["auto", true, false]
    # "auto": only on pages whose content or configured HTML (menu, footer...) uses Font Awesome classes,
    # the theme's own icons are inline SVG; true: always, e.g. for your own layouts that use them; false: never
    fontawesomeCSS = "auto"
    # whether to show link to Raw Markdown content of the content
    linkToMarkdown = true
    # {{< version 0.4.3 >}} whether to show "Originally published at" with a link to canonicalURL in the front matter of a post
    linkToCanonical = true
    # {{< version 0.2.4 >}} whether to show the full text content in RSS
    rssFullText = false
    # {{< version 0.2.0 >}} Table of the contents config
    [params.page.toc]
      # whether to enable the table of the contents
      enable = true
      # {{< version 0.2.9 >}} whether to keep the static table of the contents in front of the post
      keepStatic = false
      # whether to make the table of the contents in the sidebar automatically collapsed
      auto = true
    # {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} mathematical formulas
    [params.page.math]
      enable = false
      # {{< version 0.2.11 changed >}} default inline delimiter is $ ... $ and \( ... \)
      inlineLeftDelimiter = ""
      inlineRightDelimiter = ""
      # {{< version 0.2.11 changed >}} default block delimiter is $$ ... $$, \[ ... \], \begin{equation} ... \end{equation} and some other functions
      blockLeftDelimiter = ""
      blockRightDelimiter = ""
      # KaTeX extension copy_tex
      copyTex = true
      # KaTeX extension mhchem
      mhchem = true
    # {{< version 0.2.0 >}} Code config
    [params.page.code]
      # whether to show the copy button of the code block
      copy = true
      # the maximum number of lines of displayed code by default
      maxShownLines = 50
      # {{< version 0.4.2 >}} whether to show the line numbers of code blocks by default
      # readers can toggle them with a button in the header of a code block
      lineNos = false
      # {{< version 0.4.2 >}} whether to wrap the long lines of code blocks by default
      # readers can toggle it with a button in the header of a code block
      wrap = false
    [params.page.code.render]
      # whether to render goat diagrams in code blocks
      goat = true
      # whether to render mermaid diagrams in code blocks
      mermaid = true
    # {{< version 0.4.2 >}} Mermaid diagram config
    [params.page.mermaid]
      # renderer of the mermaid code blocks and shortcodes ["pele", "mermaid"]
      # "pele": the lightweight {{< link "https://pele.run" Pele >}} renderer, colors follow the theme without re-rendering,
      # but its layout differs from Mermaid and it has no HTML labels or click callbacks
      # "mermaid": the {{< link "https://mermaid.js.org" Mermaid >}} library
      renderer = "pele"
    # {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} config
    [params.page.mapbox]
      # access token of Mapbox GL JS
      accessToken = ""
      # style for the light theme
      lightStyle = "mapbox://styles/mapbox/light-v10?optimize=true"
      # style for the dark theme
      darkStyle = "mapbox://styles/mapbox/dark-v10?optimize=true"
      # whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api#navigationcontrol" NavigationControl >}}
      navigation = true
      # whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api#geolocatecontrol" GeolocateControl >}}
      geolocate = true
      # whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api#scalecontrol" ScaleControl >}}
      scale = true
      # whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api#fullscreencontrol" FullscreenControl >}}
      fullscreen = true
    # {{< version 0.4.0 >}} {{< link "https://github.com/metowolf/MetingJS" "MetingJS" >}} config for the music shortcode
    [params.page.music]
      # Meting API URL, supports :server, :type, :id, :auth and :r placeholders
      api = "https://api.injahow.cn/meting/?server=:server&type=:type&id=:id&r=:r"
    # {{< version 0.2.0 changed >}} social share links in post page
    [params.page.share]
      enable = true
      X = true # {{< version 0.3.1 >}}
      Twitter = false # {{< version 0.3.1 deprecated >}}
      Threads = true # {{< version 0.3.1 >}}
      Facebook = true
      Linkedin = false
      Whatsapp = false
      Viber = false
      Pinterest = false
      Tumblr = false
      HackerNews = true
      Reddit = false
      VK = false
      Buffer = false
      Xing = false
      Line = true
      Instapaper = false
      Pocket = false # {{< version 0.4.1 deleted >}}
      Flipboard = false
      Weibo = true
      Blogger = false
      Baidu = false # {{< version 0.4.1 deleted >}}
      Odnoklassniki = false
      Evernote = false
      Skype = false # {{< version 0.4.1 deleted >}}
      Trello = false
      Diaspora = true # {{< version 0.3.1 >}}
      Mix = false
      Telegram = true # {{< version 0.3.1 >}}
      Bluesky = false # {{< version 0.4.1 >}}
      Email = false # {{< version 0.4.1 >}}
      Douban = false # {{< version 0.4.1 >}}
      Qzone = false # {{< version 0.4.1 >}}
      Pinboard = false # {{< version 0.4.1 >}}
      WordPress = false # {{< version 0.4.1 >}}
    # {{< version 0.2.0 changed >}} Comment config
    [params.page.comment]
      enable = false
      # {{< version 0.4.3 >}} the comment system of the pages, see "One comment system per page" below
      # one of "disqus", "gitalk", "valine", "facebook", "telegram", "commento", "utterances",
      # "giscus", "waline", "twikoo", "mastodon", "comentario" and "remark42"; no comments are shown when empty
      # (until 0.5.0, the first comment system with the deprecated enable on is shown)
      type = ""
      # {{< link "https://disqus.com/" Disqus >}} comment config
      [params.page.comment.disqus]
        # Disqus shortname to use Disqus in posts
        shortname = ""
      # {{< link "https://github.com/gitalk/gitalk" Gitalk >}} comment config
      # clientSecret is published in any page with Gitalk enabled, see "Notes about comment systems" below
      [params.page.comment.gitalk]
        owner = ""
        repo = ""
        clientId = ""
        clientSecret = ""
      # {{< link "https://github.com/xCss/Valine" Valine >}} comment config
      # GPL-2.0-only, stores comments in LeanCloud, see "Notes about comment systems" below
      [params.page.comment.valine]
        appId = ""
        appKey = ""
        placeholder = ""
        avatar = "mp"
        meta= ""
        pageSize = 10
        # automatically adapt the current theme i18n configuration when empty
        lang = ""
        visitor = true
        recordIP = true
        highlight = true
        enableQQ = false
        serverURLs = ""
        # {{< version 0.2.6 >}} emoji data file name, default is "google.yml"
        # ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
        # located in the "assets/lib/valine/emoji/" directory of the theme
        # you can store your own data files in the same path under your project:
        # "assets/lib/valine/emoji/"
        emoji = ""
      # {{< link "https://developers.facebook.com/docs/plugins/comments" "Facebook comment" >}} config
      [params.page.comment.facebook]
        width = "100%"
        numPosts = 10
        appId = ""
        # automatically adapt the current theme i18n configuration when empty
        languageCode = ""
      # {{< version 0.2.0 >}} {{< link "https://comments.app/" "Telegram comments" >}} config
      [params.page.comment.telegram]
        siteID = ""
        limit = 5
        height = ""
        color = ""
        colorful = true
        dislikes = false
        outlined = false
      # {{< version 0.2.0 >}} {{< link "https://gitlab.com/commento/commento" "Commento" >}} comment config
      # the hosted Commento script no longer serves Commento, see "Notes about comment systems" below
      [params.page.comment.commento]
      # {{< version 0.2.5 >}} {{< link "https://utteranc.es/" "utterances" >}} comment config
      [params.page.comment.utterances]
        # owner/repo
        repo = ""
        issueTerm = "pathname"
        label = ""
        lightTheme = "github-light"
        darkTheme = "github-dark"
      # giscus comment config (https://giscus.app/)
      [params.page.comment.giscus]
        # You can refer to the official documentation of giscus to use the following configuration.
        repo = ""
        repoId = ""
        category = "Announcements"
        categoryId = ""
        # automatically adapt the current theme i18n configuration when empty
        lang = ""
        mapping = "pathname"
        reactionsEnabled = "1"
        emitMetadata = "0"
        inputPosition = "bottom"
        lazyLoading = false
        lightTheme = "light"
        darkTheme = "dark"
      # {{< version 0.3.1 >}} {{< link "https://waline.js.org/" "Waline" >}} comment config
      # {{< version 0.4.0 changed >}} the bundled client is Waline v3, which requires a Waline server v1.27.1 or later
      [params.page.comment.waline]
        serverURL = ""
        # automatically adapt the current theme i18n configuration when empty
        lang = ""
        # emoji presets, the Waline default is used when empty
        emoji = []
        # {{< version 0.4.3 >}} show the page views of a post in its post meta, counted by the Waline server
        # page views are looked up by the decoded path of the page, as Valine stored them, so a Waline server
        # that keeps the Counter table of Valine (in LeanCloud, or migrated with the comments) continues its counts
        # where the stored URLs match these paths; a page visited at ".../index.html" is counted under that path,
        # where Valine dropped "index.html"
        pageview = false
        # {{< version 0.4.3 >}} show the comment count of a post in its post meta
        comment = false
      # {{< version 0.4.3 >}} {{< link "https://twikoo.js.org/" "Twikoo" >}} comment config, see "Twikoo comments" below
      [params.page.comment.twikoo]
        # URL of the Twikoo server, or the ID of the Tencent CloudBase environment
        envId = ""
        # region of the Tencent CloudBase environment, such as "ap-guangzhou", the Twikoo default is used when empty
        region = ""
        # automatically adapt the current theme i18n configuration when empty
        lang = ""
      # {{< version 0.4.2 >}} Mastodon (Fediverse) comment config, see "Mastodon comments" below
      [params.page.comment.mastodon]
        # URL of the post whose replies are the comments, set it in the front matter of each page
        url = ""
      # {{< version 0.4.3 >}} {{< link "https://comentario.app/" "Comentario" >}} comment config, see "Comentario comments" below
      [params.page.comment.comentario]
        # URL of your Comentario server, which serves "/comentario.js"
        url = ""
        # the language of the page when empty
        lang = ""
        # deepest level of nested replies, 1 turns nesting off, the Comentario default (10) when 0
        maxLevel = 0
        # update the comments as they are posted
        liveUpdate = true
        # use the fonts of the theme instead of the Comentario font
        noFonts = true
        # URL of a stylesheet that overrides the Comentario styles, or "false" to load no Comentario styles
        cssOverride = ""
      # {{< version 0.4.3 >}} {{< link "https://remark42.com/" "Remark42" >}} comment config, see "Remark42 comments" below
      [params.page.comment.remark42]
        # URL of your Remark42 server (its REMARK_URL), which serves "/web/embed.mjs"
        host = ""
        # site ID, the SITE of the server, "remark" (the Remark42 default) when empty
        siteId = ""
        # the language of the page when empty
        locale = ""
        # number of top-level comments shown at first, the Remark42 default when 0
        maxShownComments = 0
        # let readers subscribe to the replies by email
        showEmailSubscription = true
        # let readers subscribe to the comments by RSS
        showRssSubscription = true
        # hide the formatting toolbar and the preview button
        simpleView = false
        # hide the footer with the links to Remark42
        noFooter = false
    # {{< version 0.2.7 >}} Third-party library config
    [params.page.library]
      [params.page.library.css]
        # someCSS = "some.css"
        # located in "assets/"
        # Or
        # someCSS = "https://cdn.example.com/some.css"
      [params.page.library.js]
        # someJavascript = "some.js"
        # located in "assets/"
        # Or
        # someJavascript = "https://cdn.example.com/some.js"
    # {{< version 0.2.10 changed >}} Page SEO config
    [params.page.seo]
      # image URL
      images = []
      # Publisher info
      [params.page.seo.publisher]
        name = ""
        logoUrl = ""

  # {{< version 0.2.5 >}} TypeIt config
  [params.typeit]
    # typing speed between each step (measured in milliseconds)
    speed = 100
    # blinking speed of the cursor (measured in milliseconds)
    cursorSpeed = 1000
    # character used for the cursor (HTML format is supported)
    cursorChar = "|"
    # cursor duration after typing finishing (measured in milliseconds, "-1" means unlimited)
    duration = -1

  # Site verification code config for Google/Bing/Yandex/Pinterest/Baidu
  [params.verification]
    google = ""
    bing = ""
    yandex = ""
    pinterest = ""
    baidu = ""

  # {{< version 0.4.0 >}} Security config
  [params.security]
    # Content-Security-Policy meta tag, for when HTTP headers cannot be set
    # https://content-security-policy.com/examples/meta/
    contentSecurityPolicy = ""
    # {{< version 0.4.2 >}} referrer policy of the <meta name="referrer"> tag
    # set "no-referrer" to send no Referer header at all
    referrerPolicy = "strict-origin-when-cross-origin"
    # {{< version 0.4.2 >}} Mermaid securityLevel ["strict", "loose"], used when params.page.mermaid.renderer is "mermaid"
    # "loose" allows click events and HTML labels in diagrams
    mermaidSecurityLevel = "strict"

  # {{< version 0.2.10 >}} Site SEO config
  [params.seo]
    # image URL
    image = ""
    # thumbnail URL
    thumbnailUrl = ""

  # {{< version 0.2.0 >}} Analytics config
  [params.analytics]
    # whether to show the GoatCounter page view counter in the post footer (only with goatCounter.code set), not set by default
    enable = false
    # Google Analytics
    [params.analytics.google]
      id = ""
      # {{< version 0.3.1 >}} whether to respect the browser’s “do not track” setting
      respectDoNotTrack = false
    # Fathom Analytics
    [params.analytics.fathom]
      id = ""
      # server url for your tracker if you're self hosting
      server = ""
    # Plausible Analytics
    [params.analytics.plausible]
      dataDomain = ""
    # Yandex Metrica
    [params.analytics.yandexMetrica]
      id = ""
    # {{< version 0.3.1 >}} GoatCounter Analytics
    [params.analytics.goatCounter]
      # the code of your site, as in https://<code>.goatcounter.com
      code = ""

  # {{< version 0.2.7 >}} Cookie consent config
  [params.cookieconsent]
    enable = false
    # text strings used for Cookie consent banner
    [params.cookieconsent.content]
      message = ""
      dismiss = ""
      link = ""

  # {{< version 0.4.3 changed >}} CDN config for third-party library files
  [params.cdn]
    # CDN data file name, default is "" (serve the library files bundled with the theme)
    # ["jsdelivr.yml", "jsdelivr.fastly.yml", "jsdelivr.cloudflare.yml", "unpkg.yml"]
    # located in the "assets/data/cdn/" directory of the theme
    # you can store your own data files in the same path under your project:
    # "assets/data/cdn/"
    data = ""

# Markup related config in Hugo
[markup]
  # {{< link "https://gohugo.io/content-management/syntax-highlighting" "Syntax Highlighting" >}}
  [markup.highlight]
    codeFences = true
    guessSyntax = true
    lineNos = true
    lineNumbersInTable = true
    # false is a necessary configuration
    # ({{< link "https://github.com/dillonzq/LoveIt/issues/158" >}})
    noClasses = false
  # Goldmark is from Hugo 0.60 the default library used for Markdown
  [markup.goldmark]
    [markup.goldmark.extensions]
      definitionList = true
      footnote = true
      linkify = true
      strikethrough = true
      table = true
      taskList = true
      typographer = true
    [markup.goldmark.renderer]
      # whether to use HTML tags directly in the document
      unsafe = true
  # Table Of Contents settings
  [markup.tableOfContents]
    startLevel = 2
    endLevel = 6

# Sitemap config
[sitemap]
  changefreq = "weekly"
  filename = "sitemap.xml"
  priority = 0.5

# {{< link "https://gohugo.io/content-management/urls#permalinks" "Permalinks config" >}}
[Permalinks]
  # posts = ":year/:month/:contentbasename"
  posts = ":contentbasename"

# {{< link "https://gohugo.io/configuration/privacy/" "Privacy config" >}}
[privacy]
  # {{< version 0.3.1 changed >}} privacy of the Google Analytics (can also be configured in params.analytics.google)
  [privacy.googleAnalytics]
    # ...
  [privacy.twitter]
    # ...
  [privacy.youtube]
    # ...

# {{< version 0.4.2 >}} Output format of llms.txt, see [Markdown Output and llms.txt](#llms-txt)
[outputFormats.llms]
  baseName = "llms"
  mediaType = "text/plain"
  isPlainText = true
  notAlternative = true

# Options to make hugo output files
[outputs]
  # {{< version 0.4.2 changed >}}
  home = ["HTML", "RSS", "JSON", "llms"]
  # "markdown" is the output format built into Hugo for the .md version of a page
  page = ["HTML", "markdown"]
  section = ["HTML", "RSS"]
  taxonomy = ["HTML", "RSS"]
```

{{< admonition >}}
Note that some of these parameters are explained in details in other sections of this documentation.
{{< /admonition >}}

{{< admonition note "Hugo environments" >}}
Default environments are `development` with `hugo serve` and `production` with `hugo`.

Due to limitations in the local `development` environment,
the **comment system**, **CDN** and **fingerprint** will not be enabled in the `development` environment.
{{< version 0.4.3 >}} Outside the `production` environment, every page also asks search engines not to index it (see [Search Engines and robots.txt](#robots)).

You could enable these features with `hugo serve -e production`.
{{< /admonition >}}

{{< admonition tip "One comment system per page" >}}
{{< version 0.4.3 changed >}}

A page shows one comment system: the one that `type` names, with the options in its own section.
The other sections can stay in the configuration; they are not used.
A page can choose another comment system with `comment.type` in its front matter,
and `comment: false` (or `enable: false` under `comment`) hides the comments of a page.
`comment: true` shows them on a page even where `enable = false` in the site configuration.

```toml
[params.page.comment]
  enable = true
  type = "giscus"
  [params.page.comment.giscus]
    repo = "owner/repo"
    # ...
```

Each comment system used to have an `enable` of its own, and several could be shown on a page.
That `enable` is [deprecated](#deprecated-options): until 0.5.0, a page without a `type`
shows the first comment system with `enable = true`, those in its front matter first,
in the order of the configuration above, and the build warns when more than one is on.
`enable: false` under a comment system in the front matter still hides that comment system on the page.
Remove it, and set `comment: false` if the page should have no comments, or `comment.type` to show another comment system.
{{< /admonition >}}

{{< admonition warning "Notes about comment systems" >}}
For a new site, [giscus](https://giscus.app/) is recommended.
It stores comments in GitHub Discussions and does not need any secret in your site.
The notes below were checked on November 26, 2026.

**Gitalk**: the theme bundles Gitalk 1.8.0, which logs visitors in with a GitHub OAuth App.
The `clientSecret` you configure is written into each page that renders Gitalk,
so anyone can read it in the page source.
When a visitor logs in, Gitalk 1.x also sends the login code and this secret to GitHub
through a CORS proxy run by a third party (`cors-anywhere.azm.workers.dev`),
and the theme has no option to change this proxy.
The [Gitalk repository](https://github.com/gitalk/gitalk) now marks the 1.x line as end-of-life.
If you keep Gitalk, use an OAuth App that is only used for these comments.

**Commento**: the theme loads the hosted Commento script from `https://cdn.commento.io/js/commento.js`
and has no option for a self-hosted Commento server.
Users [reported commento.io down](https://news.ycombinator.com/item?id=46196323) in December 2025,
and on November 26, 2026 a request for `https://commento.io/` or for the script URL above
was redirected to an unrelated third-party page (or answered with HTTP 404) instead of serving Commento.
Do not enable this option, because the browser would load a script from a domain
that no longer serves Commento.
The [open source code](https://gitlab.com/commento/commento) has had no commits since February 2021.
If you run your own Commento server, this option cannot be pointed at it.
[Comentario](https://comentario.app/), a maintained fork of Commento that can import Commento's comments,
is supported with `params.page.comment.comentario` (see "Comentario comments" below).

**Valine**: Valine is licensed under GPL-2.0-only
(its package declares the SPDX identifier `GPL-2.0`),
and when it is enabled the theme serves the bundled copy (`assets/lib/valine/Valine.min.js`),
or loads it from the CDN that `params.cdn.data` configures.
Valine has no server of its own: it stores comments in a [LeanCloud](https://docs.leancloud.cn/) app,
which is what `appId`, `appKey` and `serverURLs` refer to.
LeanCloud [stopped new sign-ups and new apps](https://docs.leancloud.cn/en/sdk/announcements/sunset-announcement/)
on January 12, 2026, and will shut down all public services on January 12, 2027.
After that, Valine cannot load or save comments, and LeanCloud says it will permanently destroy or anonymize the user data it retains.
Export your comments before that date and move to another comment system.
{{< /admonition >}}

{{< admonition tip "Twikoo comments" >}}
{{< version 0.4.3 >}}

[Twikoo](https://twikoo.js.org/) needs a Twikoo server, which you deploy yourself
(see the [Twikoo documentation](https://twikoo.js.org/backend.html)).
Set `envId` to the URL of the server, or to the ID of the environment for a server on Tencent CloudBase:

```toml
[params.page.comment]
  enable = true
  type = "twikoo"
  [params.page.comment.twikoo]
    envId = "https://twikoo.example.com"
```

The theme bundles the Twikoo client, which it serves from `assets/lib/twikoo/`, or loads from the CDN that `params.cdn.data` configures.
For an `envId` that is not an `http://` or `https://` URL, it loads the larger build with the Tencent CloudBase SDK.
The client is shown in the language of the page when Twikoo has a translation for it
(English, Simplified and Traditional Chinese, Japanese, Korean, Vietnamese or Indonesian), and in English otherwise.
Set `lang` to choose another translation, such as `zh-HK` or `uz-UZ`.
A client served from the site imports the translations other than English and Simplified Chinese
from `lib/twikoo/locales/`, which the theme deploys with it.
{{< /admonition >}}

{{< admonition tip "Mastodon comments" >}}
{{< version 0.4.2 >}}

With `type = "mastodon"`, the comments of a page are the public replies to a post
on [Mastodon](https://joinmastodon.org/) or another Fediverse server with the Mastodon API.
Publish a post about the page, then set its URL in the front matter of the page:

```yaml
comment:
  enable: true
  type: mastodon
  mastodon:
    url: https://mastodon.social/@user/113456789012345678
```

Visitors comment by replying to that post from their own Fediverse account; the page has no comment form.
When the comments come into view, the browser of the visitor reads the post and its replies
from the server in the URL (`/api/v1/statuses/:id` and `/api/v1/statuses/:id/context`),
so that server sees the visitor's IP address.
Only the public and unlisted replies that this server knows of are shown,
and a server that requires a login for its API cannot be used.
The replies are sanitized with [DOMPurify](https://github.com/cure53/DOMPurify),
which the theme serves from `assets/lib/dompurify/`, or loads from the CDN that `params.cdn.data` configures.
With `params.fingerprint` set, a CDN URL of the bundled version (`dompurify@<version>/dist/purify.min.js`, as in the theme's CDN data files) is checked against the bundled file with SRI.
{{< /admonition >}}

{{< admonition tip "Comentario comments" >}}
{{< version 0.4.3 >}}

[Comentario](https://comentario.app/) is an open source comment server that you run yourself.
It can import comments from Commento, Disqus and WordPress.
Register the domain of your site in the Comentario administration UI, then set the URL of your server:

```toml
[params.page.comment]
  enable = true
  type = "comentario"
  [params.page.comment.comentario]
    url = "https://comments.example.com"
```

The theme loads `comentario.js` from that URL and shows the comments in a `<comentario-comments>` element,
so the browser of each visitor connects to your Comentario server.
Comentario keeps the comments of a page by the path of its URL, so each translation of a page has its own comments.
The `theme` attribute of the element follows the theme of the site.
Comentario 3.18.0 or later repaints the comments when the theme switches; an older server shows the new theme after a reload.
With `lang` empty, Comentario uses the language of the page and falls back to English if it does not support that language.
A URL that is not the http(s) URL of a server (with no user, query or fragment) prints a build warning and no comments are shown.
{{< /admonition >}}

{{< admonition tip "Remark42 comments" >}}
{{< version 0.4.3 >}}

[Remark42](https://remark42.com/) is an open source comment server that you run yourself (version 1.17.0 or later).
It can import comments from Disqus, WordPress and Commento.
Set the URL of your server (its `REMARK_URL`), and its `SITE` if that is not the default `remark`.
If the server sets `ALLOWED_HOSTS`, it must include the domain of your site.

```toml
[params.page.comment]
  enable = true
  type = "remark42"
  [params.page.comment.remark42]
    host = "https://remark42.example.com"
    siteId = "remark"
```

The theme loads `web/embed.mjs` from that URL, which shows the comments in an iframe,
so the browser of each visitor connects to your Remark42 server.
Remark42 serves `web/embed.mjs` since 1.17.0; an older server, or a proxy or CDN that only serves `web/embed.js`, shows no comments.
Remark42 keeps the comments of a page by its permalink, so each translation of a page has its own comments.
The comments follow the theme of the site, also when it switches.
With `locale` empty, Remark42 uses the language of the page, and English if it does not support that language.
A URL that is not the http(s) URL of a server (with no user, query or fragment) prints a build warning and no comments are shown.
{{< /admonition >}}

{{< admonition tip "Tips about CDN Configuration" >}}
{{< version 0.4.3 changed >}}

```toml
[params.cdn]
  # CDN data file name, default is "" (serve the library files bundled with the theme)
  # ["jsdelivr.yml", "jsdelivr.fastly.yml", "jsdelivr.cloudflare.yml", "unpkg.yml"]
  data = ""
```

By default, the theme serves the third-party library files bundled with it from your site, so pages load no library from a CDN.
Set `data = "jsdelivr.yml"` (or another CDN data file) to load them from a CDN instead.
The CDN is used only in the `production` environment; other environments always serve the bundled files.
The default CDN data files are located in the `assets/data/cdn/` directory of the theme.
You can store your own data file in the same path under your project: `assets/data/cdn/`.
If `data` names a file that does not exist, the build prints a warning and the bundled local files are used.
{{< /admonition >}}

{{< admonition tip "Tips about social Configuration" >}}
{{< version 0.2.0 >}}

You can directly set your ID to get a default social link and its icon:

```toml
[params.social]
  Mastodon = "@xxxx"
```

The social link generated is `https://mastodon.technology/@xxxx`.

Or You can set more options through a dict:

```toml
[params.social]
  [params.social.Mastodon]
    # weight when arranging icons (the greater the weight, the later the icon is positioned)
    weight = 0
    # your social ID
    id = "@xxxx"
    # prefix of your social link
    prefix = "https://mastodon.social/"
    # content hovering on the icon
    title = "Mastodon"
```

The default data of all supported social links is located in `assets/data/social.yml` of the theme,
which is you can refer to.
{{< /admonition >}}

![Complete configuration preview](complete-configuration-preview.png "Complete configuration preview")

### 3.2 Favicons, Browserconfig, Manifest

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)

into `/static`. They’re easily created via [https://realfavicongenerator.net/](https://realfavicongenerator.net/).

The theme links `site.webmanifest` and `safari-pinned-tab.svg` from the site root, so customize `site.webmanifest` to set the theme color and background color of the installed web app.
The `theme-color` and `msapplication-TileColor` meta tags and the Safari mask icon color come from `themeColor`, `tileColor` and `iconColor` in `[params.app]`.
The theme does not reference `browserconfig.xml`, so it is not needed.

### 3.3 Style Customization {#style-customization}

{{< version 0.2.8 changed >}}

{{< admonition note "Customized styles need Dart Sass" >}}
{{< version 0.4.3 changed >}} The theme ships its :(fab fa-sass): SCSS compiled to :(fab fa-css3): CSS.
When your site changes the theme styles, Hugo compiles them again with [**Dart Sass**](https://gohugo.io/functions/css/sass/#dart-sass), which you then need to install.

Your site changes the theme styles when `assets/css/_override.scss` or `assets/css/_custom.scss` has more than comments
(a `/*! ... */` comment counts, as Sass keeps it in the CSS),
or when it has other `.scss` or `.sass` files under `assets/css`, or files under `assets/lib/modern-normalize`, even ones that the styles do not import.
If Dart Sass is missing, the build fails with an error that lists these files.
{{< /admonition >}}

**LoveIt** theme has been built to be as configurable as possible by defining custom `.scss` style files.

The directory including the custom `.scss` style files is `assets/css` relative to **your project root directory**.

In `assets/css/_override.scss`, you can override the variables in `assets/css/_variables.scss` of the theme to customize the style.

Here is a example:

```scss
@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,700&display=swap&subset=latin-ext');
$code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospace;
```

In `assets/css/_custom.scss`, you can add some css style code to customize the style.

### 3.4 Markdown Output and llms.txt {#llms-txt}

{{< version 0.4.2 >}}

With the `markdown` output format, which is built into Hugo, each page is also published as `index.md` next to its `index.html`:

```toml
[outputs]
  page = ["HTML", "markdown"]
```

Every page that has this output links its Markdown version in the `<head>` with `<link rel="alternate" type="text/markdown">`, so tools and LLM crawlers find it without parsing the page.
`linkToMarkdown` in `[params.page]` also shows a link to it in the post footer.

The theme also has a default [llms.txt](https://llmstxt.org/) template, `layouts/home.llms.txt`.
To publish `/llms.txt`, define the `llms` output format and add it to the outputs of `home` in your [site configuration](#site-configuration):

```toml
[outputFormats.llms]
  baseName = "llms"
  mediaType = "text/plain"
  isPlainText = true
  notAlternative = true

[outputs]
  home = ["HTML", "RSS", "JSON", "llms"]
  page = ["HTML", "markdown"]
```

`llms.txt` starts with the site title and `description` in `[params]`.
It lists the pages outside any section under a "Pages" heading in the language of the site, then the pages of each top-level section under a heading with the section title, nested sections included.
Each page links to its Markdown version when it has one, otherwise to its HTML page, with the `description` from its front matter.
Pages hidden from search (`hiddenFromSearch`) and pages that publish neither are left out.
A multilingual site has one `llms.txt` per language, in the root of each language, such as `/zh-cn/llms.txt`.
Each page links the `llms.txt` of its language with `<link rel="describedby">`.

To change the content, copy `layouts/home.llms.txt` of the theme to `layouts/home.llms.txt` in your project and edit it.

{{< admonition warning "Remove the old Markdown output settings" >}}
Site configurations based on the example of earlier versions make the `.md` files with these settings:

```toml
[mediaTypes]
  [mediaTypes."text/plain"]
    suffixes = ["md"]

[outputFormats.MarkDown]
  mediaType = "text/plain"
  isPlainText = true
  isHTML = false
```

Remove both before you add the `llms` output format, and use `markdown` in the outputs of `page`.
Otherwise `text/plain` files end in `.md`: Hugo looks for `home.llms.md` and publishes no `llms.txt`, and it no longer finds the Markdown template of the pages.
{{< /admonition >}}

### 3.5 Search Engines and robots.txt {#robots}

{{< version 0.4.3 >}}

Outside the `production` [environment](https://gohugo.io/methods/hugo/environment/), for example a staging site built with `hugo --environment staging`,
every page and alias redirect has `<meta name="robots" content="noindex, nofollow">`,
so that search engines that crawl a preview deployment keep it out of their results.
Deploy only `production` builds as the public website. Hugo builds in the `production` environment by default.

{{< admonition warning "Search engines must be able to crawl the pages" >}}
A search engine only sees the `noindex` meta tag of a page it may crawl.
The `robots.txt` of the theme lets crawlers crawl every page, also outside the `production` environment; a `Disallow` rule for a page could leave its URL in search results.
A preview that must stay private needs a password or another kind of authentication on the host: `noindex` only keeps public pages out of search results.
The meta tag does not cover files such as images and PDFs either; for public files that must stay out of search results, have the host send an `X-Robots-Tag: noindex` header.
{{< /admonition >}}

In the `production` environment, a page with `hiddenFromSearchEngines: true` in its front matter has `<meta name="robots" content="noindex">` and is left out of `sitemap.xml`, including the `hreflang` alternates of its translations.
Set `hiddenFromSearchEngines = true` in `[params.page]` to hide every page by default, then `hiddenFromSearchEngines: false` in the front matter of a page to show it again.
A page with `sitemap.disable: true` in its front matter has no entry of its own in `sitemap.xml`, but it can still appear as an alternate of its translations, as in Hugo.

With `enableRobotsTXT = true`, `robots.txt` allows all crawlers.
In the `production` environment it also links the sitemap at the `baseURL`, named after the `filename` of the [sitemap configuration](https://gohugo.io/configuration/sitemap/) (`sitemap.xml` by default).
Crawlers only read `robots.txt` at the root of a host: when the `baseURL` has a path, such as `https://example.org/project/`, put the rules and the `Sitemap` line in the `robots.txt` at the root of the host instead.
To add your own rules, or to drop the `Sitemap` line when you turn off the sitemap, copy `layouts/robots.txt` of the theme to `layouts/robots.txt` in your project and edit it.

## 4 Multilingual and i18n

**LoveIt** theme is fully compatible with Hugo multilingual mode, which provides in-browser language switching.

![Language Switch](language-switch.gif "Language Switch")

### 4.1 Compatibility {#language-compatibility}

| Language                       | Hugo Code | HTML `lang` Attribute |       Theme Docs        |
|:-------------------------------|:---------:|:---------------------:|:-----------------------:|
| English                        |   `en`    |         `en`          | :(far fa-check-square): |
| Simplified Chinese             |  `zh-cn`  |        `zh-CN`        | :(far fa-check-square): |
| Traditional Chinese            |  `zh-tw`  |        `zh-TW`        |    :(far fa-square):    |
| French                         |   `fr`    |         `fr`          |    :(far fa-square):    |
| Polish                         |   `pl`    |         `pl`          |    :(far fa-square):    |
| Portuguese (Brazil)            |  `pt-br`  |        `pt-BR`        |    :(far fa-square):    |
| Italian                        |   `it`    |         `it`          |    :(far fa-square):    |
| Spanish                        |   `es`    |         `es`          |    :(far fa-square):    |
| German                         |   `de`    |         `de`          |    :(far fa-square):    |
| Serbian                        |   `sr`    |         `sr`          |    :(far fa-square):    |
| Russian                        |   `ru`    |         `ru`          |    :(far fa-square):    |
| Romanian                       |   `ro`    |         `ro`          |    :(far fa-square):    |
| Vietnamese                     |   `vi`    |         `vi`          |    :(far fa-square):    |
| Arabic                         |   `ar`    |         `ar`          |    :(far fa-square):    |
| Catalan                        |   `ca`    |         `ca`          |    :(far fa-square):    |
| Thai                           |   `th`    |         `th`          |    :(far fa-square):    |
| Telugu                         |   `te`    |         `te`          |    :(far fa-square):    |
| Indonesian                     |   `id`    |         `id`          |    :(far fa-square):    |
| Turkish                        |   `tr`    |         `tr`          |    :(far fa-square):    |
| Korean                         |   `ko`    |         `ko`          |    :(far fa-square):    |
| Hindi                          |   `hi`    |         `hi`          |    :(far fa-square):    |
| Dutch                          |   `nl`    |         `nl`          |    :(far fa-square):    |
| Bengali                        |   `bn`    |         `bn`          |    :(far fa-square):    |
| Japanese {{< version 0.3.1 >}} |   `ja`    |         `ja`          |    :(far fa-square):    |
| Swedish {{< version 0.3.1 >}}  |   `sv`    |         `sv`          |    :(far fa-square):    |
| Ukrainian {{< version 0.3.0 >}} |   `uk`    |         `uk`          |    :(far fa-square):    |

### 4.2 Basic Configuration

After learning [how Hugo handle multilingual websites](https://gohugo.io/content-management/multilingual), define your languages in your [site configuration](#site-configuration).

For example with English, Chinese and French website:

```toml
# determines default content language ["en", "zh-cn", "fr", "pl", ...]
defaultContentLanguage = "en"

[languages]
  [languages.en]
    weight = 1
    title = "My New Hugo Site"
    locale = "en"
    label = "English"
    [[languages.en.menu.main]]
      weight = 1
      identifier = "posts"
      pre = ""
      post = ""
      name = "Posts"
      url = "/posts/"
      title = ""
    [[languages.en.menu.main]]
      weight = 2
      identifier = "tags"
      pre = ""
      post = ""
      name = "Tags"
      url = "/tags/"
      title = ""
    [[languages.en.menu.main]]
      weight = 3
      identifier = "categories"
      pre = ""
      post = ""
      name = "Categories"
      url = "/categories/"
      title = ""

  [languages.zh-cn]
    weight = 2
    title = "我的全新 Hugo 网站"
    locale = "zh-CN"
    label = "简体中文"
    hasCJKLanguage = true
    [[languages.zh-cn.menu.main]]
      weight = 1
      identifier = "posts"
      pre = ""
      post = ""
      name = "文章"
      url = "/posts/"
      title = ""
    [[languages.zh-cn.menu.main]]
      weight = 2
      identifier = "tags"
      pre = ""
      post = ""
      name = "标签"
      url = "/tags/"
      title = ""
    [[languages.zh-cn.menu.main]]
      weight = 3
      identifier = "categories"
      pre = ""
      post = ""
      name = "分类"
      url = "/categories/"
      title = ""

  [languages.fr]
    weight = 3
    title = "Mon nouveau site Hugo"
    locale = "fr"
    label = "Français"
    [[languages.fr.menu.main]]
      weight = 1
      identifier = "posts"
      pre = ""
      post = ""
      name = "Postes"
      url = "/posts/"
      title = ""
    [[languages.fr.menu.main]]
      weight = 2
      identifier = "tags"
      pre = ""
      post = ""
      name = "Balises"
      url = "/tags/"
      title = ""
    [[languages.fr.menu.main]]
      weight = 3
      identifier = "categories"
      name = "Catégories"
      pre = ""
      post = ""
      url = "/categories/"
      title = ""
```

Then, for each new page, append the language code to the file name.

Single file `my-page.md` is split in three files:

* in English: `my-page.en.md`
* in Chinese: `my-page.zh-cn.md`
* in French: `my-page.fr.md`

{{< admonition >}}
Be aware that only translated pages are displayed in menu. It’s not replaced with default language content.
{{< /admonition >}}

{{< admonition tip >}}
Use [Front Matter parameter](https://gohugo.io/content-management/multilingual#translate-your-content) to translate urls too.
{{< /admonition >}}

### 4.3 Overwrite Translation Strings

Translations strings are used for common default values used in the theme. Translations are available in [some languages](#language-compatibility), but you may use another language or want to override default values.

To override these values, create a new file in your local i18n folder `i18n/<languageCode>.toml` and inspire yourself from `i18n/en.toml` of the theme.

By the way, as these translations could be used by other people, please take the time to propose a translation by [:(fas fa-code-branch): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!

## 5 Search

{{< version 0.2.0 >}}

Based on [Fuse.js](https://fusejs.io/), [algolia](https://www.algolia.com/) or [Pagefind](https://pagefind.app/), searching is supported in **LoveIt** theme.
{{< version 0.4.3 changed >}} Lunr.js was removed; the [deprecated](#deprecated-options) `type = "lunr"` searches with Fuse.js until 0.5.0.

### 5.1 Output Configuration

In order to generate `index.json` for searching, add `JSON` output file type to the `home` of the `outputs` part in your [site configuration](#site-configuration).
`fuse` and `algolia` need this file; `pagefind` builds its own index and does not.
{{< version 0.4.3 changed >}} The file lists the pages only while `params.search.enable` is `true` and `type` is not `"pagefind"`; otherwise it is an empty array `[]`.

```toml
[outputs]
  home = ["HTML", "RSS", "JSON"]
```

### 5.2 Search Configuration

Based on `index.json` generated by Hugo, you could activate searching.

Here is the search configuration in your [site configuration](#site-configuration):

```toml
[params.search]
  enable = true
  # {{< version 0.4.3 changed >}} type of search engine ["fuse", "algolia", "pagefind"] ("lunr" is deprecated)
  type = "fuse"
  # max index length of the chunked content
  contentLength = 4000
  # placeholder of the search bar
  placeholder = ""
  # {{< version 0.2.1 >}} max number of results length
  maxResultLength = 10
  # {{< version 0.2.3 >}} snippet length of the result
  snippetLength = 30
  # {{< version 0.2.1 >}} HTML tag name of the highlight part in results
  highlightTag = "em"
  # {{< version 0.2.4 >}} whether to use the absolute URL based on the baseURL in search index
  absoluteURL = false
  [params.search.algolia]
    index = ""
    appID = ""
    searchKey = ""
  # {{< version 0.4.0 >}} {{< link "https://fusejs.io/api/options.html" "Fuse.js" >}} options
  [params.search.fuse]
    isCaseSensitive = false
    minMatchCharLength = 2
    findAllMatches = false
    location = 0
    threshold = 0.3
    distance = 100
    ignoreLocation = true # {{< version 0.4.3 changed >}} match anywhere in the content
  # {{< version 0.4.0 >}} {{< link "https://pagefind.app/" "Pagefind" >}} config
  [params.search.pagefind]
    # directory of the Pagefind index, relative to the baseURL
    basePath = "/_pagefind/"
```

{{< admonition note "How to choose search engine?" >}}
The following is a comparison of the search engines:

* `fuse` {{< version 0.4.0 >}} (default {{< version 0.4.3 >}}): fuzzy search in the browser from `index.json`, no service to synchronize and no language library,
  but the whole `index.json` is downloaded on the first query
* `algolia`: high performance and low bandwidth, but need to synchronize `index.json` and limit for `contentLength`
* `pagefind` {{< version 0.4.0 >}}: a static index split into small chunks, so low bandwidth even on large sites and no service to synchronize,
  but the index must be generated after every build

{{< version 0.2.3 >}} The content of the post is separated by `h2` and `h3` HTML tag to improve query performance and basically implement full-text search.
`contentLength` is used to limit the max index length of the part starting with `h2` and `h3` HTML tag.
{{< /admonition >}}

{{< admonition tip "Tips about algolia" >}}
You need to upload `index.json` files to algolia to activate searching.
You could upload the `index.json` files by browsers but a CLI tool may be better.
The official [Algolia CLI](https://github.com/algolia/algolia-cli) is a good choice.
To be compatible with Hugo multilingual mode,
you need to upload different `index.json` for each language to the different index of algolia, such as `zh-cn/index.json` or `fr/index.json`...
{{< /admonition >}}

{{< admonition tip "Tips about Pagefind" >}}
{{< version 0.4.0 >}}

Pagefind indexes the HTML files that Hugo has published, so generate the index after every build:

```bash
hugo
npx pagefind --site public --output-subdir _pagefind
```

Hugo does not remove the output of deleted or renamed pages from `public`, and Pagefind would index them again.
After deleting or renaming pages, delete `public` before you run `hugo`.
Also delete it after turning search off or switching to another engine: the old index stays in `public` and would be published. Keep files that are not generated by Hugo in `static`.
`npx` comes with [Node.js](https://nodejs.org/); without Node.js, use the [standalone Pagefind binary](https://pagefind.app/docs/installation/) with the same arguments.

`--output-subdir` must be the same directory as `basePath` in `[params.search.pagefind]`.
Pages with `hiddenFromSearch` and the pages of a language whose search is off or uses another engine are not indexed. On a single-host site, one run indexes all languages.
On a [multihost](https://gohugo.io/configuration/languages/#multihost) site, each language is built into its own directory, such as `public/en`.
Run the command once for the directory of each language that searches with Pagefind, for example `npx pagefind --site public/en --output-subdir _pagefind`, so that each host serves its own index.
Skip the directories of the other languages, and skip the command when no language searches with Pagefind: Pagefind fails when it finds no page to index.

`hugo server` does not generate the index. To preview the search, build the site and serve the output:

```bash
npx pagefind --site public --output-subdir _pagefind --serve
```

The preview serves `public` at the root. If your `baseURL` contains a subpath, build the preview with `hugo --baseURL /`.
On a multihost site, preview one language at a time, for example with `npx pagefind --site public/en --output-subdir _pagefind --serve`.
{{< /admonition >}}

## 6 Version Migration {#migration}

This section explains how to upgrade the theme and what to check when you upgrade to a new version.
If you skip versions, follow the guide of every version between yours and the new one.

### 6.1 Upgrade the Theme {#upgrade-the-theme}

Before you upgrade, read the guides below and the [changelog](https://github.com/dillonzq/LoveIt/blob/master/CHANGELOG.md).
Then switch the theme to the latest release, with the method you installed it with:

* **Hugo Module.** Get the latest release, then commit `go.mod` and `go.sum`:

  ```bash
  hugo mod get github.com/dillonzq/LoveIt@latest
  ```

* **Git submodule.** Make the submodule follow the `release` branch (a submodule added without `-b release` follows `master`),
  update it to the latest commit of that branch,
  then commit the new version in your site repository, so that your build service builds it:

  ```bash
  git submodule set-branch --branch release themes/LoveIt
  git submodule update --remote themes/LoveIt
  git add .gitmodules themes/LoveIt
  git commit -m "Upgrade LoveIt"
  ```

* **Git clone.** Fetch the `release` branch and switch to its latest commit (a clone made without `-b release` is on `master`):

  ```bash
  git -C themes/LoveIt fetch origin
  git -C themes/LoveIt checkout -B release origin/release
  ```

* **Release .zip file.** Download the **Source code (zip)** of the [latest release](https://github.com/dillonzq/LoveIt/releases/latest)
  and replace the `themes/LoveIt` directory with its extracted `LoveIt-x.y.z` directory, renamed to `LoveIt`.

To use a specific version, use its tag instead,
such as `hugo mod get github.com/dillonzq/LoveIt@v0.4.2` or `git -C themes/LoveIt checkout v0.4.2`.
For a submodule, then commit `themes/LoveIt`, so that your build service builds that version.
To return to the latest release, follow the steps above again.

### 6.2 Upgrade from 0.3.X to 0.4.X {#upgrade-from-0-3}

{{< version 0.4.0 >}}

Check the following when you upgrade from **LoveIt 0.3.X** to **0.4.X**.

#### 6.2.1 What You Must Do

* **Upgrade Hugo to 0.146.0 or later.** LoveIt 0.3.X supported Hugo 0.128.0 - 0.145.0.
* **Install [Dart Sass](https://gohugo.io/functions/css/sass/#dart-sass) if your site needs it.**
  The theme no longer compiles with LibSass, so the extended edition of Hugo alone is not enough to compile its styles.
  Since 0.4.3, Dart Sass is needed only for [customized styles](#style-customization) and the `style` shortcode;
  install it on your build service (Netlify, Vercel, GitHub Actions...) as well.
* **Check your custom styles.** `assets/css/_override.scss` and `assets/css/_custom.scss` work as before,
  but they are now compiled by Dart Sass, which may warn about or reject syntax that LibSass accepted.
* **Check your template overrides.** The theme templates now follow the [new template system](https://gohugo.io/templates/lookup-order/) of Hugo
  and live in `layouts/_partials`, `layouts/_shortcodes` and `layouts/_markup`.
  If your site overrides theme templates, compare them with the new ones.

#### 6.2.2 What Has Changed

* **Language configuration.** On Hugo 0.158.0 or later, use `locale` and `label` instead of the deprecated `languageCode` and `languageName`.
* **Polyfill.** `params.compatibility.polyfill` loads from `cdnjs.cloudflare.com` instead of `polyfill.io` in 0.4.X. LoveIt 0.4.2 removes the Polyfill service, see [Deprecated Options](#deprecated-options).
* **Music.** The default Meting API has been replaced. Set `api` in `[params.page.music]` to use your own.
* **Waline.** The bundled client is Waline v3, which requires a Waline server v1.27.1 or later.

#### 6.2.3 What Is New

* [Fuse.js and Pagefind](#5-search) search engines
* [Content-Security-Policy](#site-configuration) meta tag (`[params.security]`)
* Server-side rendering of mathematical formulas, Markdown table and blockquote alert render hooks
* Extra text below the subtitle of the home page profile (`extra` in `[params.home.profile]`)

### 6.3 Deprecated Options {#deprecated-options}

{{< version 0.4.2 >}}

When your site configuration uses a deprecated option, `hugo` prints a warning once per build like the one below.
The warning is printed until the version in the "Removed in" column.
Deprecated options are removed in the next minor version (0.x.0), which LoveIt releases only when it raises the minimum supported Hugo version.
Some options no longer have any effect; the table says what to do with each one.
The build does not fail unless you build with `--panicOnWarning`.
To keep such a build passing while you migrate, add the ID from the warning to `ignoreLogs`.

```plain
WARN  LoveIt: "params.compatibility.polyfill" is deprecated since v0.4.2 and will be removed in v0.5.0. ...
You can suppress this warning by adding the following to your site configuration:
ignoreLogs = ['loveit-deprecated-params-compatibility-polyfill']
```

An option counts as used when it is set to a value other than `false` or an empty string,
so the `false` defaults copied from the theme configuration do not warn.
A deprecated value, such as `params.search.type = "lunr"`, warns only when the option is set to that value.

| Option | Deprecated in | Removed in | What to do |
|:-------|:-------------:|:----------:|:-----------|
| `params.compatibility.polyfill` | 0.4.2 | 0.5.0 | Remove it. It has no effect: the theme no longer loads the Polyfill service, which the browsers it supports do not need. |
| `params.compatibility.objectFit` | 0.4.2 | 0.5.0 | Remove it. It has no effect: the theme no longer loads object-fit-images, because the browsers it supports handle `object-fit` natively. |
| `params.cdn.autocompleteJS` | 0.4.2 | 0.5.0 | Remove it. Search no longer uses autocomplete.js. |
| `params.page.comment.<name>.enable` (any comment system) | 0.4.3 | 0.5.0 | Set `params.page.comment.type = "<name>"` and remove it; in front matter, `comment.<name>.enable: true` becomes `comment.type: <name>`, and `comment.<name>.enable: false` is removed (with `comment: false` if the page should have no comments, or `comment.type` set to another comment system). A page shows one comment system. Until then, a page without a `type` shows the first comment system with `enable` on (see "One comment system per page"). The front matter key warns with the ID `loveit-deprecated-front-matter-comment-<name>-enable`. |
| `params.search.type = "lunr"` | 0.4.3 | 0.5.0 | Set it to `"fuse"`: Lunr.js was removed, so the option already searches with Fuse.js from the same `index.json`. Removing it also works where the inherited type is Fuse.js, the default; a language-level setting would otherwise fall back to the site-level `type`. Or choose `"algolia"` or `"pagefind"`. |

