diff options
author | jesselau76 <jesselau76@gmail.com> | 2018-11-25 04:29:12 +0300 |
---|---|---|
committer | jesselau76 <jesselau76@gmail.com> | 2018-11-25 04:29:12 +0300 |
commit | a8269fe77eeb2f156529fac620dfc2317a857dff (patch) | |
tree | 7a644d97b63873a88b790dbb900cdd321e989a9d | |
parent | 33571417294865110648ffefc78f533a8be6d65e (diff) |
multilingual example demo
27 files changed, 454 insertions, 90 deletions
@@ -52,85 +52,19 @@ ``` ## How to configure? - It is very simple. You can edit the example **config. toml** file from examplesite or below + It is very simple. You can edit the example **config. toml** file from examplesite. -```bash -baseurl = "https://example.com/" -languageCode = "en-us" -title = "Hugo W3 Simple Theme" -theme = "hugo-w3-simple" -disqusShortname = "" # disqus_shortname -googleAnalytics = "" # UA-XXXXXXXX-X -paginate = 12 #gridstyle use 3 column. so should be 3,6,9,12,15.... -hasCJKLanguage = true # has chinese/japanese/korean ? - -[[menu.main]] - name = "About" - url = "/about/" - weight = 2 -[[menu.main]] - name = "Categories" - url = "/categories/" - weight = 3 -[[menu.main]] - name = "Tags" - url = "/tags/" - weight = 4 - -[[menu.main]] - name = "All Posts" - url = "/allposts/" - weight = 5 - - - -[params] - authorandlicense = true - authorimgurl = "https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/johndoe.jpg" #if authorandlicense set true, this one must be set too - authorinfo = "<h4>Authored By John Doe</h4>" - licenseinfo = "<p class=\"w3-small\">John Doe, a good man living in the earth, loving building website with Hugo.<br>This article is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by/4.0/\" class=\"w3-text-white\">Creative Commons Attribution 4.0 International License</a>.</p>" - relatedPosts = true - backtotop = true - glowlogo = true # if want logo to have glowing style, set true. - scrollindicator = true # if need scroll indicator on the top, set true - gridstyle = true # list post with grid style. If false then simple list - readingtime = true #display reading time and word count - firstpic = true # display first picture as thumbnail if no thumbnail set. For gridstyle only - socialshare = true - searchfunction = false #If you need search button and you have search function please set true - description = "Hugo W3 Simple Theme" - onesignalid = "" #one signal push app id - logotext = "HUGO W3 SIMPLE" # logo text - footer = "© [John Doe](https://johndoe.com) 2018 | [Github](https://github.com/johndoe) | [Twitter](https://twitter.com/johndoe) | [RSS](/index.xml)" - - -[params.social] # Set your social account here, if you don't have some accounts just comment them - a-envelope = "mailto:your@email.com" - b-stack-overflow ="https://stackoverflow.com/users/12345678/john-doe" - c-twitter = "https://twitter.com/johndoe" - d-facebook = "https://www.facebook.com/johndoe" - e-github = "https://github.com/johndoe" - f-youtube = "https://www.youtube.com/channel/12345678" - g-linkedin = "https://www.linkedin.com/johndoe" - h-google = "https://plus.google.com/12345678" - i-github = "https://github.com/johndoe" - j-weibo = "https://weibo.com" - k-weixin = "http://localhost:1313" - l-tumblr = "https://www.tumblr.com/blog/johndoe" - m-instagram = "https://instagram.com/johndoe" - n-gitlab = "https://gitlab.com/johndoe" - o-pinterest = "https://www.pinterest.com/johndoe/" - -``` +## Multilingual +Hugo W3 Simple supports multilingual. example site includes both English and Chinese version. You should put your posts on `./content/{langcode}/` folder. ## Search Page -To use search function, you need create `./content/search/index.md` file. Please see exampleSite folder. +To use search function, you need create `./content/{langcode}/search/index.md` file. Please see exampleSite folder. ## All posts -To use all posts function, you need create `./content/allposts/_index.md` file. Please see exampleSite folder. +To use all posts function, you need create `./content/{langcode}/allposts/_index.md` file. Please see exampleSite folder. ## Favicon @@ -157,3 +91,4 @@ Released under the [MIT](https://github.com/jesselau76/hugo-w3-simple/blob/maste + diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b0a2014..ea54eb6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -8,31 +8,76 @@ googleAnalytics = "" # UA-XXXXXXXX-X paginate = 12 #gridstyle use 3 column. so should be 3,6,9,12,15.... hasCJKLanguage = true # has chinese/japanese/korean ? -[[menu.main]] +[languages.en] +weight = 0 +languageName = "English" +contentDir = "content/english" +[languages.en.params] + authorinfo = "<h4>Authored By John Doe</h4>" + licenseinfo = "<p class=\"w3-small\">John Doe, a good man living on the earth, loving making website with hugo. This article is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by/4.0/\" class=\"w3-text-white\">Creative Commons Attribution 4.0 International License</a>.</p>" + logotext = "HUGO W3 SIMPLE" # logo text + +[[languages.en.menu.main]] name = "About" url = "/about/" weight = 2 -[[menu.main]] +[[languages.en.menu.main]] name = "Categories" url = "/categories/" weight = 3 -[[menu.main]] +[[languages.en.menu.main]] name = "Tags" url = "/tags/" weight = 4 -[[menu.main]] +[[languages.en.menu.main]] name = "All Posts" url = "/allposts/" weight = 5 +[[languages.en.menu.main]] + name = "Chinese" + url = "/zh-cn/" + weight = 6 + + + +[languages.zh-cn] +weight = 10 +languageName = "Chinese" +contentDir = "content/chinese" + +[languages.zh-cn.params] + authorinfo = "<h4>本文由王一贴原创</h4>" + licenseinfo = '<p class="w3-small">王一贴,曾记录于《红楼梦》第八十回人物。任何问题,一贴搞定.<br>本文采用<a rel="license" href="http://creativecommons.org/licenses/by/4.0/" class="w3-text-white">知识共享署名 4.0 国际许可协议</a>进行许可。</p>' + logotext = "王一贴的博客" # logo text +[[languages.zh-cn.menu.main]] + name = "关于" + url = "/zh-cn/about/" + weight = 2 +[[languages.zh-cn.menu.main]] + name = "分类" + url = "/zh-cn/categories/" + weight = 3 +[[languages.zh-cn.menu.main]] + name = "标签" + url = "/zh-cn/tags/" + weight = 4 + +[[languages.zh-cn.menu.main]] + name = "全部帖子" + url = "/zh-cn/allposts/" + weight = 5 + +[[languages.zh-cn.menu.main]] + name = "English" + url = "/" + weight = 6 [params] authorandlicense = true authorimgurl = "https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/johndoe.jpg" #if authorandlicense set true, this one must be set too - authorinfo = "<h4>Authored By John Doe</h4>" - licenseinfo = "<p class=\"w3-small\">John Doe, a good man living in the earth, loving build website with Hugo.<br>This article is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by/4.0/\" class=\"w3-text-white\">Creative Commons Attribution 4.0 International License</a>.</p>" - + relatedPosts = true backtotop = true glowlogo = true # if want logo to have glowing style, set true. @@ -69,3 +114,4 @@ hasCJKLanguage = true # has chinese/japanese/korean ? + diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md deleted file mode 100644 index 3f59681..0000000 --- a/exampleSite/content/about.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -author: admin -date: 2018-11-10 00:28:38+00:00 -draft: false -title: About W3 Simple -type: page -url: /about/ ---- - - - -W3 Simple is a Hugo theme written by Jesse Lau . The main motivation for writing this theme was to provide a really minimal theme with W3 CSS included.
\ No newline at end of file diff --git a/exampleSite/content/chinese/about.md b/exampleSite/content/chinese/about.md new file mode 100644 index 0000000..4bb527e --- /dev/null +++ b/exampleSite/content/chinese/about.md @@ -0,0 +1,12 @@ +--- +author: admin +date: 2018-11-10 00:28:38+00:00 +draft: false +title: About W3 Simple +type: page +url: /zh-cn/about/ +--- + + + +Hugo W3 Simple是由[Jesse Lau](https://jesselau.com/)根据W3 CSS框架设计的HUGO主题模板 diff --git a/exampleSite/content/allposts/_index.md b/exampleSite/content/chinese/allposts/_index.md index 2da13b4..2da13b4 100644 --- a/exampleSite/content/allposts/_index.md +++ b/exampleSite/content/chinese/allposts/_index.md diff --git a/exampleSite/content/chinese/posts/eighth.md b/exampleSite/content/chinese/posts/eighth.md new file mode 100644 index 0000000..5917baa --- /dev/null +++ b/exampleSite/content/chinese/posts/eighth.md @@ -0,0 +1,17 @@ +--- +title: "Eighth" +date: 2018-10-07T11:40:11+02:00 +type: post +categories: +- Website Programming +tags: +- hugo +- interesting +draft: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-rigo-erives-594315-unsplash.jpg + +--- + +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/chinese/posts/fourth.md b/exampleSite/content/chinese/posts/fourth.md new file mode 100644 index 0000000..e0ef3c5 --- /dev/null +++ b/exampleSite/content/chinese/posts/fourth.md @@ -0,0 +1,12 @@ +--- +title: "Fourth" +date: 2018-10-07T11:39:16+02:00 +publishdate: 2018-10-07T11:39:16+02:00 +image: "/images/blog/4.jpg" +tags: ["interesting"] +comments: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-samuele-errico-piccarini-206026-unsplash.jpg +--- +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/chinese/posts/my-first-post.md b/exampleSite/content/chinese/posts/my-first-post.md new file mode 100644 index 0000000..81bea7b --- /dev/null +++ b/exampleSite/content/chinese/posts/my-first-post.md @@ -0,0 +1,12 @@ +--- +title: "My First Post" +date: 2018-10-07T11:17:14+02:00 +publishdate: 2018-10-07T11:17:14+02:00 +image: "/images/blog/1.jpg" +tags: ["interesting"] +comments: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-samuel-zeller-4135-unsplash.jpg +--- +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/chinese/posts/ninth.md b/exampleSite/content/chinese/posts/ninth.md new file mode 100644 index 0000000..93f9f37 --- /dev/null +++ b/exampleSite/content/chinese/posts/ninth.md @@ -0,0 +1,12 @@ +--- +title: "Ninth" +date: 2018-10-07T11:40:14+02:00 +publishdate: 2018-10-07T11:40:14+02:00 +image: "/images/blog/9.jpg" +tags: ["interesting", "drink"] +comments: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-joshua-fuller-667473-unsplash.jpg +--- +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/chinese/posts/second.md b/exampleSite/content/chinese/posts/second.md new file mode 100644 index 0000000..ebd26a4 --- /dev/null +++ b/exampleSite/content/chinese/posts/second.md @@ -0,0 +1,12 @@ +--- +title: "Second" +date: 2018-10-07T11:39:10+02:00 +publishdate: 2018-10-07T11:39:10+02:00 +image: "/images/blog/2.jpg" +tags: ["interesting"] +comments: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-john-towner-177554-unsplash.jpg +--- +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/chinese/posts/seventh.md b/exampleSite/content/chinese/posts/seventh.md new file mode 100644 index 0000000..e3235dc --- /dev/null +++ b/exampleSite/content/chinese/posts/seventh.md @@ -0,0 +1,12 @@ +--- +title: "Seventh" +date: 2018-10-07T11:39:29+02:00 +publishdate: 2018-10-07T11:39:29+02:00 +image: "/images/blog/7.jpg" +tags: ["interesting"] +comments: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-jeremy-bishop-211453-unsplash.jpg +--- +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/chinese/posts/shortcodes-demopage.md b/exampleSite/content/chinese/posts/shortcodes-demopage.md new file mode 100644 index 0000000..6a01ec7 --- /dev/null +++ b/exampleSite/content/chinese/posts/shortcodes-demopage.md @@ -0,0 +1,255 @@ + +--- +author: admin +date: 2018-11-24T00:26:15+13:00 +draft: false +title: Hugo W3 Simple主题快捷方式演示 +url: /hugo-w3-simple-shortcodes-demo/ +w3codecolor: true +categories: +- 网络开发 +tags: +- hugo + +type: "post" +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-jad-limcaco-183877-unsplash.jpg + +--- + +关于这个模板 [Hugo W3-Simple Theme](https://github.com/jesselau76/hugo-w3-simple)我是先做了个英文版的快捷方式演示,因为考虑到可能英文用户会稍微多点,今天有空又更新了一个快捷方式,同时写一个中文版页面吧。 + +此模板是基于[W3schools](https://www.w3schools.com/w3css/default.asp) 的W3.CSS框架做成的,因为我觉得此框架十分有效而且简洁,比bootstrap的css要小的多。 + +W3.css只有bootstrap css的五分之一不到。我还没有算上boostrap的javascript库。 + +通过这个css框架,可以很方便的做一些快捷方式来丰富博客的内容。 +<hr> + +# Info 快捷方式 +我们可以很简单的在markdown文件中显示一些信息: +{{< colorcode title="Code for info shortcodes">}} +{{< info >}}<br> +蓝色常常指示一些信息性内容<br> +{{</info >}} +{{< /colorcode >}} +这个标题缺省的是 `Information!`: +{{< info >}} +蓝色常常指示一些信息性内容 +{{< /info >}} + +我们可以设置标题 + +{{< colorcode title="Code for info shortcodes with title">}} +{{< info title="W3.CSS是一个CSS框架!">}} <br> +W3.CSS是一个自适应的CSS框架。 它默认支持移动设备自适应设计,并且比类似的CSS框架更小更快。<br> +{{< /info >}} +{{< /colorcode >}} + +{{< info title="W3.CSS是一个CSS框架!">}} +W3.CSS是一个自适应的CSS框架。 它默认支持移动设备自适应设计,并且比类似的CSS框架更小更快。 +{{< /info >}} + +<hr> + +# Warning 快捷方式 +我们也可很简单的显示警告信息 +{{< colorcode title="Code for warning shortcodes">}} +{{< warning >}}<br> +黄色常常用于设置警告标识 <br> +{{</warning >}} +{{< /colorcode >}} +这个标题缺省是 `Warning!`: +{{< warning >}} +黄色常常用于设置警告标识 +{{< /warning >}} + +可以自设标题: + +{{< colorcode title="Code for warning shortcodes with title">}} +{{< warning title="注意!">}} <br> +W3 CSS比其他CSS模板小上n倍,故此速度更快 <br> +{{< /warning >}} +{{< /colorcode >}} +It will display the title with your set: +{{< warning title="注意!">}} +W3 CSS比其他CSS模板小上n倍,故此速度更快 +{{< /warning >}} + +<hr> + +# Colorcode 快捷方式 +本模板仍然是用w3schools的一个w3colorcode.js来显示代码颜色,为啥用它呢,还是因为它足够小,比highlight.js小上n倍。 + +要用这个功能,你需要在帖子的markdown文件设置 `w3codecolor: true` . + +因为这个js文件虽然比其他的都小得多,但也有20kb以上,所以我没有设成全站所有文件都调用这个js文件,毕竟很多帖子根本不需要显示代码颜色。 + +w3colorcode.js的原版在w3schools目前支持`html`, `js`, `java`, `css`, `sql`, `python` 的颜色高亮。 + +我稍微更改了一下,让它支持了`bash` 脚本语言的高亮。 + +## bash 语言高亮 + +Colorcode 快捷方式用 `mode` 和`title` 两个参数来设置. 假如不设置,就缺省采用`bash`语言高亮,也没有任何标题. + +{{< colorcode title="Code for default colorcode shortcodes">}} +{{< colorcode >}}<br> +your code here<br> +{{</colorcode >}} +{{< /colorcode >}} +The demo for default colorcode shortcodes: +{{< colorcode >}} +欲安装Hugo-w3-simple主题模板,用下列命令即可<br> +cd themes<br> +git clone https://github.com/jesselau76/hugo-w3-simple.git<br> +{{< /colorcode >}} + +## html 语言高亮 +{{< colorcode title="Code for html colorcode shortcodes">}} +{{< colorcode mode="htmlHigh" title="Demo for html color" >}}<br> +your code here<br> +{{</colorcode >}} +{{< /colorcode >}} + +{{< colorcode mode="htmlHigh" title="Demo for html color" >}} +<!DOCTYPE html><br><html><br> + <title>HTML Tutorial</title><br> + <body><br><br> + <h1>This is a heading</h1><br> + <p>This is a paragraph.</p><br><br> + </body><br> + </html> +{{< /colorcode >}} + +## css 语言高亮 + +{{< colorcode title="Code for css colorcode shortcodes">}} +{{< colorcode mode="cssHigh" title="Demo for css color" >}}<br> +your code here<br> +{{</colorcode >}} +{{< /colorcode >}} + +{{< colorcode mode="cssHigh" title="Demo for css color" >}} +body {<br> + background-color: #d0e4fe;<br> + }<br><br> + + h1 {<br> + color: orange;<br> + text-align: center;<br> + }<br><br> + + p {<br> + font-family: "Times New Roman";<br> + font-size: 20px;<br> + } +{{< /colorcode >}} + +## javascript语言高亮 + +{{< colorcode title="Code for js colorcode shortcodes">}} +{{< colorcode mode="jsHigh" title="Demo for js color" >}}<br> +your code here<br> +{{</colorcode >}} +{{< /colorcode >}} + +{{< colorcode mode="jsHigh" title="Demo for js color" >}} +function w3CodeColor() {<br> + var x, i, j, k, l, modes = ["html", "js", "java", "css", "sql", "python"];<br> + if (!document.getElementsByClassName) {return;}<br> + k = modes.length;<br> + for (j = 0; j < k; j++) {<br> + x = document.getElementsByClassName(modes[j] + "High");<br> + l = x.length;<br> + for (i = 0; i < l; i++) {<br> + x[i].innerHTML = w3CodeColorize(x[i].innerHTML, modes[j]);<br> + }<br> + }<br> +}<br> +{{< /colorcode >}} + +## sql 语言高亮 +{{< colorcode title="Code for sql colorcode shortcodes">}} +{{< colorcode mode="sqlHigh" title="Demo for sql color" >}}<br> +your code here<br> +{{</colorcode >}} +{{< /colorcode >}} + +{{< colorcode mode="sqlHigh" title="Demo for sql color" >}} +SELECT column1, column2, ...<br> +FROM table_name<br> +ORDER BY column1, column2, ... ASC|DESC; <br> +{{< /colorcode >}} + +## python语言高亮 +{{< colorcode title="Code for python colorcode shortcodes">}} +{{< colorcode mode="pythonHigh" title="Demo for python color" >}}<br> +your code here<br> +{{</colorcode >}} +{{< /colorcode >}} + +{{< colorcode mode="pythonHigh" title="Demo for python color" >}} +import json<br> + +# some JSON:<br> +x = '{ "name":"John", "age":30, "city":"New York"}'<br> + +# parse x:<br> +y = json.loads(x)<br> + +# the result is a Python dictionary:<br> +print(y["age"]) <br> +{{< /colorcode >}} + +<hr> + +# quote 快捷方式 + +本来用`blockquote`也可以显示引文。不过有时我们想多样化显示。所以我也做了这个一个快捷方式。 + +{{< colorcode title="Code for quote shortcodes">}} +{{< quote >}}<br> +<p class=" w3-xxlarge"><br> + 天地不仁,以万物为刍狗;圣人不仁,以百姓为刍狗。<br> +</p><br> +<p class="w3-right">--- 老子</p><br> +{{< /quote >}} +{{< /colorcode >}} +缺省宽度为100% +{{< quote >}} +<p class=" w3-xxlarge"> + 天地不仁,以万物为刍狗;圣人不仁,以百姓为刍狗。 +</p><p class="w3-right">--- 老子</p> +{{< /quote >}} + +可以设置宽度百分比 + {{< colorcode title="Code for quote shortcodes with % width">}} +{{< quote width="38.2%" >}}<br> +<p class=" w3-xxlarge"><br> + 天地不仁,以万物为刍狗;圣人不仁,以百姓为刍狗。<br> +</p><br> +<p class="w3-right">--- 老子</p><br> +{{< /quote >}} +{{< /colorcode >}} +{{< quote width="38.2%" >}} +<p class=" w3-xxlarge"> + 天地不仁,以万物为刍狗;圣人不仁,以百姓为刍狗。 +</p><p class="w3-right">--- 老子</p> +{{< /quote >}} + +也可以直接设置px宽度 + +{{< colorcode title="Code for quote shortcodes with px width">}} +{{< quote width="300px" >}}<br> +<p class=" w3-xxlarge"><br> + 天地不仁,以万物为刍狗;圣人不仁,以百姓为刍狗。<br> +</p><br> +<p class="w3-right">--- 老子</p><br> +{{< /quote >}} +{{< /colorcode >}} + +{{< quote width="300px" >}} +<p class=" w3-xxlarge"> + 天地不仁,以万物为刍狗;圣人不仁,以百姓为刍狗。 +</p><p class="w3-right">--- 老子</p> +{{< /quote >}} diff --git a/exampleSite/content/chinese/posts/sixth.md b/exampleSite/content/chinese/posts/sixth.md new file mode 100644 index 0000000..68b65cb --- /dev/null +++ b/exampleSite/content/chinese/posts/sixth.md @@ -0,0 +1,12 @@ +--- +title: "Sixth" +date: 2018-10-07T11:39:25+02:00 +publishdate: 2018-10-07T11:39:25+02:00 +image: "/images/blog/6.jpg" +tags: ["interesting", "drink"] +comments: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-christine-roy-343235-unsplash.jpg +--- +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/chinese/posts/third.md b/exampleSite/content/chinese/posts/third.md new file mode 100644 index 0000000..6f18bdd --- /dev/null +++ b/exampleSite/content/chinese/posts/third.md @@ -0,0 +1,12 @@ +--- +title: "Third" +date: 2018-10-07T11:39:13+02:00 +publishdate: 2018-10-07T11:39:13+02:00 +image: "/images/blog/3.jpg" +tags: ["interesting"] +comments: false +thumbnail: https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-goran-ivos-343495-unsplash.jpg +--- +# 王一贴 +当下王一贴进来,宝玉正歪在炕上,看见王一贴进来,便笑道:“来的好,我听见说你极会说笑话儿的,说一个给我们大家听听。”王一贴笑道:“正是呢,哥儿别睡,仔细肚子里面筋作怪。”说着,满屋里的都笑了。宝玉也笑着起身整衣。王一贴命徒弟们快沏好茶来。焙茗道:“我们爷不吃你的茶,坐在这屋里还嫌膏药气息呢。”王一贴笑道:“不当家花拉的,膏药从不拿进屋里来的,知道二爷今日必来,三五日头里就拿香薰了。”宝玉道:“可是呢,天天只听见说你的膏药好,到底治什么病?”王一贴道:“若问我的膏药,说来话长。其中底细,一言难尽。共药一百二十味,君臣相济,温凉兼用。内则调元补气,养荣卫,开胃口,宁神定魄,去寒去暑,化食化痰;外则和血脉,舒筋络,去死生新,去风散毒。其效如神,贴过便知。”宝玉道:“我不信,一张膏药就治这些病?我且问你,倒有一种病,也贴得好吗?” 王一贴道:“百病千灾,无不立效,二爷只管揪胡子,打我这老脸,拆我这庙,何如?只说出病源来。”宝玉道:“我问你,可有贴女人妒病的方子没有?”王一贴听了,拍手笑道:“这可罢了。不但说没有方子,就是听也没有听见过!”宝玉笑道:“这样还算得什么。”王一贴又忙说道:“这贴妒的膏药倒没经过。有一种汤药,或者可医,只是慢些儿,不能立刻见效的。”宝玉道:“什么汤?怎么吃法?”王一贴道:“这叫做‘疗妒汤’。用极好的秋梨一个,二钱冰糖,一钱陈皮,水三碗,梨熟为度。每日清晨吃这一个梨,吃来吃去就好了。”宝玉道:“这也不值什么,只怕未必见效。”王一贴道:“一剂不效,吃十剂;今日不效,明日再吃;今年不效,明年再吃。横竖这三味药都是润肺开胃不伤人的。甜丝丝的,又止咳嗽,又好吃。吃过一百岁,人横竖是要死的。死了还妒什么,那时就见效了。” +说着,宝玉、焙茗都大笑不止,骂:“油嘴的牛头!”王一贴道 :“不过是闲着解午盹罢了,有什么关系?说笑了你们就值钱。告诉你们说,连膏药也是假的!我有真药,我还吃了做神仙呢,有真的跑到这里来混!” diff --git a/exampleSite/content/search/index.md b/exampleSite/content/chinese/search/index.md index adafeb0..adafeb0 100644 --- a/exampleSite/content/search/index.md +++ b/exampleSite/content/chinese/search/index.md diff --git a/exampleSite/content/english/about.md b/exampleSite/content/english/about.md new file mode 100644 index 0000000..9d02087 --- /dev/null +++ b/exampleSite/content/english/about.md @@ -0,0 +1,12 @@ +--- +author: admin +date: 2018-11-10 00:28:38+00:00 +draft: false +title: About W3 Simple +type: page +url: /about/ +--- + + + +W3 Simple is a Hugo theme written by [Jesse Lau](https://jesselau.com/) . The main motivation for writing this theme was to provide a really minimal theme with W3 CSS included. diff --git a/exampleSite/content/english/allposts/_index.md b/exampleSite/content/english/allposts/_index.md new file mode 100644 index 0000000..2da13b4 --- /dev/null +++ b/exampleSite/content/english/allposts/_index.md @@ -0,0 +1,8 @@ +--- +title: "All posts" +type: "allposts" +--- +<h2>All Posts of Hugo W3 Simple Example Site From Start</h2> + + + diff --git a/exampleSite/content/posts/eighth.md b/exampleSite/content/english/posts/eighth.md index d90800c..d90800c 100644 --- a/exampleSite/content/posts/eighth.md +++ b/exampleSite/content/english/posts/eighth.md diff --git a/exampleSite/content/posts/fourth.md b/exampleSite/content/english/posts/fourth.md index b10f431..b10f431 100644 --- a/exampleSite/content/posts/fourth.md +++ b/exampleSite/content/english/posts/fourth.md diff --git a/exampleSite/content/posts/my-first-post.md b/exampleSite/content/english/posts/my-first-post.md index 3089c7b..3089c7b 100644 --- a/exampleSite/content/posts/my-first-post.md +++ b/exampleSite/content/english/posts/my-first-post.md diff --git a/exampleSite/content/posts/ninth.md b/exampleSite/content/english/posts/ninth.md index 5c8d513..5c8d513 100644 --- a/exampleSite/content/posts/ninth.md +++ b/exampleSite/content/english/posts/ninth.md diff --git a/exampleSite/content/posts/second.md b/exampleSite/content/english/posts/second.md index 534e577..534e577 100644 --- a/exampleSite/content/posts/second.md +++ b/exampleSite/content/english/posts/second.md diff --git a/exampleSite/content/posts/seventh.md b/exampleSite/content/english/posts/seventh.md index 0bcae0f..0bcae0f 100644 --- a/exampleSite/content/posts/seventh.md +++ b/exampleSite/content/english/posts/seventh.md diff --git a/exampleSite/content/posts/shortcodes-demopage.md b/exampleSite/content/english/posts/shortcodes-demopage.md index a497a60..a497a60 100644 --- a/exampleSite/content/posts/shortcodes-demopage.md +++ b/exampleSite/content/english/posts/shortcodes-demopage.md diff --git a/exampleSite/content/posts/sixth.md b/exampleSite/content/english/posts/sixth.md index c1f238b..c1f238b 100644 --- a/exampleSite/content/posts/sixth.md +++ b/exampleSite/content/english/posts/sixth.md diff --git a/exampleSite/content/posts/third.md b/exampleSite/content/english/posts/third.md index 550bcab..550bcab 100644 --- a/exampleSite/content/posts/third.md +++ b/exampleSite/content/english/posts/third.md diff --git a/exampleSite/content/english/search/index.md b/exampleSite/content/english/search/index.md new file mode 100644 index 0000000..adafeb0 --- /dev/null +++ b/exampleSite/content/english/search/index.md @@ -0,0 +1,7 @@ +--- +title: "Search" +type: "search" +--- + +## Manticore Search + |