Config folder

Hello,
Per the hugo documenation I set up a config folder the following way:

config
└── _default
    ├── hugo.yaml
    └── params.yaml

but that only applied the config for my hugo.yaml, but my params.yaml which contains the params config is not being applied. I use the LoveIt theme, any help would be greatly appreciated.

Thank you

Have you tried this configuration?

config
└── _default
    ├── config.yaml
    └── params.yaml

Despite the fact that Hugo had changed the name of the main of the config file (Configure Hugo | Hugo) you can try to rename your hugo.yaml to config.yaml.

By the way if you can share your code (on a Git repository) it will be easier to help you.

Hey thanks for your response, yes I just tried your suggestion:

config
└── _default
    ├── config.yaml
    └── params.yaml

but that did not work either, I welcome more suggestions. thanks again

Please post the content of the file.

the content of my params.yaml is listed below, but keep in mind that when I move that content into my hugo.yaml, it works so I assume the syntax is fine:

  # site default theme ["auto", "light", "dark"]
  defaultTheme: "auto"
  # public git repo URL only then enableGitInfo is true
  gitRepo: ""
  fingerprint: ""
  dateFormat: "2006-01-02"
  # website title for Open Graph and Twitter Cards
  title: "My site"
  # website description for RSS, SEO, Open Graph and Twitter Cards
  description: "This is me Michael"
  # website images for Open Graph and Twitter Cards
  images: []

  # Header config
  header:
    # desktop header mode ["fixed", "normal", "auto"]
    desktopMode: "fixed"
    # mobile header mode ["fixed", "normal", "auto"]
    mobileMode: "auto"
    # Header title config
    title:
      # URL of the LOGO
      logo: ""
      # title name
      name: Michael
      # 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: ""
      # whether to use typeit animation for title name
      typeit: false

  # Footer config
  # 页面底部信息配置
  footer:
    enable: true
    # Custom content (HTML format is supported)
    # 自定义内容 (支持 HTML 格式)
    custom: ""
    # whether to show Hugo and theme info
    # 是否显示 Hugo 和主题信息
    hugo: true
    # whether to show copyright info
    # 是否显示版权信息
    copyright: true
    # whether to show the author
    # 是否显示作者
    author: true
    # site creation time
    # 网站创立年份
    since: 2022
    # ICP info only in China (HTML format is supported)
    # ICP 备案信息,仅在中国使用 (支持 HTML 格式)
    icp: ""
    # license info (HTML format is supported)
    # 许可协议信息 (支持 HTML 格式)
    license: ""

  # Section (all posts) page config
  # Section (所有文章) 页面配置
  section:
    # special amount of posts in each section page
    # section 页面每页显示文章数量
    paginate: 20
    # date format (month and day)
    # 日期格式 (月和日)
    dateFormat: "01-02"
    # amount of RSS pages
    # RSS 文章数目
    rss: 10

  # List (category or tag) page config
  # List (目录或标签) 页面配置
  list:
    # special amount of posts in each list page
    # list 页面每页显示文章数量
    paginate: 20
    # date format (month and day)
    # 日期格式 (月和日)
    dateFormat: "01-02"
    # amount of RSS pages
    # RSS 文章数目
    rss: 10

# home page config
  home:
    rss: 10
    profile:
      enable: true
      gravatarEmail: ""
      avatarURL: "/images/pullup1.png"
      title: ""
      subtitle: "This is Michael's Blog"
      typeit: true
      social: true
      disclaimer: ""
    posts:
      enable: true
      paginate: 6
      defaultHiddenFromHomePage: false

  # social config
  social:
    GitHub: "https://github.com/MSeutin"
    Linkedin: "https://twitter.com/frenchmike1"
    Twitter: "xxxx"
    Instagram: "xxxx"
    Facebook: "xxxx"
    Telegram: "xxxx"
    Medium: ""
    Gitlab: ""
    Email: "frenchmike@gmail.com"
config/
└── _default/
    ├── hugo.yaml
    └── params.yaml

Works for me using your content above.

{{ warnf "%s" site.Params.header.desktopMode }} --> fixed

If you need further assistance you’ll need to share your repo.

ok thanks, here is my repo:

I kept the config structure above and params.yaml is not implemented when structured this way
Michael

The params.yaml that you pasted above does not match the file in your repository.

Remove the “params:” bit at the top of your file.

2 Likes

Thank you so much jmooring, that was a thorn in my foot and now it is gone.
Michael

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.