HUGO
Menu
GitHub 87548 stars Mastodon

Hugo 配置服务

Hugo 配置嵌入式模板。

Hugo 提供 嵌入式模板 以简化站点和内容创建。其中一些是可配置的。例如,嵌入式 Google Analytics 模板需要 Google 标签 ID。

这是默认配置:

services:
  disqus:
    shortname: ''
  googleAnalytics:
    id: ''
  rss:
    limit: -1
  x:
    disableInlineCSS: false
[services]
  [services.disqus]
    shortname = ''
  [services.googleAnalytics]
    id = ''
  [services.rss]
    limit = -1
  [services.x]
    disableInlineCSS = false
{
   "services": {
      "disqus": {
         "shortname": ""
      },
      "googleAnalytics": {
         "id": ""
      },
      "rss": {
         "limit": -1
      },
      "x": {
         "disableInlineCSS": false
      }
   }
}
disqus.shortname
(string) 与 Disqus 评论系统一起使用的 shortname。请参阅 详情。要从模板访问此值:
{{ .Site.Config.Services.Disqus.Shortname }}
googleAnalytics.id
(string) Google Analytics 4 属性的 Google 标签 ID。请参阅 详情。要从模板访问此值:
{{ .Site.Config.Services.GoogleAnalytics.ID }}
instagram.accessToken
(string) 请勿使用。已在 v0.123.0 中弃用。嵌入式 instagram 短代码不再使用此设置。
instagram.disableInlineCSS
(bool) 请勿使用。已在 v0.123.0 中弃用。嵌入式 instagram 短代码不再使用此设置。
rss.limit
(int) RSS 源中包含的最大项目数。设置为 -1 表示无限制。默认值是 -1。请参阅 详情。要从模板访问此值:
{{ .Site.Config.Services.RSS.Limit }}
twitter.disableInlineCSS
(bool) 请勿使用。已在 v0.141.0 中弃用。请改用 x 短代码。
x.disableInlineCSS
(bool) 是否禁用嵌入式 x 短代码渲染的内联 CSS。请参阅 详情。默认值是 false。要从模板访问此值:
{{ .Site.Config.Services.X.DisableInlineCSS }}

Last updated: January 1, 0001
Improve this page