HUGO

Google编程规范总结

April 17, 2022
工具
HUGO, blog

版本说明 # Google编程规范总结 日期 版本 修改内容 20211029 V0.1 创建 目的 # 使代码易于管理的方法之一是加强代码一致性. 让任何程序员都可以快速读懂你的代码这点非常重要. 项目主页: Google Style Guide Google 开源项目风格指南 - 中文版 代码规范 # 头文件 # 前置声明 # 尽可能地避免使用前置声明。使用 #include 包含需要的头文件即可 前置声明的类是不完全类型(incomplete type),我们只能定义指向该类型的指针或引用,或者声明(但不能定义)以不完全类型作为参数或者返回类型的函数。毕竟编译器不知道不完全类型的定义,我们不能创建其类的任何对象,也不能声明成类内部的数据成员。 If a class only appears in the header as a pointer or reference, then a forward declaration is sufficient ...

搭建HUGO博客

April 17, 2022
工具
HUGO, blog

搭建HUGO博客 # 安装hugo # 进入 release页面下载,选择下载 hugo_extended_0.97.0_Linux-64bit.deb带extended后缀的安装包 sudo dpkg -i hugo_extended_0.97.0_Linux-64bit.deb 创建hugo工程 # mkdir ~/Public/Book cd ~/Public/Book hugo new site ./ 下载主题 # git init git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book cp -R themes/hugo-book/exampleSite/content . 运行Web服务 # ubuntu:~/Public/Book$ hugo server --minify --theme hugo-book --bind="0.0.0.0" -p 8888 Start building sites … hugo v0.97.0-c07f3626e7c8160943591f4d209977efa02c3dca+extended linux/amd64 BuildDate=2022-04-14T08:45:07Z VendorInfo=gohugoio WARN 2022/04/16 01:47:16 Expand shortcode is deprecated. Use 'details' instead. WARN 2022/04/16 01:47:16 Page '/layout/variables' not found in 'posts/goisforlovers. ...