1.两数之和
链式前向星
383.赎金信
400.第N位数字
1
2
3
4
5
6
7
  | 
# 建议使用绝对路径(根目录为content目录),而非相对路径,否则容易出错
ref绝对路径:
[链式前向星](/posts/%E9%93%BE%E5%BC%8F%E5%89%8D%E5%90%91%E6%98%9F/)
relref相对路径:
[链式前向星](/posts/%E9%93%BE%E5%BC%8F%E5%89%8D%E5%90%91%E6%98%9F/)
# 只有所引用的文件与当前文件在同一文件夹下时可以使用 相对路径的方式(只写文件名)
  | 
 
为了实现左侧有LeetCode的效果,对Hugo来说,配置十分简单,
在taxonomies中添加leetcode标签,这是为了根据leetcode文件夹生成
http://localhost:1313/leetcode/,里面是leetcode文件夹中的文章
Taxonomies are classifications of logical relationships between content.
而方框中[[menu.main],决定了leetcode标签是否显示在左侧侧边栏
https://gohugo.io/content-management/taxonomies/
Hugo代码增加显示行号功能
今天看Hugo文档的时候,发现hugo已经有显示行号的功能了
hugo的版本需要v0.60.0以上
实现的方式很简单,只要修改配置文件即可
修改配置文件
修改主配置文件config.toml,在配置文件中增加
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  | 
 pygmentsUseClasses = true
 [markup]
  [markup.highlight]
    codeFences = true
    guessSyntax = true
    hl_Lines = ""
    lineNoStart = 1
    lineNos = true
    lineNumbersInTable = false #true的话是line单独一行,这才是我想要的效果 2022-1-25才发现
    noClasses = true
 
    tabWidth = 4
  | 
 
添加阅读次数
在themes/hugo-theme-tokiwa/layouts/patrials/page-asids.html中添加
1
2
  | 
<!-- 不蒜子 21/12/4 ljl引入站长统计-->
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
  | 
 
以上是必须引用的脚本
下面在Built with Hugo and theme后面加入
1
2
3
  | 
<span id="busuanzi_container_page_pv">
  本文总阅读量<span id="busuanzi_value_page_pv"></span>次
</span>
  |