搭建博客 ( freenom + github + netlify + hugo ( extended version ) )

1. 安装go、hugo ( extended version )

2. freenom申请域名

3. github账户登陆netlify

4. 选择主题,如Academic

打开Install Academic with Netlify,点击connect to github,键入博客仓库名,点击Domain Settings,添加域名图片描述html

5. 初始化主题

在博客根目录下 git submodule update --init --recursivegit

6. 配置Nameservers

打开freenom,依次点击Services-My Domains-Manage Domains-Management Tools-Nameservers,按如下填入:github

- dns1.p05.nsone.net
- dns2.p05.nsone.net
- dns3.p05.nsone.net
- dns4.p05.nsone.net
- dns5.p05.nsone.net

7. 建立第一篇博客

本地博客根目录下打开 cmd, 键入 hugo new post/FirstBlog.md , 在生成的 hugo_blog\academic-kickstart\content\post\FirstBlog.md 中编写blogweb

8. 修改根目录下 netlify.tomlHUGO_VERSION ( 不然netlify没法自动deploy )

9. 将项目上传至github,可以使用两种方式:

- 命令行
- GUI

10. 在netlify中查看deploy status

  • 若为published,则能够经过域名访问
  • 若为failed,则须要检查deploy log

ps:

  1. windows下推荐使用cmder替代cmd
  2. 可在readme中添加查看netlify ( 位置: settings/general#status-badges )的deploy stastus的代码

faq:

  1. 为何发布环境的blog数量少于生产环境的blog数量?

    这多是由于发布环境不会显示draft为true的blogwindows

ref:

  1. https://www.youtube.com/watch...
  2. https://sourcethemes.com/acad...
  3. https://github.com/gcushen/hu...
  4. https://gohugo.io/commands/hu...
  5. https://sourcethemes.com/acad...
  6. https://skyao.io/learning-hug... ( 主题好看, 可是没有跑成功, 之后再折腾 )

2019-08-23T10:35:17+08:00首发于https://stefango.tk/post/%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%8D%9A%E5%AE%A2/post


<img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org...; />
本做品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。ui

相关文章
相关标签/搜索