GitXplorerGitXplorer
t

TwitterCards

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
1eb5aade14751158a1daab7705cb2374327edb10

Fixing issue where length was now shorter after stripped of HTML tags, resulting in index out of range exception

ttimheuer committed 11 years ago
Unverified
b2177562ca8f30e89a7f72e1c14227c533c535c2

added license

ttimheuer committed 11 years ago
Unverified
b925585d1ccc3163bd39bc8978fe05c724a2169b

Quick readme modification

ttimheuer committed 11 years ago
Unverified
6b523e5c12c7c58a82cbc69fa75c011cf692744a

Initial commit

ttimheuer committed 11 years ago

README

The README file for this repository.

Twitter Cards for Subtext

This is a quick and dirty implementation for adding Twitter Summary Cards support to your Subtext blog site.

I've only tested this on Subtext 2.5.2

See this post for more details: http://timheuer.com/blog/archive/2013/11/03/adding-twitter-summary-cards-to-blog-content.aspx

Installation

  • Build this project. Please note this requires references to Subtext.Web and Subtext.Framework which aren't included in this project and is assumed you know how to get those.

  • Take the output TwitterCards.dll and put it in your /bin directory of your Subtext 2.5.2 installation

  • In your web.config in the pages\controls section add:

    <add tagPrefix="twitterCards" namespace="TwitterCards" assembly="TwitterCards" />

  • In your DTP.aspx file (I put this after the MetaTagsControl) add:

    <twitterCards:TwitterSummaryCard id="twitterSummaryCard" runat="server" />

  • In Subtext Admin console go to META tags and add the following (recommended):

    • name=twitter:card, content=summary
    • name=twitter:site, content=@yourtwittername
    • name=twitter:creator, content=@yourtwittername
    • name=twitter:domain, content=http://yourdomain
    • name=twitter:image, content=full url to your logo

What it does

This adds two META tags to your site, twitter:title, twitter:description. On a non-post page it uses your blog name as title and blog subtitle as description, so be sure to update those correctly.

On a post page it uses the Entry.Title as title and the first 180 characters of Entry.Body as description. If your Entry has a description it will use that first. All HTML tags are stripped out for the META tag.

Future

Ideally once Subtext support moves to ASP.NET 4 and stabilize I think I'll add a pull request to this control into the new model (not as-is but more integrated with Subtext model).

Questions

Contact Tim Heuer (@timheuer) http://timheuer.com/blog