封面(Cover)

定制站点的封面页,如:首页、关于页。

这些页面通常作为独特的封面页:

  • content/_index.md —— 首页
  • content/about.md —— 关于页

根据模板优先级,封面页最终使用 layouts/_default/baseof.html 作为页面模板。这个模板只有 header 和 footer。

背景图 background

Docsy 提供 layouts/shortcodes/blocks/cover.html 简码来生成封面页背景图。

  1. 添加图片 “content/featured-background.jpg” (图片包含background即可)

  2. 调用简码

     1{{% blocks/cover title="Welcome to Docsy!" image_anchor="top" height="full" %}}
     2<a class="btn btn-lg btn-primary me-3 mb-4" href="{{% relref '/about' %}}">
     3Learn More <i class="fa-solid fa-circle-right ms-2"></i>
     4</a>
     5<a class="btn btn-lg btn-secondary me-3 mb-4" href="https://github.com/google/docsy">
     6Download <i class="fa-brands fa-github ms-2 "></i>
     7</a>
     8
     9A Hugo theme for creating great technical documentation sites
    10{.lead .mt-5}
    11
    12{{% blocks/link-down color="info" %}}
    13{{% /blocks/cover %}}
    

    参数:

    • title
    • subtitle
    • byline
    • color
    • height
    • image_anchor
    • logo_anchor
Last modified November 4, 2023: Correcting content dir (da1a055)