Git Product home page Git Product logo

tophat-theme's Introduction

Top Hat

Top Hat it's a simple Hugo theme just for blogging.

screenshot

Live view

My own blog nohat.dev uses this theme

Features

It supports:

  • syntax hightlight
  • featured posts
  • navigation
  • tags
  • words count and time reading

How to install

You can use the theme in by two flavors, downloading files from repository or using git submodule

Download files from repository

Download .zip file from this link and extract the content to themes/tophat folder

Then open your hugo.toml file and add the following tag:

theme = "tophat"

Use git submodule

Run these commands to create a Hugo site with the tophat theme

hugo new site my-blog
cd my-blog
git init
git submodule add https://github.com/sergiobarriel/tophat-theme.git themes/tophat
echo "theme = 'tophat'" >> hugo.toml
hugo server

If you want to update the theme with the latest changes just run the command

git submodule update --remote

How to configure the theme

Options

You should configure minimal options on your hugo.toml file:

theme = "TopHat"
title = "Your blog name"
baseURL = "https://example.com/"
languageCode = "en-us"
paginate = 5

The default pagination is 10 items, but you can set a different number.

Parameters

[params]
    
  subtitle = "Your blog subtitle"
  description = "Your blog description"
  author = "Sergio Barriel"

  main = "post"
  featured = true
  
  # You can customize the visibility of some elements like date, reading time, words counter and tags inside article by setting true or false
  show_date_on_article = true
  show_reading_time_on_article = true
  show_words_count_on_article = true
  show_tags_on_article = true  

Menus

[menu]

  [[menu.main]]
    identifier = "about"
    name = "About"
    url = "/pages/about/"

  [[menu.main]]
    identifier = "contact"
    name = "Contact"
    url = "/pages/contact/"    
  
  [[menu.social]]
    identifier = "twitter"
    name = "Twitter"
    url = "https://twitter.com/sergiobarriel" 

  [[menu.social]]
    identifier = "github"
    name = "Github"
    url = "https://github.com/sergiobarriel"

Google Analytics

If you want to track telemetry from Google Analytics just add the googleAnalytics tag on your hugo.toml file

googleAnalytics = "G-XXXXXXXXXX"

Syntax highlight

You can customize the highlight configuration by overriding options on hugo.toml file according to these params

[markup]
  [markup.highlight]
    anchorLineNos = false
    codeFences = true
    guessSyntax = false
    hl_Lines = ''
    hl_inline = false
    lineAnchors = ''
    lineNoStart = 1
    lineNos = false
    lineNumbersInTable = true
    noClasses = true
    noHl = false
    style = 'dracula'
    tabWidth = 4

See the Style Gallery for a full overview of available styles and how they may appear.

Customize styles

There are some scss files inside assets/scss folder, so you can customize the styles as you wish and then transpile by using sass command

sass styles.scss ../css/styles.css

Sponsor

If you like the project, you can consider making a donation at ko-fi.com

Contributors / Collaborators

These individuals have contributed to the repository through suggestions, error corrections, or by opening issues. Thanks 😊

Support

You can contact me via Twitter @sergiobarriel, or if you have an issue, you can open one 🙂

tophat-theme's People

Contributors

sergiobarriel avatar

Stargazers

 avatar Iván Garrido avatar Christian avatar  avatar AlexQin avatar xsinger avatar iqbwl avatar Loch avatar  avatar

Watchers

 avatar  avatar

tophat-theme's Issues

add rss feed

I don't know if you forgot or there is a reason this file was left blank?

in /layouts/partials/head.html add:

{{ with .OutputFormats.Get "rss" -}}
  {{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}

This create an example.com/index.xml so people can subscribe to your blog with their favorite rss clients.

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.