hugo-theme-diaspora

基于WordPress主题diaspora移植的Hugo主题

感谢WordPress主题作者@Loeify

预览:demo

下载安装

1
2
cd <YOUR Bolg Root Dir 到你博客根目录>
git clone git@github.com:honjun/hugo-theme-diaspora.git themes/Diaspora

使用

直接把主题下的exampleSite里面的内容剪贴到根目录覆盖替换即可。

修改配置 只需修改改部分

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# 【改】 这里改你的博客网址
baseurl = "https://hojun2.github.io"
# 【不改】 语言设置中文
languageCode = "zh-CN"
# 【不改】 如果使用了中文/日文/韩文语言。请设置为true,才能使.Summary和.WordCount正确执行
hasCJKLanguage = true
# 【改】 网站标题
title = "素锦"
# 【不改】 主题名称
theme = "Diaspora"
# 【不改】 主题目录
themesDir = "./themes/"
# 【不改】 设置list分页页面的条目数,默认10
paginate = 10
# 【不改】 禁用把目录改小写
disablePathToLower = true
# 【不改】 设置自动摘要(summary)的字符数为50 只有文章description为空才会使用summary自动获取文章前50字符为摘要。
summaryLength = 50

# 【自定义】 设置list页面的图标显示 其中字数默认显示 true/false 显示/不显示
[params.iconshow]
# 显示分类
category = true
# 不显示系列(相关)
series = false
# 显示标签
tag = true

# 【不改】 设置分类 category tag series
[taxonomies]
category = "categories"
tag = "tags"
series = "series"
# 【不改】 生成链接配置
[permalinks]
post = "/:year/:month/:day/:slug"
# 【改】 个人参数 怎么改 略,这应该要会了。
[params]
# Tell me who you are
author = "hojun"
bio = "Blogger - Programmer - Gopher"
location = "Earth"
site_description = "hojun的hugo静态博客"
copyright = "Powered by [Hugo](//gohugo.io). Theme by [PPOffice](http://github.com/ppoffice)."
avatar = "css/images/avatar.png"
# Enter your email address to display your Gravatar icon in the profile. If not set the theme
# will fallback to the avatar.
gravatar = "you@example.com"
logo = "css/images/logo.png"
disable_mathjax = false # set to true to disable MathJax

# define which types of pages should be shown. By default the type with the most regular pages
mainSections = ["post"]

# Format dates with Go's time formatting
date_format = "January 2, 2006"

# Add custom assets with their paths relative to the static folder
custom_css = []
custom_js = []

# 【自定义】 导航栏菜单配置
[[params.menu]]
name = "About"
link = "/about/"
target = "_blank"
[[params.menu]]
name = "Links"
link = "/links/"
target = ""
[[params.menu]]
name = "Archives"
link = "/archives/"
target = ""
[[params.menu]]
name = "Categories"
link = "/categories/"
target = ""
[[params.menu]]
name = "Tags"
link = "/tags/"
target = ""


[social]
# TODO

使用about、links页面 archives页面请不要碰她!

about直接在content\about\_index.md修改md内容就行。

links直接在\content\links.md下面追加

1
2
3
- url: https://www.banxia.me
name: 半夏小栈
desc: 半夏小栈

这种形式的友链信息即可。

关于文章头

默认格式在\archetypes\default.md,内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
# 标题 不改
title: "{{ replace .Name "-" " " | title }}"
# 日期 不改
date: {{ .Date }}
# 分类 改
categories:
- 生活
# 系列(相关)文章 改
series: XXX小记
# 标签 改
tags:
- 标签一
- 标签二
# 文章音乐 默认为下值 改
mp3: http://isujin.com/wp-content/uploads/2016/01/街道的寂寞.mp3?_=1
# 文章封面图 默认为下值 改
cover: https://cdn.jsdelivr.net/gh/hojun2/hojun2.github.io/img/wallhaven-672007-2.jpg
# 文章关键字 加
keywords:
# 文章简介 加/不加 则默认文章前50字符
description:
---

请主题作者喝杯咖啡

paypal

paypal

左手领红包,右手打赏

微信支付

希望这篇文章能给你带来知识和乐趣,喜欢博主的文章可以加博主好友哦

有好的文章也可以向博主投稿哦