![](https://raw.githubusercontent.com/cntrump/hugo-notepadium/master/images/screenshot.png) # Notepadium [![Build Status](https://travis-ci.org/cntrump/hugo-notepadium.svg?branch=master)](https://travis-ci.org/cntrump/hugo-notepadium) Request Hugo Version: [0.60.0+](https://github.com/gohugoio/hugo/releases/) a fast and focus on reading [Hugo](https://gohugo.io) theme, **100% JavaScript-free**. Features - Logo and slogan - Navigation items - Syntax highlighting - Math supporting - Comments powered by Disqus - CC License - Pagination with a large number of pages supporting - Light & Dark Mode - Google analytics supporting - Custom CSS/SASS/SCSS supporting - Custom JS supporting - Custom header right items supporting - Builtin `plist` shortcode for API document - Custom article cover supporting - Article share supporting (thanks [@jianyuanzh](https://github.com/jianyuanzh)) - [Twitter Card](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary) supporting - Builtin iconfont (3KB) - Display author profile at article bottom - Support Bilibili shortcodes Preview the exampleSite: ```shell git clone https://github.com/cntrump/hugo-notepadium.git hugo-notepadium cd hugo-notepadium/exampleSite hugo server --themesDir ../.. ``` ## Quick Start ```shell git submodule add https://github.com/cntrump/hugo-notepadium.git themes/hugo-notepadium ``` Example `config.toml`: ```toml baseURL = "https://example.com" title = "Notepadium" theme = "hugo-notepadium" copyright = "©2019 Notepadium." languageCode = "zh-cn" hasCJKLanguage = true enableRobotsTXT = true # Enable Disqus #disqusShortname = "XXX" # Google Analytics #googleAnalytics = "UA-123-45" [markup.highlight] codeFences = true noClasses = false [markup.goldmark.renderer] unsafe = true # enable raw HTML in Markdown [params] style = "auto" # default: auto. light: light theme, dark: dark theme, auto: based on system. dateFormat = "Monday, January 2, 2006" # if unset, default is "2006-01-02" logo = "" # if you have a logo png slogan = "100% JavaScript-free" license = "" # CC License fullRss = false # Puts entire HTML post into rss 'description' tag. If unset, default is false. ipv6ready = true # Show IPV6Ready logo on footer. [params.comments] enable = false # En/Disable comments globally, default: false. You can always enable comments on per page. [params.comments.utterances] repo = "MetalBlueberry/MetalBlueberry.github.io" # enable comments with [utteranc.es](https://utteranc.es/) [params.math] enable = false # optional: true, false. Enable globally, default: false. You can always enable math on per page. use = "katex" # option: "katex", "mathjax". default: "katex" [params.syntax] use = "none" # builtin: "prismjs", "hljs". "none" means Chroma theme = "xcode" darkTheme = "xcode-dark" # apply this theme in dark mode [params.share] enable = false addThisId = "" inlineToolId = "" [params.nav] showCategories = true # /categories/ showTags = true # /tags/ # custom navigation items [[params.nav.custom]] title = "About" url = "/about" [[params.nav.custom]] title = "Hugo" url = "https://gohugo.io/" # for chinese [params.beian] icp = "" # example: 粤ICP备20056596号-1 gongan = "" # example: 粤公网安备 44030502005645号 code = "" # example: 44030502005645 ``` ### Logo and Slogan ```toml [params] logo = "/img/logo.png" slogan = "code my life ~" ``` ### Light and Dark Mode ```toml [params] style = "auto" # default: "auto", based on system. "light": light theme, "dark": dark theme. logo = "/img/logo.png" slogan = "code my life ~" ``` ### Navigation items ```toml [params.nav] showCategories = true # /categories/ showTags = true # /tags/ # custom items [[params.nav.custom]] title = "iOS" url = "/tags/ios" [[params.nav.custom]] title = "Hugo" url = "https://gohugo.io/" ``` ### Syntax highlighting ```toml # enable JS highlight [params.syntax] use = "hljs" # 1. prismjs 2. hljs 3. none theme = "dracula" darkTheme = "xcode-dark" # apply this theme in dark mode ``` ### Article share ```toml [params.share] enable = true addThisId = "ra-1234567890" inlineToolId = "" ``` ### Math ```toml [params.math] enable = true # true means globally, or on a per page set "math = true" use = "katex" # "mathjax" or "katex" ``` Example ``` When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ ``` ### Bilibili shortcodes ```html {{< bilibili BV1FV411d7u7>}} OR {{< bilibili id="BV1FV411d7u7">}} ``` ### Comments Setup Disqus [shortname](https://help.disqus.com/en/articles/1717111-what-s-a-shortname) in config.toml: ```toml # disqus disqusShortname = "XXX" # your short name [params.comments] enable = false # En/Disable comments globally, default: false. You can always enable comments on per page. ``` You can enable comments on per page: ```md +++ title = "..." date = 2019-12-08 ... comments = true +++ ... ``` ### Pagination Support large number of pages ![](https://raw.githubusercontent.com/cntrump/hugo-notepadium/master/images/03.png) ### Custom footer copyright layout Thanks [@Benjamin-Lee](https://github.com/Benjamin-Lee)'s good idea! Create an user-side partial: `copyright.html` ``` . └── layouts └── partials └── copyright.html ``` You can relayout copyright like this: ```html {{- $copyright := . -}}
{{- $copyright -}}
Powered by Hugo and the Notepadium