Code Monkey home page Code Monkey logo

hugo-type-theme's Introduction

Type

A free and open-source Jekyll Hugo theme. Great for blogs and easy to customize. This theme is a port of the original Type theme made by Rohan Chandra. Noteworthy features of this Hugo theme are the integration of a comment-system powered by Disqus, Google Analytics and localization (l10n) support.

Get the theme

I assume you've Git installed. Inside the folder of your Hugo site run

$ cd themes
$ git clone https://github.com/digitalcraftsman/hugo-type-theme.git

You should see a folder called hugo-type-theme inside the themes directory that we created a few moments ago. For more information read the official setup guide of Hugo.

Setup

Next, navigate to the exampleSite folder at themes/hugo-type-theme/exampleSite/. In order to get your site running, you need to copy config.toml and all the content of all relevant subfolders such as data/l10n.toml into the root folders.

To turn the exampleSite folder in a standalone demo site the themesDir property has been set to ../... This way you can preview this theme by running hugo server inside exampleSite folder.

Due to the customized themesDir path Hugo will fail to find themes if you copied the config.toml into the root directory of a regular Hugo website. Make sure you comment out the themesDir property if you use the theme in production.

The config file

Now, let us take a look into the config.toml. Feel free to play around with the settings.

Comments

The optional comment system is powered by Disqus. Enter your shortname to enable the comment section under your posts.

disqusShortname = ""

With the disableComments frontmatter parameter you can disable the comment section for each page individually.

Google Analytics

The same applies to the activation of Google Analytics. Enable it by entering the tracking code for your website.

googleAnalytics = ""

Menu links

You can define menu entries as you like by linking a post or any other site. First, let us link a post that you've written. We can do this in the frontmatter of the post's content file by setting menu to nav. That's it.

+++
menu = "nav"
+++

Localization (l10n)

You don't blog in English and you want to translate the theme into your native locale? No problem. Take a look in the data folder and you'll find a file l10n.toml that we've copied at the beginning. It contains all strings related to the theme. Just replace the original strings with your own.

Linking thumbnails

After creating a new post you can define a thumbnail by entering the relative path to the image in the frontmatter of the post:

+++
featureimage = "img/sample_feature_img.png"
+++

This way you can store them either next to the content file or in the static folder.

About page

If you want to tell your audience who you are create a new file called index.md under content/about. For an example look at exampleSite/content/about/index.md inside the theme folder.

Nearly finished

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.

Contributing

Have you found a bug or got an idea for a new feature? Feel free to use the issue tracker to let me know. Or make directly a pull request.

Please create a separate branch for each pull request

License

This theme is released under the MIT license. For more information read the license.

Acknowledgements

Thanks to

hugo-type-theme's People

Contributors

andy4thehuynh avatar andygrunwald avatar d2s avatar digitalcraftsman avatar keyphact avatar kgoralski avatar lou1306 avatar nedpals avatar ninpl avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.