Skip to content

fisodd/hugo-restructured

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hugo Restructured

A theme for Hugo that takes advantage of reStructuredText as the input markup.

See the live demo.

Features

  • Responsive page layout (scales from 300 to 1300 pixels wide)
  • Supports reStructuredText markup features

Including

Also

  • Pages begin with a splash of color with support for hero images or background gradients

All of these features and more are demonstrated in the live demo.

Screenshot

Installation

Installation is much like any other Hugo theme.

Prerequisites

Obviously you'll need a working Hugo environment.

In addition, to handle the reStructuredText you'll need Docutils (which relies on Pygments for the colored syntax highlighting in code displays). Both of these are readily available through the usual Python methods (e.g. "pip install docutils").

Getting started

Inside the folder of your Hugo site run:

$ cd themes
$ git clone https://github.com/fisodd/hugo-restructured.git

For more information read install and use themes or begin with Hugo's get started help page.

The config file

Inside the exampleSite folder of this theme, there is a file called config.toml. Use this configuration as an example, and modify to suit your needs.

Create your content as ReST files

Hugo recognizes files ending with a ".rst" suffix as reStructuredText and will call out to the docutils python package to process these files.

example:

$ hugo new content/post/first-post.rst

To learn more about reStructuredText markup, start with a reStructuredText Primer.

Change the hero background

The top part of each page has an area of color or potentially an image. For any page or post you can specify a hero image for this area by including the local path in front matter (see content in the exampleSite folder for examples): hero_image: '/images/gohugo-default-sample-hero-image.jpg'

An image is not required. The hero background can also be configured by the 'hero_shade' setting. The 'hero_shade' setting in the front matter can take a full CSS background definition, and can be used to set any HTML color, or even use a gradient instead by specifying a linear gradient.

example: hero_shade = "background: linear_gradient(to right, blue, pink);"

See the results

In order to see your site in action, run Hugo's built-in local server.

$ hugo server

Now enter localhost:1313 in the address bar of your browser.

License

This theme is released under the MIT License.

The specifics can be found within the License

Recognition

The author learned most of what he has learned about Hugo themes by studying the excellent example of the Ananke theme. I am very grateful for the clean implementation and the helpful comments.

Also, many, many thanks to all the folks who make Hugo rock.

See Also

About

Theme for Hugo based on reStructuredText

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published