Skip to content
This repository has been archived by the owner on Aug 9, 2018. It is now read-only.

unwitting/gtca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

GTCA

The Ghost Theme Configuration Approach: a unified method to allow Ghost blog admins to configure your themes.

Ghost themes which support GTCA provide an easy-to-use method of configuring social profile links, commenting, analytics and more for blog admins. More than that, they are interopable: if an admin has configured their blog for one GTCA theme, it should work with another one with zero re-configuration.

Motivation

See the original blog post for the rationale behind this and a more in-depth discussion.

My theme supports GTCA!

You're a star. You should include something either in your theme or your theme's download page that tells people it's a GTCA theme. This helps popularise the standard and allows interested blog admins to find out more.

An easy way to do this is to use a shields.io badge: gtca button

[![gtca button](https://img.shields.io/badge/configured%20with-GTCA-brightgreen.svg)](https://github.com/unwitting/gtca)

The spec

Is simple. Your theme must meet a few requirements to be able to claim adherance to GTCA:

  • window.__themeCfg = {}; must exist somewhere in the code (or some functionally equivalent code that makes sure an empty __themeCfg object is assigned to the global scope).
  • The above initialisation must come strictly before {{ghost_head}}. This allows configuration via header code injection.
  • For any supported configuration property, document clearly to the user (either via their console logs, or in your theme help files) how to enable / set each one. This must assume little technical experience.
  • You mustn't make use of properties which aren't in the list below. Using non-standard properties fools your users into thinking they're getting more interoperability between themes than they really are. If you need properties that aren't on the list yet, please raise a PR and it'll almost certainly be added nice and easily.

GTCA configuration properties

Here's the current list of supportable GTCA properties. To get more added, raise a PR against this README! The point isn't for me to control the list, it's for there to be a list. Further social profiles, extra external integrations are all welcome. We just need to ensure that the configuration item/s allow for the full functionality to be achieved.

Social profiles

  • __themeCfg.bitbucketUsername
  • __themeCfg.deviantartUsername
  • __themeCfg.facebookUsername
  • __themeCfg.flickrUsername
  • __themeCfg.githubUsername
  • __themeCfg.instagramUsername
  • __themeCfg.linkedinUsername
  • __themeCfg.pinterestUsername
  • __themeCfg.soundcloudUsername
  • __themeCfg.twitchUsername
  • __themeCfg.twitterUsername
  • __themeCfg.vimeoUsername
  • __themeCfg.youtubeUsername

Analytics

  • __themeCfg.googleAnalyticsId

Commenting

  • __themeCfg.disqusUsername

Publishing

  • __themeCfg.alternateSubscribeLink - defines an alternative to the built-in RSS link (ex: Feedburner feed)

About

The Ghost Theme Configuration Approach: a unified method to allow Ghost blog admins to configure your themes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published