Heading link example

Posted 胡争辉

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Heading link example相关的知识,希望对你有一定的参考价值。

Heading link example

文章目录

简介

本例为Hugo自定义Heading模板,仓库在

https://github.com/huzhenghui/Hugo-Bootstrap-Templates

效果参见

https://huzhenghui.github.io/Hugo-Bootstrap-Templates/posts/render/heading/example/

本文发表在

https://blog.csdn.net/hu_zhenghui/article/details/128727127

相关文件

./
├── content/
│   └── posts/
│       └── render/
│           └── heading/
│               └── example.md
└── layouts/
    └── render-heading-example/
        └── _markup/
            └── render-heading.html

内容

/content/posts/render/heading/example.md

本文件,位置在https://github.com/huzhenghui/Hugo-Bootstrap-Templates/blob/master/content/posts/render/heading/example.md

Since v0.3

https://github.com/huzhenghui/Hugo-Bootstrap-Templates/blob/v0.3/content/posts/render/heading/example.md

front matter中设置type属性

---
title: Heading link example
date: 2023-01-18
publishdate: 2023-01-18
type: render-heading-example
---

type属性值为render-heading-example,表示优先使用/layouts/render-heading-example/中的模板,因此渲染时,在渲染Markdown的标题时,将使用
/layouts/render-heading-example/_markup/render-heading.html

效果为

<h1 id="heading-link-example">
    Heading link example
    <a href="#heading-link-example"></a>
</h1>

模板

/layouts/render-heading-example/_markup/render-heading.html

自定义Heading链接模板,位置在https://github.com/huzhenghui/Hugo-Bootstrap-Templates/blob/master/layouts/render-heading-example/_markup/render-heading.html

Since v0.3

https://github.com/huzhenghui/Hugo-Bootstrap-Templates/blob/v0.3/layouts/render-heading-example/_markup/render-heading.html

<h .Level  id=" .Anchor | safeURL ">
     .Text | safeHTML 
    <a href="# .Anchor | safeURL "></a>
</h .Level >

以上是关于Heading link example的主要内容,如果未能解决你的问题,请参考以下文章

Heading link example

dpdk example之link_status_interrupt尝鲜

算法:翻转链表206. Reverse Linked List

算法: 翻转链表 206. Reverse Linked List

iOS Universal Link问题

Leetcode 234. Palindrome Linked List