From cf54c227b1ed210d1a861cf6ea225dac45ecad45 Mon Sep 17 00:00:00 2001 From: IChou Date: Mon, 3 Oct 2016 16:36:51 +0800 Subject: fix h2 to h1 in single page --- README.md | 19 +++++++++++++++---- exampleSite/config.toml | 8 ++++---- exampleSite/static/img/avatar.jpg | Bin 0 -> 87860 bytes layouts/_default/list.html | 2 +- layouts/_default/single.html | 6 +++--- layouts/index.html | 1 + layouts/page/single.html | 4 ++-- layouts/partials/analytics.html | 2 ++ layouts/partials/disqus.html | 4 ++-- 9 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 exampleSite/static/img/avatar.jpg diff --git a/README.md b/README.md index caec3d5..d3b2a68 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,27 @@ git clone https://github.com/IvanChou/hugo-theme-vec vec See the [official docs](http://gohugo.io/themes/installing) for more information. ## Configuration -You could add `params` into your site's `config.toml` file: + +You should config your site's `config.toml` file like: ``` +baseurl = "http://replace-this-with-your-hugo-site.com" +title = "Site.title" +theme = "vec" +languageCode = "en-us" +paginate = 15 + +# Enable comments by entering your Disqus shortname +disqusShortname = "Your Disqus shortname" + +# Enable analytics by entering your Google Analytics tracking ID +googleAnalytics = "Your Google Analytics tracking code" + [params] Keywords = "key, 关键字, キーワード" Description = "There are some words to describe your site" - Avater = "//chou.oss-cn-hangzhou.aliyuncs.com/yii.im/avatar.jpg" + Avater = "img/avatar.jpg" SelfIntro = "Just a worm, seek for true, live in shadow, no more..." GithubID = "Your Github ID" @@ -34,8 +47,6 @@ You could add `params` into your site's `config.toml` file: FacebookID = "Your Facebook ID" LinkedInID = "Your LinkedIn ID" GoogleplusID = "Your Googleplus ID" - AnalyticsID = "Your Google Analytics tracking code" - DisqusShortname = "Your Disqus shortname" ``` If you use `config.yaml`, plz reformat them to yaml. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9cb0ff0..35c4930 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -3,6 +3,8 @@ title = "yii.im" theme = "vec" languageCode = "en-us" paginate = 10 +disqusShortname = "yiiim" +googleAnalytics = "UA-57408564-1" [menu] # Shown in the side menu. @@ -22,13 +24,11 @@ paginate = 10 [params] Keywords = "key, 关键字, キーワード" Description = "There are some words to describe your site" - Avater = "//img.ichou.cn/yii.im/avatar.jpg" + Avater = "img/avatar.jpg" SelfIntro = "Just a worm, seek for true, live in shadow, no more..." GithubID = "Your Github ID" TwitterID = "Your Twitter ID" FacebookID = "Your Facebook ID" LinkedInID = "Your LinkedIn ID" - GoogleplusID = "Your Googleplus ID" - AnalyticsID = "UA-57408564-1" - DisqusShortname = "yiiim" \ No newline at end of file + GoogleplusID = "Your Googleplus ID" \ No newline at end of file diff --git a/exampleSite/static/img/avatar.jpg b/exampleSite/static/img/avatar.jpg new file mode 100644 index 0000000..02d1392 Binary files /dev/null and b/exampleSite/static/img/avatar.jpg differ diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9023fa9..52a7b11 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -30,7 +30,7 @@ {{ partial "footer.html" . }} - {{ with .Site.Params.AnalyticsID }}{{ partial "analytics.html" . }}{{ end }} + {{ partial "analytics.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ffa31c0..891a85c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -13,7 +13,7 @@ {{ if .Params.toc }}{{ .TableOfContents }}{{ end }}
-

{{ .Title }}

+

{{ .Title }}

{{ .Content }} @@ -29,7 +29,7 @@ {{ end }}
- {{ if .Params.comments }}{{ partial "disqus.html" . }}{{ end }} + {{ partial "disqus.html" . }} {{ partial "footer.html" . }} @@ -38,7 +38,7 @@ - {{ with .Site.Params.AnalyticsID }}{{ partial "analytics.html" . }}{{ end }} + {{ partial "analytics.html" . }} diff --git a/layouts/index.html b/layouts/index.html index 3ba405f..5b2ec46 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -39,6 +39,7 @@ {{ partial "footer.html" . }} + {{ partial "analytics.html" . }} \ No newline at end of file diff --git a/layouts/page/single.html b/layouts/page/single.html index f073d57..c19795e 100644 --- a/layouts/page/single.html +++ b/layouts/page/single.html @@ -11,7 +11,7 @@ {{ partial "header.html" . }}
-

{{ .Title }}

+

{{ .Title }}

{{ .Content }}
@@ -19,7 +19,7 @@
{{ partial "footer.html" . }} - {{ with .Site.Params.AnalyticsID }}{{ partial "analytics.html" . }}{{ end }} + {{ partial "analytics.html" . }} diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html index c2434f2..e856506 100644 --- a/layouts/partials/analytics.html +++ b/layouts/partials/analytics.html @@ -1,3 +1,4 @@ +{{ with .Site.GoogleAnalytics }} +{{ end }} diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html index a9dd645..db86ed7 100644 --- a/layouts/partials/disqus.html +++ b/layouts/partials/disqus.html @@ -1,4 +1,4 @@ -{{ if .Site.Params.DisqusShortname }} +{{ if and .Site.DisqusShortname .Params.comments }}