- CSS 47.2%
- HTML 44.4%
- JavaScript 8.4%
Use block templates [1] for all of the full-page templates such as index.html, _default/list.html, etc. This reduces code duplicated between them. Also, move the code in partials/page.html and partials/post.html to page/single.html and post/single.html respectively. With block templates the contents of the partials is almost exactly the same as the contents of the single page templates, and having dedicated single-page templates for the content types means that we can get rid of the if/then/else logic in _default/single.html. This also gets rid of an excess container div; the duplication of the divs was being obscured by the way _default/single.html was interacting with the partials. (This is the same duplicated div as in pull request #51 found by @1138-4EB.) [1] https://gohugo.io/templates/blocks/ |
||
|---|---|---|
| archetypes | ||
| data/beautifulhugo | ||
| exampleSite | ||
| i18n | ||
| images | ||
| layouts | ||
| static | ||
| .gitattributes | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| theme.toml | ||
Beautiful Hugo - A port of Beautiful Jekyll Theme
Installation
$ mkdir themes
$ cd themes
$ git clone https://github.com/halogenica/beautifulhugo.git beautifulhugo
See the Hugo documentation for more information.
Extra Features
Responsive
This theme is designed to look great on both large-screen and small-screen (mobile) devices.
Syntax highlighting
This theme has support for both server side and client side highlighting.
Server side syntax highlighting
Use the highlight shortcode (with Pygments),
see the Hugo documentation for more information.
To use this feature install Pygments (pip install Pygments) and add pygmentsuseclasses = true to your config.toml.
Client side syntax highlighting
Use triple backticks ( ``` ) or triple tilde ( ~~~ ) around code blocks.
Client side highlighting does not require pygments to be installed.
Disqus support
To use this feature, uncomment and fill out the disqusShortname parameter in config.toml.
Google Analytics
To add Google Analytics, simply sign up to Google Analytics to obtain your Google Tracking ID, and add this tracking ID to the googleAnalytics parameter in config.toml.
Commit SHA on the footer
If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two environment variables have to be set (GIT_COMMIT_SHA and GIT_COMMIT_SHA_SHORT) and parameter commit has to be defined in the config file:
[Params]
commit = "https://github.com/<username>/<siterepo>/tree/"
This can be achieved by running the next command prior to calling Hugo:
GIT_COMMIT_SHA=`git rev-parse --verify HEAD` GIT_COMMIT_SHA_SHORT=`git rev-parse --short HEAD`
See at xor-gate/xor-gate.org an example of how to add it to a continuous integration system.
About
This is a port of the Jekyll theme Beautiful Jekyll by Dean Attali. It supports most of the features of the original theme.
License
MIT Licensed, see LICENSE.
