Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/IvanChou/hugo-theme-vec.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIChou <me@ichou.cn>2016-10-03 11:36:51 +0300
committerIChou <me@ichou.cn>2016-10-03 19:27:50 +0300
commitcf54c227b1ed210d1a861cf6ea225dac45ecad45 (patch)
treef1f8916927d30a9d260484fc38c90372a0dd4d15
parent8159564bb3635795cc9f15fe4e8320f45eeed97c (diff)
fix h2 to h1 in single page
-rw-r--r--README.md19
-rw-r--r--exampleSite/config.toml8
-rw-r--r--exampleSite/static/img/avatar.jpgbin0 -> 87860 bytes
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/_default/single.html6
-rw-r--r--layouts/index.html1
-rw-r--r--layouts/page/single.html4
-rw-r--r--layouts/partials/analytics.html2
-rw-r--r--layouts/partials/disqus.html4
9 files changed, 30 insertions, 16 deletions
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
--- /dev/null
+++ b/exampleSite/static/img/avatar.jpg
Binary files 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" . }}
</body>
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 }}
<section class="post">
- <h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+ <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<span class="post-date">{{ .Date.Format "Jan 2, 2006 " }}</span>
<div class="post-content">
{{ .Content }}
@@ -29,7 +29,7 @@
{{ end }}
</section>
- {{ if .Params.comments }}{{ partial "disqus.html" . }}{{ end }}
+ {{ partial "disqus.html" . }}
</div>
{{ partial "footer.html" . }}
@@ -38,7 +38,7 @@
<script>
hljs.initHighlightingOnLoad();
</script>
- {{ with .Site.Params.AnalyticsID }}{{ partial "analytics.html" . }}{{ end }}
+ {{ partial "analytics.html" . }}
</body>
</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 @@
</section>
{{ partial "footer.html" . }}
+ {{ partial "analytics.html" . }}
</body>
</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" . }}
<div class="content">
<section class="post">
- <h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+ <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<div class="post-content">
{{ .Content }}
</div>
@@ -19,7 +19,7 @@
</div>
{{ partial "footer.html" . }}
- {{ with .Site.Params.AnalyticsID }}{{ partial "analytics.html" . }}{{ end }}
+ {{ partial "analytics.html" . }}
</body>
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 }}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -8,3 +9,4 @@ ga('create', '{{.}}', 'auto');
ga('send', 'pageview');
</script>
+{{ 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 }}
<section id="disqus_thread" class='disqus'></section>
<script>
var disqus_config = function () {
@@ -7,7 +7,7 @@
};
(function() {
var d = document, s = d.createElement('script');
- s.src = '//{{ .Site.Params.DisqusShortname }}.disqus.com/embed.js';
+ s.src = '//{{ .Site.DisqusShortname }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();