Coder Social home page Coder Social logo

hugo-theme-casper's Introduction

CASPER theme for hugo

Casper is a single-column theme for Hugo. Ported from Casper theme for Ghost

blog demo : http://vjeantet.fr blog source : https://github.com/vjeantet/vjeantet.fr

Hugo Casper Theme screenshot

Features

  • Google Analytics (optional)
  • Disqus ( can disable comments by content)
  • Share buttons on Facebook, Twitter, Google (can disable share by content)
  • Big cover image (optional)
  • Custom cover by content (optional)
  • Tagging
  • Pagination
  • Menu
  • Syntax Highlighting

Theme usage and asumptions

  • All blog posts are in the post folder (content/post)
  • The homepage displays a paginated list of contents from the post Section (other contents may be added to main menu, see bellow)

Installation

Installing this theme

mkdir themes
cd themes
git clone https://github.com/vjeantet/hugo-theme-casper casper

Build your website with this theme

hugo server -t casper

Configuration

config.toml

BaseUrl= "http://example.com/"
LanguageCode= "fr-FR"
Title= "My blog is awesome"
paginate = 5
DisqusShortname = "YOUR_SHORT_NAME_HERE"
Copyright = "All rights reserved - 2015"
canonifyurls = true

[params]
  description = "Welcome to my website"
  metadescription = "Used as 'description' meta tag for both home and index pages. If not set, 'description' will be used instead"
  cover = "images/cover.jpg"
  author = "Valère JEANTET"
  authorlocation = "Paris, France"
  authorwebsite = "http://vjeantet.fr"
  authorbio= "my bio"
  logo = "images/logo.png"
  googleAnalyticsUserID = "UA-79101-12"
  # Optional RSS-Link, if not provided it defaults to the standard index.xml
  RSSLink = "http://feeds.feedburner.com/..."
  githubName = "vjeantet"
  twitterName = "vjeantet"
  # facebookName = ""
  # codepenName = ""
  # linkedinName = ""
  # set true if you are not proud of using Hugo (true will hide the footer note "Proudly published with HUGO.....")
  hideHUGOSupport = false
  
  # Setting a value will load highlight.js and enable syntax highlighting using the style selected.
  # See https://github.com/isagalaev/highlight.js/tree/master/src/styles for available styles
  # A preview of above styles can be viewed at https://highlightjs.org/static/demo/
  hjsStyle = "default"

  [params.social]
    twitter = "your_twitter"

Example : config.toml

Overide author information per page

In addition to providing data for a single author as shown in the example above, author can be overided per page. If a author key in page's frontmatter exists it will be used instead of the default one. Overrides per page can be done by adding author* = "value entry in the front matter. For those pages where you want to omit the author block completely, a .Params.noauthor entry is also available.

Example override author per page file:

+++
date = "2014-07-11T10:54:24+02:00"
title = ""
author = "NickName"
authoravatar = "https://cdn4.iconfinder.com/data/icons/gray-user-management/512/rounded-512.png"
authorbio = "IT software and Security Engineer, Open source enthusiast."
authorlocation = "Paris, France"
authorwebsite = "http://vjeantet.fr"
...
+++

Contents here

Menu configuration

On top right of the screen, a "Subscribe" button is displayed with a link to the RSS feed.

When you define a menu in the main config file, Then a menu button is displayed instead of the subscribe button When the use clicks the menu button, a sidebar appears and shows the subscribe button and all items defined in the main config file

ℹ️ If your added a metadata like menu="main" in a content file metadata, it will also be displayed in the main menu

Example of a menu definition in main config file.

[[menu.main]]
  name = "My Blog"
  weight = -120
  identifier = "blog"
  url = "/"

[[menu.main]]
  name = "About me"
  weight = -110
  identifier = "about"
  url = "/about"

Metadata on each content file, example

+++
author = ""
date = "2014-07-11T10:54:24+02:00"
draft = false
title = "dotScale 2014 as a sketch"
slug = "dotscale-2014-as-a-sketch"
tags = ["event","dotScale","sketchnote"]
image = "images/2014/Jul/titledotscale.png"
comments = true     # set false to hide Disqus comments
share = true        # set false to share buttons
menu = ""           # set "main" to add this content to the main menu
+++

Contents here

Contact me

🪲 open an issue in github

🐦 https://twitter.com/vjeantet

hugo-theme-casper's People

Contributors

aldarone avatar bep avatar bguiz avatar bkbooth avatar bkono avatar caffeineflo avatar chothia avatar derektamsen avatar florian-zeidler avatar fonglh avatar gtoptsid avatar gvangool avatar hholi avatar icenan2 avatar indragunawan avatar james-bowman avatar joelbeckham avatar jramnani avatar jukper avatar kfei avatar maiki avatar miketheman avatar negimic avatar nicolaiarocci avatar seppestas avatar surfacescan avatar theanalyst avatar uzyexe avatar vjeantet avatar zenithar 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.