Git Product home page Git Product logo

hugo-social-metadata's Introduction

hugo-social-metadata

About

This is a Hugo theme component that automatically generates metadata complying to The Open Graph Protocol as well as Twitter Cards. This is NOT a standalone theme and must not be treated as such.

Usage

  1. Add the hugo-social-metadata repository as a submodule to be able to get upstream changes later git submodule add https://github.com/msfjarvis/hugo-social-metadata.git themes/hugo-social-metadata

  2. Start off by configuring a few things in your config.toml (or equivalent file depending on whether you use YAML or JSON). These will be picked up by the theme component and used to provide metadata for the site.

[params]
  description = "A description for your awesome website goes here"
  keywords = "some, keywords, that, describe, your, content"
  twitterUsername = "@your_twitter_username"
  socialImage = "path/to/the/twitter/card/image"
  1. Include the hugo-social-metadata theme as the leftmost element of the theme list variable in your config file. For config.toml, it will look something like this:
theme = ["hugo-social-metadata", "hyde"]
  1. Include the social_metadata.html partial in your head.html like so: {{ partial "social_metadata.html" . }}.

Additional customizations

You can customize some of the generated metadata on a per-page basis. Setting description, socialImage or tags in the frontmatter will override the defaults loaded from the main config file.

+++
description = "A nice description for this blogpost"
socialImage = "path/to/an/image/that/describes/this/post/best"
tags = ["this", "blog", "rocks!"]
+++

License

Check out the LICENSE file in the root of this repository.

hugo-social-metadata's People

Contributors

msfjarvis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

professorlogout

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.