Structured Data 3.0 #6534

Closed
JohnONolan opened this Issue Feb 18, 2016 · 8 comments

Projects

None yet

4 participants

@JohnONolan
Member
JohnONolan commented Feb 18, 2016 edited

Those of you who know me, know I'm all about that bass structured data. We've got pretty awesome support for it already, via iteration 1.0 #3900 and 2.0 #4677 - and now I'd like to propose a few more enhancements, which I think should be relatively straightforward. Might be something for @AileenCGN?

I noticed this on Facebook this morning, and thought it was pretty cool. Also this by Slack a while back, which is equally cool.

So a bunch of things that I think we could potentially do to be more mobile, social, global and local.

Or, as I call it: Mosoglocal ๐Ÿ’ƒ

Publisher and Site

Add a general setting to blogs for "Facebook URL" and "Twitter URL" - which we should validate, and then we could output:

<meta property="article:publisher" content="https://www.facebook.com/page" />
<meta name="twitter:site" content="@user"/>

Applies to ALL page templates

NB: According to docs twitter:site is actually required for Twitter Cards to work at all.

This would also justify the creation of new theme helpers, probably {{@blog.facebook}} and {{@blog.twitter}} ?

Author and Creator

Add a user setting for "Facebook URL" and "Twitter URL" - which we should validate, and then we could output the bits from my screenshot before:

<meta property="article:author" content="https://www.facebook.com/user" />
<meta name="twitter:creator" content="@user"/>
<script type="application/ld+json">
{
    "author": {
        "sameAs" : [
            "http://user-website.com",
            "https://www.facebook.com/your-profile",
            "https://twitter.com/your_profile"
        ]
    }
}
</script>

"Why add Facebook and Twitter profile properties? Isn't that clutter?" - kind of, but I think it's safe to say they would be widely used, and we already have support for Facebook Open Graph and Twitter Cards, so it makes sense. Longer term I'd be interested if we could make admin defined user profile properties like Slack recently did?

Applies to post, page, and author profile templates

Note: For rich data, deliberate use of www in facebook URLs output and no www in twitter URLs output. That's how both of those sites work - so minimal redirects by just using their preferred structure right off the bat.

JSON+LD docs ref here.

This would also justify the creation of new theme helpers, probably {{author.facebook}} and {{author.twitter}} ?

Slack Unfurls

This would add some rich data to Slack embeds. Source. Not sure if this is valid, because it's essentially a duplication of other properties (author and date) -- but seeing as every service except Slack is going to ignore it... do we care?

<meta name="twitter:label1" value="Written by" />
<meta name="twitter:data1" value="User Fullname" />
<meta name="twitter:label2" value="Published" />
<meta name="twitter:data2" value="January 1st, 2016" />

Applies to post and page templates

Locale

<html lang="en-US">`
<meta property="og:locale" content="en_US" />

It would be great to add a blog language general setting and output this both via Open Graph and via a {{locale}} helper available for themes, and to affect the format of {{date}} - this one probably warrants its own issue.

Applies to ALL page templates

Bug in Description

Just noticed we seem to be outputting empty descriptions. We should either populate description with ~50 chars of {{excerpt}} or not display the description tags at all. I thought this was specced in an older issue, but can't seem to find it now. I wonder if this is what's causing the current bug of Slack refusing to unfurl any Ghost blog post? Eg.

<meta property="og:title" content="Moving to Singapore"/>
<meta property="og:description" content=""/>
...
<meta name="twitter:description" content=""/>

Just confirmed this bug is actively preventing twitter cards from working.

Tasks:

  • Fix twitter/facebook description bug
  • Publisher and site support
  • Author and creator support
  • Slack unfurls
  • Raise issue for locale support (@ErisDS)
  • Improve test quality for ghost_head/meta data
  • Add structured data to pages, as well as posts
@ErisDS ErisDS referenced this issue Feb 18, 2016
Closed

Database schema & fixtures migration v005 #6301

14 of 20 tasks complete
@ErisDS
Member
ErisDS commented Feb 18, 2016

I've quoted bits I have questions on or that were questions below...

Add a general setting to blogs for "Facebook URL" and "Twitter URL" - which we should validate
Add a user setting for "Facebook URL" and "Twitter URL" - which we should validate

Cool, so we need some new db fields (no biggy, I've added them to #6301) - I think it makes 100% sense to add these as they're so ubiquitous.

From a UI perspective, I think the user would expect to copy & paste a whole URL for facebook, but only put their @username in for twitter? Example below, but I'm thinking you may have lots of opinions about the way this should be done:

This would also justify the creation of new theme helpers, probably {{@blog.facebook}} and {{@blog.twitter}} ?

๐Ÿ‘

Locale [...] this one probably warrants its own issue.

Yep, for sure ๐Ÿ‘

Bug in Description [...] I thought this was specced in an older issue

Yep! It's here: #4424.

It was made very clear that we should not auto generate a meta description, as google does this. However, I think this same rule has been incorrectly applied to twitter and og descriptions. I guess the twitter & og ones should come from excerpt?

@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 18, 2016
@ErisDS ErisDS Fix facebook/twitter/schema description
refs #6534

- this is an initial fix for having no description at all unless a meta description is provided
- we may need to tweak the lengths / provide different lengths for different values in future
521793c
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 18, 2016
@ErisDS ErisDS Fix facebook/twitter/schema description
refs #6534

- this is an initial fix for having no description at all unless a meta description is provided
- we may need to tweak the lengths / provide different lengths for different values in future
24fd3c3
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 18, 2016
@ErisDS ErisDS Fix facebook/twitter/schema description
refs #6534

- this is an initial fix for having no description at all unless a meta description is provided
- we may need to tweak the lengths / provide different lengths for different values in future
d7b9eb6
@JohnONolan
Member

From a UI perspective, I think the user would expect to copy & paste a whole URL for facebook, but only put their @username in for twitter?

For v1 - let's just make them both URLs? It's so much easier to validate and the UX is consistent between the two, at least.

@AileenCGN
Member

Sounds exciting!

@nuclearpengy

This looks cool! :)

@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 20, 2016
@ErisDS ErisDS Metadata: fix published at bug & slack unfurl data
refs #6534

- fixes a bug where published_at was incorrectly falling back to the created_at date
- updated meta index to get author name
- add written by & published labels + data if the values are present (only on posts/pages)
- updated tests
d32c96b
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 20, 2016
@ErisDS ErisDS Strutured data: Slack Unfurls & published_at fix
refs #6534

- fixes a bug where published_at was incorrectly falling back to the created_at date
- updated meta index to get author name
- add written by & published labels + data if the values are present (only on posts/pages)
- updated tests
6780785
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 20, 2016
@ErisDS ErisDS Strutured data: Slack Unfurls & published_at fix
refs #6534

- fixes a bug where published_at was incorrectly falling back to the created_at date
- updated meta index to get author name
- add written by & published labels + data if the values are present (only on posts/pages)
- updated tests
8881030
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 21, 2016
@ErisDS ErisDS Strutured data: Slack Unfurls & published_at fix
refs #6534

- fixes a bug where published_at was incorrectly falling back to the created_at date
- updated meta index to get author name
- add written by & filed under labels + data if the values are present (only on posts/pages)
- updated tests
79ca39a
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Feb 22, 2016
@ErisDS ErisDS Strutured data: Slack Unfurls & published_at fix
refs #6534

- fixes a bug where published_at was incorrectly falling back to the created_at date
- updated meta index to get author name
- add written by & filed under labels + data if the values are present (only on posts/pages)
- updated tests
dcc8bcc
@JohnONolan
Member

Just noticed that for some reason we don't output structured data on page templates, which we probably should. Added to task list

@ErisDS
Member
ErisDS commented Feb 26, 2016

@JohnONolan what about the paginated versions of the home, tag, author channels? Atm we don't do it there either.

@JohnONolan
Member

I think that's still ok as-is ๐Ÿ‘๐Ÿป

@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue Mar 3, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- added both to default-settings.js
f2079de
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue Mar 4, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- added both to default-settings.js
- adding blog helpers for facebook and twittter
5cbd984
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue Mar 7, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- added both to default-settings.js
- adding blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
cd54b9f
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Mar 26, 2016
@ErisDS ErisDS Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
4a8cf11
@cobbspur cobbspur added a commit to cobbspur/Ghost that referenced this issue Mar 30, 2016
@cobbspur cobbspur Add structured data to static pages
refs #6534

- adds structured data on static pages
- selects post context object for static pages
- updates tests
4b5b9a1
@cobbspur cobbspur added a commit to cobbspur/Ghost that referenced this issue Mar 30, 2016
@cobbspur cobbspur Add structured data to static pages
refs #6534

- adds structured data on static pages
- selects post context object for static pages
- updates tests
5102637
@kevinansfield kevinansfield added a commit to kevinansfield/Ghost that referenced this issue Apr 5, 2016
@ErisDS @kevinansfield ErisDS + kevinansfield Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
14bd301
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 8, 2016
@ErisDS ErisDS Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
73e8280
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 10, 2016
@ErisDS ErisDS Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
c5b6e17
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 13, 2016
@ErisDS ErisDS Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
0fd5c18
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 14, 2016
@ErisDS ErisDS Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
0679a1c
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 14, 2016
@ErisDS ErisDS Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
739977a
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 2, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- added both to default-settings.js
- adding blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
89db595
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 2, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
cbc1d4f
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 2, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
d8c8e29
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 3, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
43041bf
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 3, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
5afc6a3
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 4, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
ef41ed8
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 4, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
issue #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
5d0fb62
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 4, 2016
@AileenCGN AileenCGN Structured Data Author and Creator
refs #6534
- adds 'facebook' and 'twitter' input fields in user settings
- adds validation for the urls
- adds acceptance test for facebook and twitter input fields
7f75d0a
@AileenCGN AileenCGN referenced this issue May 4, 2016
Merged

Structured Data 3.0 #6784

3 of 3 tasks complete
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 5, 2016
@AileenCGN AileenCGN Structured Data Author and Creator
closes #6534
- Changes on Client side:
	- adds 'facebook' and 'twitter' input fields in user settings
	- adds validation for the urls
	- adds acceptance test for facebook and twitter input fields
- Changes on Server side:
	- adds `authorFacebook` and `creatorTwitter` to `metaData`, `getAuthorFacebook` and `getCreatorTwitter` will get the values
	- adds `article:author` and `twitter:creator` to `structured_data`
	- adds Facebook and Twitter URL to `sameAs`-property in JSON+LD schema data
	- adds/updates unit tests for: `schema_spec`, `structured_data_spec`, `ghost_head_spec`, `author_fb_url_spec` and `creator_url_spec`
9d440fc
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 5, 2016
@AileenCGN AileenCGN Facebook and Twitter input fields in gen. settings
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
ef6fd1d
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 5, 2016
@AileenCGN AileenCGN Structured Data Author and Creator
closes #6534
- Changes on Client side:
	- adds 'facebook' and 'twitter' input fields in user settings
	- adds validation for the urls
	- adds acceptance test for facebook and twitter input fields
- Changes on Server side:
	- adds `authorFacebook` and `creatorTwitter` to `metaData`, `getAuthorFacebook` and `getCreatorTwitter` will get the values
	- adds `article:author` and `twitter:creator` to `structured_data`
	- adds Facebook and Twitter URL to `sameAs`-property in JSON+LD schema data
	- adds/updates unit tests for: `schema_spec`, `structured_data_spec`, `ghost_head_spec`, `author_fb_url_spec` and `creator_url_spec`
aaf9ee6
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 8, 2016
@AileenCGN AileenCGN Structured Data 3.0
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
70bae94
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 8, 2016
@AileenCGN AileenCGN Structured Data 3.0
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
bf9aae8
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 8, 2016
@AileenCGN AileenCGN Structured Data 3.0
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
78e1397
@AileenCGN AileenCGN added a commit to AileenCGN/Ghost that referenced this issue May 8, 2016
@AileenCGN AileenCGN Structured Data 3.0
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
b7bd6d9
@ErisDS ErisDS closed this in #6784 May 8, 2016
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue May 13, 2016
@ErisDS ErisDS Fix errors in JSON-LD output
refs #6534

- don't output publisher for the 'People' type on the author page
- change publisher to a full 'Organisation' for the 'Article' type on posts

Note:
Google's structured data validator also wants image & publisher.logo inside of Article to be full 'ImageObject's.
Currently, it output's an error for them: 'The attribute itemtype has an invalid value.'
However, the spec on Schema.org says a url is valid: https://schema.org/Article,
which is slightly different to Google's spec here: https://developers.google.com/structured-data/rich-snippets/articles#article_markup_properties

Ideally, we would output a full 'ImageObject', however we don't currently have the width & height info required.
Therefore, I think what we have is valid strictly speaking, but we should aim to fix this when we have better image tools.
a90565f
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue May 13, 2016
@ErisDS ErisDS Fix errors in JSON-LD output
refs #6534

- don't output publisher for the 'People' type on the author page
- change publisher to a full 'Organisation' for the 'Article' type on posts

Note:
Google's structured data validator also wants image & publisher.logo inside of Article to be full 'ImageObject's.
Currently, it output's an error for them: 'The attribute itemtype has an invalid value.'
However, the spec on Schema.org says a url is valid: https://schema.org/Article,
which is slightly different to Google's spec here: https://developers.google.com/structured-data/rich-snippets/articles#article_markup_properties

Ideally, we would output a full 'ImageObject', however we don't currently have the width & height info required.
Therefore, I think what we have is valid strictly speaking, but we should aim to fix this when we have better image tools.
1ec5943
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue May 13, 2016
@ErisDS ErisDS Fix errors in JSON-LD output
refs #6534

- don't output publisher for the 'People' type on the author page
- change publisher to a full 'Organisation' for the 'Article' type on posts

Note:
Google's structured data validator also wants image & publisher.logo inside of Article to be full 'ImageObject's.
Currently, it output's an error for them: 'The attribute itemtype has an invalid value.'
However, the spec on Schema.org says a url is valid: https://schema.org/Article,
which is slightly different to Google's spec here: https://developers.google.com/structured-data/rich-snippets/articles#article_markup_properties

Ideally, we would output a full 'ImageObject', however we don't currently have the width & height info required.
Therefore, I think what we have is valid strictly speaking, but we should aim to fix this when we have better image tools.
c4d3bd7
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue May 17, 2016
@ErisDS ErisDS Update structured data for fb & twitter usernames
refs #6534

- twitter & facebook fields are changing to store usernames only
- use the new social url util to generate urls where necessary
- update tests
84826e9
@ErisDS
Member
ErisDS commented May 17, 2016

Adding a note here to summarise some conversations that happened in #dev and some changes that are now being made.

For both the blog & user settings, we will only be storing the "username" part of the facebook & twitter urls. These are the unique information, whereas the remainder of the URL is the same for everyone and very simple to provide helpers for if needs be.

Therefore, when accessing {{@blog.twitter}} or {{author.twitter}} in a theme, or fetching a user's "twitter" column via the API, you'll get "@tryghost" for example.

The structured data will be updated to generate the URLs from the usernames, using a new set of utilities. To make it nice and easy for themes to output the full url, we'll be adding two new helpers: {{twitter_url}} and {{facebook_url}} which will default to outputting the twitter/facebook URL of the current context using the same utility as the structured data, E.g. you might output an author's twitter URL like this:

{{#author}}
{{#if twitter}}<a href="{{twitter_url}}">{{twitter}}</a>{{/if}}
{{/author}}

If you're not inside an "author" or "user" object, then the helper will default to the blog's twitter URL.

If the default behaviour is not what you want, then you can tell it exactly what to output the url for, E.g. {{twitter_url @blog.twitter}} or even {{twitter_url "SoVeryBritish"}}.

The {{twitter_url}} helper will handle removing the @ from the front of a username if one is present, to create the canonical version of a twitter URL (although both are valid).

The facebook version of the helper will be exactly the same, except it will output correct facebook urls, which include the www. and has extra handling to ensure that it works regardless of whether there's a slash at the start of the username, as facebook page names can include slashes.

@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue May 17, 2016
@ErisDS ErisDS Add helpers for facebook & twitter urls
refs #6534

- this PR assumes that we are now saving usernames only in the database for twitter & facebook
- adds a new social links utility which can generate twitter & facebook urls from the username
- adds a {{twitter_url}} and {{facebook_url}} helper which uses these
- adds a full suite of tests for the helpers & utils
e96b60b
@ErisDS ErisDS added a commit to ErisDS/Ghost that referenced this issue May 17, 2016
@ErisDS ErisDS Update structured data for fb & twitter usernames
refs #6534

- twitter & facebook fields are changing to store usernames only
- use the new social url util to generate urls where necessary
- update tests
29c9e8b
@kirrg001 kirrg001 added a commit to kirrg001/Ghost that referenced this issue May 18, 2016
@ErisDS @kirrg001 ErisDS + kirrg001 Add helpers for facebook & twitter urls
refs #6534

- this PR assumes that we are now saving usernames only in the database for twitter & facebook
- adds a new social links utility which can generate twitter & facebook urls from the username
- adds a {{twitter_url}} and {{facebook_url}} helper which uses these
- adds a full suite of tests for the helpers & utils
ae8f7fa
@kirrg001 kirrg001 added a commit to kirrg001/Ghost that referenced this issue May 18, 2016
@ErisDS @kirrg001 ErisDS + kirrg001 Update structured data for fb & twitter usernames
refs #6534

- twitter & facebook fields are changing to store usernames only
- use the new social url util to generate urls where necessary
- update tests
58b0405
@kirrg001 kirrg001 added a commit to kirrg001/Ghost that referenced this issue May 18, 2016
@ErisDS @kirrg001 ErisDS + kirrg001 Add helpers for facebook & twitter urls
refs #6534

- this PR assumes that we are now saving usernames only in the database for twitter & facebook
- adds a new social links utility which can generate twitter & facebook urls from the username
- adds a {{twitter_url}} and {{facebook_url}} helper which uses these
- adds a full suite of tests for the helpers & utils
4108ac3
@kirrg001 kirrg001 added a commit to kirrg001/Ghost that referenced this issue May 18, 2016
@ErisDS @kirrg001 ErisDS + kirrg001 Update structured data for fb & twitter usernames
refs #6534

- twitter & facebook fields are changing to store usernames only
- use the new social url util to generate urls where necessary
- update tests
089166d
@kirrg001 kirrg001 added a commit to kirrg001/Ghost that referenced this issue May 19, 2016
@ErisDS @kirrg001 ErisDS + kirrg001 Add helpers for facebook & twitter urls
refs #6534

- this PR assumes that we are now saving usernames only in the database for twitter & facebook
- adds a new social links utility which can generate twitter & facebook urls from the username
- adds a {{twitter_url}} and {{facebook_url}} helper which uses these
- adds a full suite of tests for the helpers & utils
2d7653c
@kirrg001 kirrg001 added a commit to kirrg001/Ghost that referenced this issue May 19, 2016
@ErisDS @kirrg001 ErisDS + kirrg001 Update structured data for fb & twitter usernames
refs #6534

- twitter & facebook fields are changing to store usernames only
- use the new social url util to generate urls where necessary
- update tests
f99bef8
@madfrog2047 madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016
@ErisDS @madfrog2047 ErisDS + madfrog2047 Add social media columns to users
refs #6301, #6534

- adds facebook and twitter columns, which should contain urls
bafa6f3
@madfrog2047 madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016
@AileenCGN @madfrog2047 AileenCGN + madfrog2047 Structured Data 3.0
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
145d25a
@madfrog2047 madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016
@ErisDS @madfrog2047 ErisDS + madfrog2047 Fix errors in JSON-LD output
refs #6534

- don't output publisher for the 'People' type on the author page
- change publisher to a full 'Organisation' for the 'Article' type on posts

Note:
Google's structured data validator also wants image & publisher.logo inside of Article to be full 'ImageObject's.
Currently, it output's an error for them: 'The attribute itemtype has an invalid value.'
However, the spec on Schema.org says a url is valid: https://schema.org/Article,
which is slightly different to Google's spec here: https://developers.google.com/structured-data/rich-snippets/articles#article_markup_properties

Ideally, we would output a full 'ImageObject', however we don't currently have the width & height info required.
Therefore, I think what we have is valid strictly speaking, but we should aim to fix this when we have better image tools.
7c77eb7
@madfrog2047 madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016
@ErisDS @madfrog2047 ErisDS + madfrog2047 Add helpers for facebook & twitter urls
refs #6534

- this PR assumes that we are now saving usernames only in the database for twitter & facebook
- adds a new social links utility which can generate twitter & facebook urls from the username
- adds a {{twitter_url}} and {{facebook_url}} helper which uses these
- adds a full suite of tests for the helpers & utils
65d42ba
@madfrog2047 madfrog2047 added a commit to madfrog2047/Ghost that referenced this issue Nov 20, 2016
@ErisDS @madfrog2047 ErisDS + madfrog2047 Update structured data for fb & twitter usernames
refs #6534

- twitter & facebook fields are changing to store usernames only
- use the new social url util to generate urls where necessary
- update tests
616909e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment