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

疑难点:

  1. 依赖

    1. 该项目依赖了贼多的外部库 可以使用

      https://www.golangtc.com/download/package 辅助
  2. mage 自动更新
    1. mage在构建时,会自动更新 dep 工具,然而我的网络,你懂得,连不上 github.com/golang/dep
    2. 更新了dep之后,会报告dep构建失败,需要更新 go 版本

我的目标

我希望使用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 应该就能解决问题。

待明日研究。

最新文章

  1. 移动端API接口优化的术和结果
  2. kibana 搜索提示挡住输入框
  3. Makecert.exe(证书创建工具)
  4. Animation在每一帧中的执行顺序测试
  5. 史上最详细版!java文件打包成exe,在未配置安装JDK和未配置的电脑上运行--转载
  6. smartctl工具应用(转载整理)
  7. ubuntu 服务版安装简易说明
  8. 打印文章 FZOJ 5190
  9. TGCA数据的标准化以及差异分析--转载
  10. 为虚机Linux系统设置静态IP,ping通外网并解决相关问题
  11. rediret 加/与不加/的区别
  12. ubuntu下同时安装anaconda2与anaconda3,并分别安装与之对应的软件
  13. pyton unittest
  14. 最全最详细:ubuntu16.04下linux内核编译以及设备驱动程序的编写(针对新手而写)
  15. arcgis api for js简要笔记
  16. Python——字符串(python programming)
  17. linux 杂
  18. CentOS7.2部署采集系统
  19. jsonP 后台写法 及 层级树型数据递归查询
  20. springmvc3 拦截器,过滤ajax请求,判断用户登录,拦截规则设置

热门文章

  1. Power BI 3-4月功能更新培训合集
  2. C#版的 Escape() 和 Unescape()
  3. python学习笔记-基础、语句、编码、迭代器
  4. Podfile
  5. spring注解注入:<context:component-scan>详解
  6. html5 知识点简单总结02
  7. Navicat 连接MySQL时出现1251错误的解决方案
  8. HDFS基本Shell命令
  9. 学习笔记CB010:递归神经网络、LSTM、自动抓取字幕
  10. Python基础:十一、流程控制(if语句、while循环)