HUGO

hugo的介绍 hugo安装 基础支持 评论支持 本地资源 数学公式 hugo help 推荐主题 hugo的介绍 hugo是一个 不一般的 静态网站生成器 官方文档 中文文档 安全性: 基于go module文件,保证第三方插件的安全(checksum) 文件保护(跨项目目录文件,项目内软链接-只可读) GDPR 数据隐私保护(欧盟隐私条例),大厂埋点配置化,可以启用保护规则 (国内好像也有这种趋势) 特性: 静态页面; 安全迅速 构建时间短- 相比 hexo实在是太快了 分类,pretty url 开发模式热加载; 随时随地发布,无依赖(go特性) Toml Yaml Json配置文件支持 hugo安装 hugo的安装,下载源码 执行 go install –tags extended 源码地址 基础支持 支持mermaid 支持mathjax 评论 本地图片支持 评论支持 文档 本地资源 ![hugo](./hugo.png "img-size-100-200") 数学公式 修改主题配置文件 [params.math] enable = true # 每个md文件前加上tag math: enable: true hugo help 推荐主题 docuapi https://hub.fastgit.org/bep/docuapi...

July 1, 2021 · canbefree

HTML Template Syntax | HUGO

text/template[1] Example: temp := ` hello, {{.Name}} ` t, err := template.New("test").Parse(temp) helper.PaincErr(err) type Args struct { Name string } arg := Args{ Name: "????",} // var out *bufio.Writer = bufio.NewWriter(os.Stdout) // err = t.ExecuteTemplate(out, "test", arg) err = t.ExecuteTemplate(os.Stdout, "test", arg) helper.PaincErr(err) // out.Flush() Text and spaces trim 为了让代码更符合阅读 "{{23 -}} < {{- 45}}". // output: 23<45 " Actions 注释 {{/* comment */}} {{ 和 / 必须紧贴着, 如果包含空格或者换行会展示出来 {{- /* */ -}}...

November 9, 2022 · canbefree

Ginkgo

TDD BDD ginkgo 基础用法 HOOKS BeforeSuite 和 AfterSuite beforeeach JustBeforeEach Describe, Context It and Specs by 跳过代码 Focused Parallel Specs 避免污染测试 异步测试 Benchmark Tests TDD BDD 测试驱动开发 (TDD): 敏捷开发,测试先行; 行为驱动开发: 帮助开发人员design软件,换言之,BDD 展开来讲可以当作一个设计文档来阅读 (适合DDD领域驱动) ginkgo 一个BDD框架 基础用法 ginkgo bootstrap // 初始化套件 ginkgo generate demo //生成一个测试 HOOKS BeforeSuite 和 AfterSuite func TestV1(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "V1 Suite") } var _ = BeforeSuite(func() { // 可以用来初始化DB fmt.Println("hello,world!") }) var _ = AfterSuite(func() { }) Both BeforeSuite and AfterSuite can be run asynchronously by passing a function that takes a Done parameter....

September 1, 2021 · canbefree