|
| 1 | +# Maupassant |
| 2 | + |
| 3 | +[](https://travis-ci.org/tufu9441/maupassant-hexo) [](https://github.com/tufu9441/maupassant-hexo/blob/master/LICENSE) |
| 4 | + |
| 5 | +> 大道至简 |
| 6 | +
|
| 7 | +[Preview](https://www.haomwei.com)|[中文文档](https://www.haomwei.com/technology/maupassant-hexo.html) |
| 8 | + |
| 9 | +A simple Hexo template with great performance on different devices, ported from a Typecho theme by [Cho](https://github.com/pagecho/maupassant/), forked and modified from [icylogic](https://github.com/icylogic/maupassant-hexo/). |
| 10 | + |
| 11 | + |
| 13 | + |
| 14 | +## Installation |
| 15 | +Install theme and renderers: |
| 16 | + |
| 17 | +```shell |
| 18 | +$ git clone https://github.com/tufu9441/maupassant-hexo.git themes/maupassant |
| 19 | +$ npm install hexo-renderer-pug --save |
| 20 | +$ npm install hexo-renderer-sass --save |
| 21 | +``` |
| 22 | + |
| 23 | +Then change your `theme` setting in `_config.yml` to `maupassant`. |
| 24 | + |
| 25 | +## Configuration |
| 26 | +Default config: |
| 27 | + |
| 28 | +```YAML |
| 29 | +fancybox: true ## If you want to use fancybox please set the value to true. |
| 30 | +disqus: ## Your disqus_shortname, e.g. username |
| 31 | +gitment: |
| 32 | + enable: false ## If you want to use Gitment comment system please set the value to true. |
| 33 | + owner: ## Your GitHub ID, e.g. username |
| 34 | + repo: ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io |
| 35 | + client_id: ## GitHub client ID, e.g. 75752dafe7907a897619 |
| 36 | + client_secret: ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 |
| 37 | +uyan: ## Your uyan_id. e.g. 1234567 |
| 38 | +livere: ## Your livere data-uid, e.g. MTAyMC8zMDAxOC78NTgz |
| 39 | +changyan: ## Your changyan appid, e.g. cyrALsXc8 |
| 40 | +changyan_conf: ## Your changyan conf, e.g. prod_d8a508c2825ab57eeb43e7c69bba0e8b |
| 41 | +valine: ## https://valine.js.org |
| 42 | + enable: false ## If you want to use Valine comment system, please set the value to true. |
| 43 | + appid: ## Your LeanCloud application App ID, e.g. pRBBL2JR4N7kLEGojrF0MsSs-gzGzoHsz |
| 44 | + appkey: ## Your LeanCloud application App Key, e.g. tjczHpDfhjYDSYddzymYK1JJ |
| 45 | + notify: false ## Mail notifier, see https://github.com/xCss/Valine/wiki/Valine-评论系统中的邮件提醒设置 |
| 46 | + verify: false ## Validation code. |
| 47 | + placeholder: Just so so ## Comment box placeholders. |
| 48 | + avatar: 'mm' ## Gravatar type, see https://github.com/xCss/Valine/wiki/avatar-setting-for-valine |
| 49 | + pageSize: 10 ## Number of comments per page. |
| 50 | + guest_info: nick,mail,link ## Attributes of reviewers. |
| 51 | + |
| 52 | +google_search: true ## Use Google search, true/false. |
| 53 | +baidu_search: false ## Use Baidu search, true/false. |
| 54 | +swiftype: ## Your swiftype_key, e.g. m7b11ZrsT8Me7gzApciT |
| 55 | +tinysou: ## Your tinysou_key, e.g. 4ac092ad8d749fdc6293 |
| 56 | +self_search: false ## Use a jQuery-based local search engine, true/false. |
| 57 | +google_analytics: ## Your Google Analytics tracking id, e.g. UA-42425684-2 |
| 58 | +baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000 |
| 59 | +show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true. |
| 60 | +toc_number: true ## If you want to add list number to toc please set the value to true. |
| 61 | +shareto: false ## If you want to use the share button please set the value to true, you must have hexo-helper-qrcode installed. |
| 62 | +busuanzi: false ## If you want to use Busuanzi page views please set the value to true. |
| 63 | +widgets_on_small_screens: false ## Set to true to enable widgets on small screens. |
| 64 | +canvas_nest: |
| 65 | + enable: false ## If you want to use dynamic background please set the value to true, you can also fill the following parameters to customize the dynamic effect, or just leave them blank to keep the default effect. |
| 66 | + color: ## RGB value of the color, e.g. "100,99,98" |
| 67 | + opacity: ## Transparency of lines, e.g. "0.7" |
| 68 | + zIndex: ## The z-index property of the background, e.g. "-1" |
| 69 | + count: ## Quantity of lines, e.g. "150" |
| 70 | +donate: |
| 71 | + enable: false ## If you want to show the donate button after each post, please set the value to true and fill the following items according to your need. You can also enable donate button in a page by adding a "donate: true" item to the front-matter. |
| 72 | + github: ## GitHub URL, e.g. https://github.com/Kaiyuan/donate-page |
| 73 | + alipay_qr: ## Path of Alipay QRcode image, e.g. /img/AliPayQR.png |
| 74 | + wechat_qr: ## Path of Wechat QRcode image, e.g. /img/WeChatQR.png |
| 75 | + btc_qr: ## Path of Bitcoin QRcode image, e.g. /img/BTCQR.png |
| 76 | + btc_key: ## Bitcoin key, e.g. 1KuK5eK2BLsqpsFVXXSBG5wbSAwZVadt6L |
| 77 | + paypal_url: ## Paypal URL, e.g. https://paypal.me/tufu9441 |
| 78 | + |
| 79 | +menu: |
| 80 | + - page: home |
| 81 | + directory: . |
| 82 | + icon: fa-home |
| 83 | + - page: archive |
| 84 | + directory: archives/ |
| 85 | + icon: fa-archive |
| 86 | + - page: about |
| 87 | + directory: about/ |
| 88 | + icon: fa-user |
| 89 | + - page: rss |
| 90 | + directory: atom.xml |
| 91 | + icon: fa-rss |
| 92 | + |
| 93 | +widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links. |
| 94 | + - search |
| 95 | + - category |
| 96 | + - tag |
| 97 | + - recent_posts |
| 98 | + - recent_comments |
| 99 | + - links |
| 100 | + |
| 101 | +links: |
| 102 | + - title: site-name1 |
| 103 | + url: http://www.example1.com/ |
| 104 | + - title: site-name2 |
| 105 | + url: http://www.example2.com/ |
| 106 | + - title: site-name3 |
| 107 | + url: http://www.example3.com/ |
| 108 | + |
| 109 | +timeline: |
| 110 | + - num: 1 |
| 111 | + word: 2014/06/12-Start |
| 112 | + - num: 2 |
| 113 | + word: 2014/11/29-XXX |
| 114 | + - num: 3 |
| 115 | + word: 2015/02/18-DDD |
| 116 | + - num: 4 |
| 117 | + word: More |
| 118 | + |
| 119 | +# Static files |
| 120 | +js: js |
| 121 | +css: css |
| 122 | + |
| 123 | +# Theme version |
| 124 | +version: 0.0.0 |
| 125 | +``` |
| 126 | +- fancybox - Enable [Fancybox](http://fancyapps.com/fancybox/) |
| 127 | +- disqus - [Disqus](https://disqus.com) shortname |
| 128 | +- gitment - [Gitment](https://github.com/imsun/gitment) comment system |
| 129 | +- uyan - [Uyan](http://www.uyan.cc) id |
| 130 | +- livere - [LiveRe](https://livere.com) data-uid |
| 131 | +- changyan - [Changyan](http://changyan.kuaizhan.com) appid |
| 132 | +- valine - [Valine](https://valine.js.org) comment system |
| 133 | +- google_search - Default search engine |
| 134 | +- baidu_search - Search engine for users in China |
| 135 | +- swiftype - [Swiftype Search](https://swiftype.com) key |
| 136 | +- tinysou - [Tiny Search](http://tinysou.com) key |
| 137 | +- self_search - A jQuery-based [local search engine](http://hahack.com/codes/local-search-engine-for-hexo), with the dependency on the plugin [hexo-generator-search](https://github.com/PaicHyperionDev/hexo-generator-search) |
| 138 | +- google_analytics - [Google Analytics](https://www.google.com/analytics/) tracking id |
| 139 | +- baidu_analytics - [Baidu Analytics](http://tongji.baidu.com) tracking id |
| 140 | +- show_category_count - Show the count of categories in the sidebar widget |
| 141 | +- toc_number - Show the list number of toc |
| 142 | +- shareto - Enable share button, with the dependency on the plugin [hexo-helper-qrcode](https://github.com/yscoder/hexo-helper-qrcode) |
| 143 | +- busuanzi - Enable [Busuanzi](http://busuanzi.ibruce.info) page views |
| 144 | +- widgets_on_small_screens - Show the widgets at the bottom of small screens |
| 145 | +- [canvas_nest](https://github.com/hustcc/canvas-nest.js) - Enable dynamic background |
| 146 | +- donate - Enable donate button after each post |
| 147 | +- menu - Customize your menu of pages here, just follow the format of existied items. Don't forget to create corresponding folders inlcuding `index.md` in `source` folder to ensure the pages will correctly display. [FontAwesome](http://fontawesome.io) icon fonts have been integrated, and you can choose other icons which you like [here](http://fontawesome.io/icons/) and use them according to the instruction. |
| 148 | +- widgets - Choose and arrange the widgets in sidebar here. |
| 149 | +- links - Edit your blogroll here. |
| 150 | +- timeline - Show a timeline of the website by setting `layout: timeline` of a page. |
| 151 | +- Static files - Static files directory, for convenience of CDN usage. |
| 152 | +- Theme version - For automatic refresh of static files on CDN. |
| 153 | + |
| 154 | +## Features |
| 155 | +#### Logo |
| 156 | +You can set a **favicon.ico** for your website, please put it into `source` folder of hexo directory, recommended size: 32px*32px. |
| 157 | + |
| 158 | +You can add a website logo for apple devices, please put an image named **apple-touch-icon.png** into `source` folder of hexo directory, recommended size: 114px*114px. |
| 159 | + |
| 160 | +#### Abstract |
| 161 | +You can control the abstract of a post shown at index, by either filling a `description:` item in `front-matter` of the `post.md`, or just inserting a `<!--more-->` before your hidden content. |
| 162 | + |
| 163 | +#### Page |
| 164 | +Create folders inlcuding `index.md` in `source` folder to add pages, and add a `layout: page` in `front-matter` of `index.md`. If you need a single column page without sidebar, just set `layout: single-column` instead of `layout: page`. |
| 165 | + |
| 166 | +#### Table of Contents |
| 167 | +TOC in a post can be enabled by adding a `toc: true` item in `front-matter`. |
| 168 | + |
| 169 | +#### Comments |
| 170 | +Comment feature of each post and page can be enabled (default) and disabled by adding a `comments: true` or a `comments: false` in `front-matter`. This could be useful when you want comment feature for a guestbook page, but don't want comment feature for a about page. |
| 171 | + |
| 172 | +#### Syntax Highlighting |
| 173 | +Highlighted code showcase is supported, please set the `highlight` option in `_config.yml` of hexo directory like this: |
| 174 | + |
| 175 | +```YAML |
| 176 | +highlight: |
| 177 | + enable: true |
| 178 | + auto_detect: true |
| 179 | + line_number: true |
| 180 | + tab_replace: |
| 181 | +``` |
| 182 | + |
| 183 | +#### Math Equation |
| 184 | +Add |
| 185 | +```YAML |
| 186 | +mathjax: true |
| 187 | +``` |
| 188 | +in Hexo's `_config.yml`. |
| 189 | + |
| 190 | +In the post which you would like to use math equation, add `mathjax: true` in the `front-matter`. For example: |
| 191 | + |
| 192 | +```YAML |
| 193 | +title: Test Math |
| 194 | +date: 2016-04-05 14:16:00 |
| 195 | +categories: math |
| 196 | +mathjax: true |
| 197 | +--- |
| 198 | +``` |
| 199 | +The default math delimiters are `$$...$$` and `\\[...\\]` for displayed mathematics, |
| 200 | +and `$...$` and `\\(...\\)` for in-line mathematics. |
| 201 | + |
| 202 | +However, if your post contains dollar signs (`$`), and they appear often in non-mathematical parts, in other words, you want to use `$` as dollar sign not inline math delimiter, please add |
| 203 | + |
| 204 | +```YAML |
| 205 | +mathjax2: true |
| 206 | +``` |
| 207 | +in Hexo's `_config.yml` instead of `mathjax: true`. Correspondingly, add `mathjax2: true` to the `front-matter` of the post in which |
| 208 | +you would like to use math equation. |
| 209 | + |
| 210 | +See the [example](http://zhongpu.info/2016/05/06/Mathjax%20and%20Hexo/). |
| 211 | + |
| 212 | +#### Languages |
| 213 | +Seven languages are available for this theme currently: Simplified Chinese (zh-CN), Traditional Chinese (zh-TW), English (en), French (fr-FR), German (de-DE), Korean (ko) and Spanish (es-ES). Contributions of translating to other languages will be highly appreciated. |
| 214 | + |
| 215 | +## Solutions |
| 216 | +- Check whether your Terminal's current directory is in hexo's root directory which contains `source/`, `themes/`, etc. |
| 217 | + |
| 218 | +- If you have any trouble in using this theme, please feel free to open an [issue](https://github.com/tufu9441/maupassant-hexo/issues). |
| 219 | + |
| 220 | +## Browser Support |
| 221 | + |
| 222 | + |
| 223 | +## Contributing |
| 224 | +All kinds of contributions (enhancements, new features, documentation & code improvements, issues & bugs reporting) are welcome. |
| 225 | + |
| 226 | +Looking forward to your pull request. |
| 227 | + |
| 228 | +## Acknowledgements |
| 229 | +Thanks for all the [contributors](https://github.com/tufu9441/maupassant-hexo/graphs/contributors) of this theme. |
| 230 | +. |
| 231 | +## Maupassant on other platforms: |
| 232 | ++ Typecho:https://github.com/pagecho/maupassant/ |
| 233 | ++ Octopress:https://github.com/pagecho/mewpassant/ |
| 234 | ++ Farbox:https://github.com/pagecho/Maupassant-farbox/ |
| 235 | ++ Wordpress:https://github.com/iMuFeng/maupassant/ |
| 236 | ++ Ghost: https://github.com/LjxPrime/maupassant/ |
0 commit comments