hugo小玩
2024-10-19 15:37:11
hugo小玩
1. 安装
- install from source
- by brew
- install pre-built-binary
2. 下载源码
$ go get github.com/magefile/mage
$ go get -d github.com/gohugoio/hugo
$ cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo
$ mage vendor
$ mage install
疑难点:
- 依赖
- 该项目依赖了贼多的外部库 可以使用
https://www.golangtc.com/download/package
辅助
- 该项目依赖了贼多的外部库 可以使用
- mage 自动更新
- mage在构建时,会自动更新 dep 工具,然而我的网络,你懂得,连不上
github.com/golang/dep
- 更新了dep之后,会报告dep构建失败,需要更新 go 版本
- mage在构建时,会自动更新 dep 工具,然而我的网络,你懂得,连不上
我的目标
我希望使用hugo来构建笔记,但我的笔记喜欢写 时序图 和 流程图
希望能在hugo上继续使用。
一番翻找,发现hugo源码里面markdown或者其它文本使用 github.com/gohugoio/hugo/tpl
子库完成。
主要关键函数
func (c ContentSpec) RenderBytes(ctx *RenderingContext) []byte {
switch ctx.PageFmt {
default:
return c.markdownRender(ctx)
case "markdown":
return c.markdownRender(ctx)
case "asciidoc":
return getAsciidocContent(ctx)
case "mmark":
return c.mmarkRender(ctx)
case "rst":
return getRstContent(ctx)
case "org":
return orgRender(ctx, c)
case "pandoc":
return getPandocContent(ctx)
}
}
实际,平常使用肯定是 markdown 格式,
hugo中解析 markdown 使用 blackfriday
库。
通过 blackfriday
渲染过后,应该会类似其它语法,
所以,理论上,应该是在 theme
中再加上几句 js
应该就能解决问题。
待明日研究。
最新文章
- 移动端API接口优化的术和结果
- kibana 搜索提示挡住输入框
- Makecert.exe(证书创建工具)
- Animation在每一帧中的执行顺序测试
- 史上最详细版!java文件打包成exe,在未配置安装JDK和未配置的电脑上运行--转载
- smartctl工具应用(转载整理)
- ubuntu 服务版安装简易说明
- 打印文章 FZOJ 5190
- TGCA数据的标准化以及差异分析--转载
- 为虚机Linux系统设置静态IP,ping通外网并解决相关问题
- rediret 加/与不加/的区别
- ubuntu下同时安装anaconda2与anaconda3,并分别安装与之对应的软件
- pyton unittest
- 最全最详细:ubuntu16.04下linux内核编译以及设备驱动程序的编写(针对新手而写)
- arcgis api for js简要笔记
- Python——字符串(python programming)
- linux 杂
- CentOS7.2部署采集系统
- jsonP 后台写法 及 层级树型数据递归查询
- springmvc3 拦截器,过滤ajax请求,判断用户登录,拦截规则设置
热门文章
- Power BI 3-4月功能更新培训合集
- C#版的 Escape() 和 Unescape()
- python学习笔记-基础、语句、编码、迭代器
- Podfile
- spring注解注入:<;context:component-scan>;详解
- html5 知识点简单总结02
- Navicat 连接MySQL时出现1251错误的解决方案
- HDFS基本Shell命令
- 学习笔记CB010:递归神经网络、LSTM、自动抓取字幕
- Python基础:十一、流程控制(if语句、while循环)