在前面两篇文章中,我们分别为大家介绍了如何在博客园平台的文章添加目录,以及为文章代码添加高亮,在这篇文章中我们介绍下为文章中的代码添加行号显示,具体效果如下所示(效果图的源文章请参考这篇博客):
在博客园平台为代码添加行号显示

插入页脚代码

在设置-页脚HTML代码中插入如下代码:

<link href="https://cdn.bootcss.com/highlight.js/9.6.0/styles/atelier-lakeside-dark.min.css" rel="stylesheet"/>
<script src="//cdn.bootcss.com/highlight.js/9.11.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="//cdn.bootcss.com/highlightjs-line-numbers.js/1.1.0/highlightjs-line-numbers.min.js"></script>
<script>hljs.initLineNumbersOnLoad();</script>

版权声明

本文首发链接为:https://www.cnblogs.com/dechinphy/p/line-number.html

作者ID:DechinPhy

更多原著文章请参考:https://www.cnblogs.com/dechinphy/

参考链接

  1. https://www.cnblogs.com/sxgsxg/p/13529556.html

相关文章:

  • 2020-10-16
  • 2018-12-11
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2021-11-04
  • 2021-06-15
  • 2022-01-27
猜你喜欢
  • 2021-06-07
  • 2021-04-06
  • 2021-07-02
  • 2022-12-23
  • 2019-02-26
相关资源
相似解决方案