From 594655b050145b7c3beab06166678940e613a79a Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Fri, 29 May 2020 16:55:27 +0800 Subject: Disqus support --- README.md | 14 +++++++++++++- layouts/_default/single.html | 1 + layouts/partials/comment-disqus.html | 18 ++++++++++++++++++ layouts/partials/scripts-end.html | 16 ++++++++++++++++ .../fuji.scss_e96ab798981512bd25aa1bd5ceab58da.content | 2 +- 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/comment-disqus.html diff --git a/README.md b/README.md index 7647786..b0fef40 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Fuji -Fuji is a minimal Hugo theme inspired by Hexo theme [Murasaki](https://github.com/printempw/hexo-theme-murasaki/), with responsive grid system and GitHub Primer markdown style. +Fuji is a minimal Hugo theme with full dark mode support and GitHub Primer markdown style. ![RELEASE](https://img.shields.io/github/v/release/amzrk2/hugo-theme-fuji?style=flat-square) ![BUILD STATUS](https://img.shields.io/github/workflow/status/amzrk2/hugo-theme-fuji/Build%20Test?style=flat-square) ![REPO SIZE](https://img.shields.io/github/repo-size/amzrk2/hugo-theme-fuji?style=flat-square) ![LICENSE](https://img.shields.io/github/license/amzrk2/hugo-theme-fuji?style=flat-square) @@ -11,11 +11,13 @@ Fuji is a minimal Hugo theme inspired by Hexo theme [Murasaki](https://github.co - [Getting started](#getting-started) - [Update the theme](#update-the-theme) - [Configration](#configration) + - [Favicon](#favicon) - [In-post license & comments](#in-post-license--comments) - [APlayer](#aplayer) - [Image zoom and lazyload settings](#image-zoom-and-lazyload-settings) - [Markdown render hook](#markdown-render-hook) - [Custom fonts](#custom-fonts) + - [Disqus identifier](#disqus-identifier) - [Contributing](#contributing) - [License](#license) - [Annotations](#annotations) @@ -62,6 +64,12 @@ $ git submodule update --remote --merge ## Configration +### Favicon + +Create `[SITEROOT]/layouts/partials/favicon.html` to cover theme's favicon. + +You can generate your favicons in [realfavicongenerator.net](https://realfavicongenerator.net/). + ### In-post license & comments You can set variables below in post's front matter to disable them: @@ -143,6 +151,10 @@ $mono-font: 'Cascadia Code', 'SF Mono', 'Fira Code', 'Consolas', $body-font; $body-font-size: 16px; ``` +## Disqus identifier + +Use the `[SITEROOT]/layouts/partials/comment-disqus.html` to cover `themes/fuji/layouts/partials/comment-disqus.html`. + ## Contributing Did you found a bug or got an idea for a new feature? Feel free to use the [issue tracker](https://github.com/amzrk2/hugo-theme-fuji/issues) to let me know. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 72ec0a8..9795378 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -26,5 +26,6 @@ {{ end }} {{ if ne .Params.noComments true }} {{ partial "comment-utterances.html" . }} +{{ partial "comment-disqus.html" . }} {{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html new file mode 100644 index 0000000..539f8c7 --- /dev/null +++ b/layouts/partials/comment-disqus.html @@ -0,0 +1,18 @@ +{{ with .Site.Params.disqusShortname }} +
+
+ +
+{{ end }} \ No newline at end of file diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index ea37e5c..39b3a00 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -118,6 +118,22 @@ } }); +{{ else if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.disqusShortname) }} + {{ else }}