From 453ae6cbfa160d69d803e5fbed8e1bf80f0fae7c Mon Sep 17 00:00:00 2001 From: Rise <8315221+AmazingRise@users.noreply.github.com> Date: Sat, 11 Apr 2020 16:11:33 +0800 Subject: Updated Enabling and Disabling Features (markdown) --- Comment-Area.md | 86 ++++++++++++++++++++++++++++ Enabling-and-Disabling-Features.md | 111 ------------------------------------- 2 files changed, 86 insertions(+), 111 deletions(-) create mode 100644 Comment-Area.md delete mode 100644 Enabling-and-Disabling-Features.md diff --git a/Comment-Area.md b/Comment-Area.md new file mode 100644 index 0000000..136ce80 --- /dev/null +++ b/Comment-Area.md @@ -0,0 +1,86 @@ +## Enable or disable comment area + +Now, this theme support these comment service: +- LiveRe +- Gitalk +- Disqus +- Valine + +### Enabling +#### Gitalk +Edit your `config.toml` in the hugo website's root directory. + +Add the following line to the section `[params]` +```toml +enableGitalk = true +``` +Then add following lines behind: +```toml +[params.gitalk] + owner = "user" + repo = "repo name" + client_id = "your client id" + client_secret = "your client secret" +``` +(Modify to suit your condition.) + +Notice: Gitalk will not shown in offline preview server.(Launched by `hugo server`) +#### Disqus +Hugo originally supports Disqus, and I added the disqus to the theme. + +But due to my network environment, I haven't had it tested. + +To add a disqus comment service, please add a line to `config.toml` in the root directory: + +```toml +disqusShortname = "Your disqus short name." +``` + +#### LiveRe! + +Edit your `config.toml` in the hugo website's root directory. + +Add the following line to the section `[params]` +```toml +livereId = "xxxx" +``` + +"xxxx" stands for the value of `data-uid` in your LiveRe HTML code. + +#### Valine +Edit your `config.toml` in the hugo website's root directory. + +Add the following line to the section `[params]` +```toml +enableValine = true +``` +Then add following lines behind: +```toml +[params.valine] + appId = "Your app ID of leancloud" + appKey = "Your app key of leancloud" + avator = "avator type" +``` + +`avator` is optional. For details, [click here](https://valine.js.org/avatar.html). + +#### Other comment service + +Welcome to open an issue or Pull Request for adding a new comment service. + +If I'm free then, I will add it. :P + +--- + +### Disabling +#### Disable the comment area in one post +If you wanna to disable the comment area in a specific post, please add a line in the metadata area of the post: +``` +comment : false +``` +A more detailed description of the posts' meta data is [here](https://github.com/AmazingRise/hugo-theme-diary/wiki/Post's-meta-data). + +#### Disable it globally +Please remove the settings item referred in "Add comment area". + +The comment area will not be shown. \ No newline at end of file diff --git a/Enabling-and-Disabling-Features.md b/Enabling-and-Disabling-Features.md deleted file mode 100644 index 46d42d6..0000000 --- a/Enabling-and-Disabling-Features.md +++ /dev/null @@ -1,111 +0,0 @@ -## Table Of Contents - -* [Disable Table of Contents](https://github.com/AmazingRise/hugo-theme-diary/wiki/Enabling-and-Disabling-Features#disable-table-of-contents) - -* [Disable Dark Mode](https://github.com/AmazingRise/hugo-theme-diary/wiki/Enabling-and-Disabling-Features#disable-dark-mode) - -* [Add or disable comment area](https://github.com/AmazingRise/hugo-theme-diary/wiki/Enabling-and-Disabling-Features#add-comment-area) - -## Disable Table of Contents - -### Globally - -Add `disableToC=true` to the section of `[param]` in your `config.toml`. -Then you will not see it. - -### Apply for single page - -Add `disableToC: true` in the front matter of the page. -Then you will disable it in the very page. - -## Disable Dark Mode - -Add `disableDarkMode=true` to the section of `[param]` in your `config.toml`. -Then you will not see it. - -## Enable or disable comment area - -Now, this theme support these comment service: -- LiveRe -- Gitalk -- Disqus -- Valine - -### Enabling -#### Gitalk -Edit your `config.toml` in the hugo website's root directory. - -Add the following line to the section `[params]` -```toml -enableGitalk = true -``` -Then add following lines behind: -```toml -[params.gitalk] - owner = "user" - repo = "repo name" - client_id = "your client id" - client_secret = "your client secret" -``` -(Modify to suit your condition.) - -Notice: Gitalk will not shown in offline preview server.(Launched by `hugo server`) -#### Disqus -Hugo originally supports Disqus, and I added the disqus to the theme. - -But due to my network environment, I haven't had it tested. - -To add a disqus comment service, please add a line to `config.toml` in the root directory: - -```toml -disqusShortname = "Your disqus short name." -``` - -#### LiveRe! - -Edit your `config.toml` in the hugo website's root directory. - -Add the following line to the section `[params]` -```toml -livereId = "xxxx" -``` - -"xxxx" stands for the value of `data-uid` in your LiveRe HTML code. - -#### Valine -Edit your `config.toml` in the hugo website's root directory. - -Add the following line to the section `[params]` -```toml -enableValine = true -``` -Then add following lines behind: -```toml -[params.valine] - appId = "Your app ID of leancloud" - appKey = "Your app key of leancloud" - avator = "avator type" -``` - -`avator` is optional. For details, [click here](https://valine.js.org/avatar.html). - -#### Other comment service - -Welcome to open an issue or Pull Request for adding a new comment service. - -If I'm free then, I will add it. :P - ---- - -### Disabling -#### Disable the comment area in one post -If you wanna to disable the comment area in a specific post, please add a line in the metadata area of the post: -``` -comment : false -``` -A more detailed description of the posts' meta data is [here](https://github.com/AmazingRise/hugo-theme-diary/wiki/Post's-meta-data). - -#### Disable it globally -Please remove the settings item referred in "Add comment area". - -The comment area will not be shown. \ No newline at end of file -- cgit v1.2.3