Configurations

August 14, 2022 · 1331 words · 3 min · hugo ladder Tutorial configurations

This article about how to configure this theme, and manage the content of the articles created.

Mini Configuration

Open the config.yml file in the root directory with an editor and change the configuration as follows:

baseURL: 'https://hugo-ladder.pages.dev' # set https://username.github.io
homepage: 'https://hugo-ladder.pages.dev' # set https://username.github.io
defaultContentLanguage: 'en' #default language
params:
  brand: HOME # set the brand of your site
  avatarURL: /images/avatar.png # avatar, replace your avatar in the /static/images/
  author: Hugo Ladder # name
  authorDescription: # description
  info:  this is a info # information of your blog site
  favicon: /images/avatar.png # blog site icon,replace your avatar in the /static/images/
  options:
    showDarkMode: true # is show dark mode button
    enableMultiLang: true # is show multi language button

Configurations

About Hugo Configurations

This theme supports:

Analytics

Google Analytics

Follow these steps.

Google Tag Manager

Follow these steps.

params: 
  analytics: 
    google: 
      SiteVerificationTag: gid

Umami Analytics

Follow these steps.

params: 
  analytics: 
    umami: 
      enable: true
      website_id: data-website-id
      url: https://umami-ochre-nu.vercel.app/hugo-ladder.js

Commenting Systems

Comments are displayed within post pages and guestbook.

Giscus

Follow these steps.

params:
  comments:
    giscus:
      enable: true
      repo: username/reponame
      repo_id: Rid
      category: Announcements
      category_id: DIC_id
      mapping: pathname
      position: top
      lang: en # pick a language from https://github.com/giscus/giscus/tree/main/locales

Utterances

Follow these steps

params:
  comments:
    utteranc:
      enable: false
      repo: username/reponame
      issueTerm: pathname

Theme Parameters

These are all the parameters used by hugo-coder theme.

NameTypeRequiredDescriptionDefaultExample
baseURLstringYesWebsite URLhttps://username.github.io
titlestringYesWebsite Name"Ladder"
themestringYestheme name, not change"hugo-theme-ladder""hugo-theme-ladder"
licensestringNoLicense"MIT""MIT"
licenselinkstringNoLicense URL‘“https://github.com/guangzhengli/hugo-theme-ladder/blob/master/LICENSE"'‘“https://github.com/guangzhengli/hugo-theme-ladder/blob/master/LICENSE"'
descriptionstringNoWebsite Description"'A fast, clean Hugo theme'"
defaultContentLanguagestringYesWebsite default language"en""en" or "zh"
googleAnalyticsstringNogoogle analytics"G-xxx""G-xxx"
enableRobotsTXTstringNoenable robots.txttruetrue
paginatenumberYesDefault paginate1010
params.brandstringYesbrand"HOME""LADDER"
params.avatarURLstringNoGravatar photo of the author"/images/avatar.png" replace the photo or change the path"/images/avatar.png"
params.authorstringNoHome page author name"Hugo Ladder""Hugo Ladder"
params.authorDescriptionstringNoHome page author description"A clean, fast hugo theme focused on Reading""A clean, fast hugo theme focused on Reading"
params.infostringNoHome page website info"Ladder is a clean, simple but beautiful theme with awesome features""Ladder is a clean, simple but beautiful theme with awesome features"
params.faviconstringNoicon photo of the website"/images/avatar.png""/images/avatar.png"
params.options.showDarkModeboolNoenable dark mode button in navtruetrue
params.options.enableImgZoomingboolNoenable zooming when click img within posttruetrue
params.options.enableMultiLangboolNoenable multi-language supporttruefalse
params.darkModeThemestringyesAdds theme for dark modedata-dark-modedata-dark-mode or icy-dark-mode
params.guestbook.titlestringNoguestbooke title"Guestbook""Guestbook"
params.guestbook.descriptionstringNoguestbooke description"Leave a comment below. It could be anything –- question, appreciation, information, or even humor.""Leave a comment below. It could be anything –- question, appreciation, information, or even humor."
taxonomies.seriesstringYesenable series"series""series"
ptaxonomies.tagsstringYesenable tags"tags""tags"

Social Icons Configuration

Social Icons are optional. To use them you will need to set at least all the following required parameters for each icon.

ConfigurationTypeRequiredDescriptionExample
namestringYesIcon name."Github"
prestringYesicon svg."find in https://feathericons.com/"
urlstringYesURL to redirect."https://github.com/guangzhengli/"

An example:

  social:
    - name: GitHub
      pre: >-
                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
      url: 'https://github.com/guangzhengli/hugo-theme-ladder'
    - name: Dashboard
      pre: >-
                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-box"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>
      url: 'https://umami-ochre-nu.vercel.app/share/R1lHz7QY/hugo-ladder-exampleSite'

Menu Items are optional. To use them you will need to set all the following required parameters for each icon.

ConfigurationTypeRequiredDescriptionExample
namestringYesMenu Item name."Blog"
weightintYesMenu Item order.1
urlstringYesURL to redirect."/blog"

An example:

menu:
  main:
    - name: Blog
      url: /blog
      weight: 1
    - name: Tags
      url: /tags
      weight: 2
    - name: Archive
      url: /archives
      weight: 3
    - name: Guestbook
      url: /guestbook
      weight: 4
    - name: Dashboard
      url: https://umami-ochre-nu.vercel.app/share/R1lHz7QY/hugo-ladder-exampleSite
      weight: 5

Complete Example

This is a complete configuration example with some recommended values.

baseURL: 'https://hugo-ladder.pages.dev'
title: LADDER
theme: hugo-theme-ladder
license: MIT
licenselink: 'https://github.com/guangzhengli/hugo-theme-ladder/blob/master/LICENSE'
description: 'A fast, clean Hugo theme'
homepage: 'https://hugo-ladder.pages.dev'
defaultContentLanguage: 'en'
googleAnalytics: G-4WXJ5TEK2S
paginate: 10
menu:
  main:
    - name: Blog
      url: /blog
      weight: 1
    - name: Tags
      url: /tags
      weight: 2
    - name: Archive
      url: /archives
      weight: 3
    - name: Guestbook
      url: /guestbook
      weight: 4
    - name: Dashboard
      url: https://umami-ochre-nu.vercel.app/share/R1lHz7QY/hugo-ladder-exampleSite
      weight: 5
params:
  brand: HOME
  avatarURL: /images/avatar.png
  author: Hugo Ladder
  authorDescription: A clean, fast hugo theme focused on Reading
  info: Ladder is a clean, simple but beautiful theme with awesome features
  favicon: /images/avatar.png
  options:
    showDarkMode: true
    enableImgZooming: true
    enableMultiLang: true
  darkModeTheme: data-dark-mode
  #darkModeTheme: icy-dark-mode
  comments:
    giscus:
      enable: true
      repo: guangzhengli/hugo-ladder-exampleSite
      repo_id: R_kgDOHyVOjg
      category: Announcements
      category_id: DIC_kwDOHyVOjs4CQsH7
      mapping: pathname
      position: top
      lang: en # pick a language from https://github.com/giscus/giscus/tree/main/locales
    utteranc:
      enable: false
      repo: guangzhengli/blog-comments
      issueTerm: pathname
  analytics:
    google:
      SiteVerificationTag: xxx
    umami:
      enable: true
      website_id: 2320eaa6-a90b-471c-b6ca-e79dadde8c4c
      url: https://umami-ochre-nu.vercel.app/hugo-ladder.js
  guestbook:
    title: Guestbook
    description: Leave a comment below. It could be anything –- question, appreciation, information, or even humor.
  social:
    - name: GitHub
      pre: >-
                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
      url: 'https://github.com/guangzhengli/hugo-theme-ladder'
    - name: Dashboard
      pre: >-
                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-box"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>
      url: 'https://umami-ochre-nu.vercel.app/share/R1lHz7QY/hugo-ladder-exampleSite'
languages:
  en:
    languageName: EN
  zh:
    languageName: 
    author: Ladder 主题
    authorDescription: 一个美观,快速并且专注于阅读的主题
    info: 帮助开发者构建一个免费并且漂亮的博客网站,记录自己的思考并且提高自己的影响力
    guestbook:
      title: 留言板
      description: 您的评论,会让该网站更精彩!
    menu:
      main:
        - name: 文章
          url: /blog
          weight: 1
        - name: 分类
          url: /tags
          weight: 2
        - name: 历史文章
          url: /archives
          weight: 3
        - name: 留言板
          url: /guestbook
          weight: 4
        - name: 网站统计
          url: https://umami-ochre-nu.vercel.app/share/R1lHz7QY/hugo-ladder-exampleSite
          weight: 5
taxonomies:
  series: series
  tag: tags

Content Management

If you create a new posts, it is recommended to fill the configuration which means:

title: 
date: {{ .Date }}
tags: []
series: []
featured: true
  • title post title
  • date published date
  • tags tags
  • series series, it will be show related post below the content.
  • featured it will be show in home page featured post, true or false