0

hugo 使用

 2 years ago
source link: https://zjj2wry.github.io/post/first/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

hugo 使用

2019-01-17 634 words 2 mins read

安装 hugo 见中文文档(http://www.gohugo.org/), 官网的例子是只提交渲染后的 html 到 github 的 repo,但是文章原始的内容也需要做版本控制,所以我使用 content 目录来存放文章的原始内容,把渲染后的 html 文件输出到 repo 的 root 目录。

然后把原始的内容和渲染后的 html 一起提交到远端的 xxx.github.io 上来管理。生成文章后会有一个配置信息,使用 yaml 格式管理配置信息,下面是我的配置信息。

BaseUrl: "https://zjj2wry.github.io/"
Title: "zhengjiajin's blog"
theme: "beg" # hugo 的主题,选择它的原因是比较简洁,但是提供了 categories 和 tags 的功能
disqusShortname: zhengjiajin # 评论系统,需要去 disqus 创建一个账号,不过需要翻墙

Params:
  Author: "zhengjiajin"
  Github: "zjj2wry"
  ShowRelatedPost: True
  # Disqus: "unresolved"

MetadataFormat: "yaml"

在博客的头部添加文章的 metadata 信息或者使用 hugo new tips/tips.md,然后内容使用 markdown 格式写就完事了。

---
title: "hugo 使用"
date: 2019-01-17T11:43:30+08:00
tags: [ "hugo" ]
categories: [ "others" ]
comments: true # 是否开启评论
---

另外 hugo 默认会自动截取文章前面的一段内容作为摘要信息,可以使用 <!--more--> 手动指定摘要的内容

写完了之后需要把写完的 blog 渲染成 html 文件,执行 hugo -d ., -d 选择输出目录的位置,把它输出到当前 repo 的 root 的目录,然后 push 到 github repo 即可。

hugo -d .

本地预览执行命令

hugo server

Author zhengjiajin

LastMod 2019-01-17

使用 kubernetes 运行 tensorflow 分布式训练时的常见问题

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK