在前面两篇文章中,我们分别为大家介绍了如何在博客园平台的文章添加目录,以及为文章代码添加高亮,在这篇文章中我们介绍下为文章中的代码添加行号显示,具体效果如下所示(效果图的源文章请参考这篇博客):
在设置-页脚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://cloud.tencent.com/developer/article/1827378
作者ID:DechinPhy
更多原著文章请参考:https://www.cnblogs.com/dechinphy/
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有