Skip to content

Commit

Permalink
update config file and layout (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
doowzs committed Jan 4, 2020
1 parent bf56504 commit 831f79d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 35 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ The theme doesn't require any advanced configuration. Use `config.toml.example`
To auto generate information of git commit, add following line to your `deploy.sh`

```bash
gsed -i "/localcommithash/c \\\tlocalcommithash = \"$(git rev-parse HEAD)\"" config.toml
gsed -i "/localcommitdate/c \\\tlocalcommitdate = \"$(git log --pretty=format:"%cd" $(git rev-parse HEAD) -1)\"" config.toml
gsed -i "/localcommitcomment/c \\\tlocalcommitcomment = \"$(git log --pretty=format:"%s" $(git rev-parse HEAD) -1)\"" config.toml
cd public
gsed -i "/binarycommitdate/c \\\tbinarycommitdate = \"$(git log --pretty=format:"%cd" $(git rev-parse HEAD) -1)\"" ../config.toml
cd ..
To be updated...
```

## Known issues
Expand Down
51 changes: 34 additions & 17 deletions config.toml.example
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
baseURL = "/"
theme = "ztyblog"
title = "Welcome"
description = ""
copyright = "CC BY-NC 4.0"


paginate = 10
rssLimit = 25
languageCode = "zh-CN"
hasCJKLanguage = true
pygmentsCodeFences = true
pygmentsCodefencesGuessSyntax = false
pygmentsStyle = "colorful"
enableRobotsTXT = true
enableGitInfo = true
Paginate = 10
assetDir = ["/assets", "/themes/ztyblog/assets"]


[author]
name = "name"
email = "email"


[params]
author = ""
description = ""
copyright = ""
dateformFull = "2006-01-02 15:04 CST"
updatelisturl = ""
mail = ""
iconfontURL = "//at.alicdn.com/t/font_1559566_z93lvlj24ja.css"
localcommithash = ""
localcommitdate = ""
localcommitcomment = ""
binarycommitdate = ""
[params.links]
homeImage = ""
updateList = ""
iconFont = "//at.alicdn.com/t/font_1559566_z93lvlj24ja.css"

[params.dateforms]
date = "2006-01-02"
short = "1月2日"
long = "2006-01-02 15:04"
full = "2006-01-02 15:04 CST"

[params.commit]
commitHash = ""
commitDate = ""
commitMessage = ""
binaryVersion = ""

[[params.social]]
identifier = "github"
name = "Github"
Expand All @@ -35,6 +50,7 @@ assetDir = ["/assets", "/themes/ztyblog/assets"]
name = "email"
icon = "icon-email"
url = ""

[params.pagination]
class = "pagination justify-content-center"
showFirst = true
Expand All @@ -46,35 +62,36 @@ assetDir = ["/assets", "/themes/ztyblog/assets"]
firstIndicator = '<i class="iconfont icon-back-arrow-"></i>'
lastIndicator = '<i class="iconfont icon-back-arrow-reverse"></i>'


[menus]
[[menu.main]]
[[menus.main]]
identifier = "blog"
name = "blog"
url = "/blog/"
pre = "icon-blog"
post = "博客"
weight = 1
[[menu.main]]
[[menus.main]]
identifier = "notes"
name = "notes"
url = "/notes/"
pre = "icon-Notes"
post = "笔记"
weight = 2
[[menu.main]]
[[menus.main]]
identifier = "about"
name = "about"
url = "/about/"
pre = "icon-aboutus"
post = "关于我"
weight = 3
[[menu.second]]
[[menus.second]]
identifier = "bangumi"
name = "bangumi"
url = "/bangumi/"
pre = "icon-bilibili-line"
post = "追番列表"
[[menu.second]]
[[menus.second]]
identifier = "friends"
name = "friends"
url = "/friends/"
Expand Down
4 changes: 2 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<main id="main" class="my-3">
<section class="section-half-rounded">
<div class="jumbotron section-inner left-0 rounded-right bg-gradient-blue overflow-hidden col-lg-9">
<img src="/images/boat.jpg" alt="Image" class="img-as-bg blend-mode--multiply">
<img src="{{ .Site.Params.links.homeImage }}" alt="Image" class="img-as-bg blend-mode--multiply">
</div>
<div class="container text-center text-lg-left py-5">
<div class="row">
Expand All @@ -14,7 +14,7 @@ <h2 class="h1 font-weight-bold mb-3">
<canvas id="welcome-canvas" class="welcome-canvas"></canvas>
</h2>
<p class="lead lh-180">
欢迎访问{{.Site.Author.name}}的博客
欢迎访问{{ .Site.Author.name }}的博客
</p>
<div class="mt-3">
<a href="/blog/" class="btn btn-success btn-icon shadow-sm hover-translate-y-n3 mt-3">
Expand Down
12 changes: 6 additions & 6 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-md-4 mb-3 mb-md-0">
<div class="copyright font-weight-bold text-center text-sm text-md-left">
<i class="iconfont icon-copyright ficon"></i>
{{ .Site.Params.Copyright -}}
{{ .Site.Copyright }}
</div>
</div>
<div class="col-md-8">
Expand All @@ -23,21 +23,21 @@
</a>
</li>
<li class="nav-item" data-toggle="tooltip" data-html="true" title data-original-title="<div class='text-left'>
Theme Commit {{ substr .Site.Params.Themecommithash 0 8 }}
Theme Commit {{ substr .Site.Params.commit.hash 0 8 }}
<br />
{{ .Site.Params.Themecommitcomment }}
{{ .Site.Params.commit.message }}
<hr class='my-2 tiptool-hr'/>
Hugo Static Site Generator {{ hugo.Version }}
<br/>
Commit {{ substr .Site.Params.Binarycommithash 0 8 }}
Commit {{ substr .Site.Params.commit.version 0 8 }}
<br/>
Published at
<br/>
{{ .Site.Params.Binarycommitdate }}
{{ .Site.Params.commit.date }}
</div>">
<a class="nav-link" href="https://github.com/zhengzangw/hugo-site/" target="_blank">
<i class="iconfont icon-git-commit-line"></i>
{{ substr .Site.Params.Contentcommithash 0 8 }}
{{ substr .Site.Params.commit.hash 0 8 }}
</a>
</li>
<!--
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header id="header-main" class="header">
<nav class="navbar navbar-horizontal navbar-expand-lg shadow-sm navbar-light bg-white">
<div class="container-fluid">
<a class="navbar-brand" href="/">{{- .Site.Author.name -}}</a>
<a class="navbar-brand" href="/">{{ .Site.Title }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-primary"
aria-controls="navbar-primary" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
Expand Down Expand Up @@ -29,7 +29,7 @@
<span class="btn-inner--hidden">联系方式</span>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
{{ range .Site.Params.social }}
{{ range .Site.Params.Social }}
<a class="dropdown-item btn btn-sm btn-icon" href="{{ .url }}" target="_blank" rel="noopener me"
title="{{ .name | humanize }}">
<span class="btn-inner--icon mr-2"><i class="iconfont {{ .icon }}"></i></span>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/single-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ <h1>{{ .Title }}</h1>
{{ if not (eq .RelPermalink "/about/") }}
<p>
<i class="iconfont icon-NewFile mr-2"></i>
{{ dateFormat .Site.Params.dateformFull .Date.Local }}
{{ dateFormat .Site.Params.dateforms.full .Date.Local }}
</p>
{{ end }}
<p>
<i class="iconfont icon-modify mr-2"></i>
{{ dateFormat .Site.Params.dateformFull .Lastmod.Local }}
{{ dateFormat .Site.Params.dateforms.full .Lastmod.Local }}
</p>
</footer>
<a href="../" class="tongue tongue-bottom d-print-none">
Expand Down

0 comments on commit 831f79d

Please sign in to comment.