Configure Octopress to support Google Authorship via link tag
Asked Answered
C

2

6

I would like to configure my Octopress blog to add an author link in the head element of all pages so that my Google+ picture will show up next to search results for my blog posts. Currently, I believe I could include a

<link rel="author" href="url/to/google/plus/profile">

in each post, but this gets tedious. Since every article on my blog is written by me, I would like the link above to just show up in the header of every Octopress page of my blog. Then on Google+ I can just list my blog as a site I contribute to, rather than listing that I contribute to each individual article.

I'm new to Google Authorship so maybe what I'm trying to do is not the best approach. My overall goal is simply to get my Google plus photo to appear next to all my Octopress blog articles in Google Search results and on Google+, list only my blog as a site I contribute to (not each individual article).

Confine answered 17/7, 2012 at 20:20 Comment(0)
C
17

I learned that the Octopress built-in Google+ 3rd party plugin http://octopress.org/docs/configuring/#third_party supports establishing authorship and is probably the intended way for Octopress bloggers to add the desired functionality.

To use it you can change the Google+ section around line 80 in the _config.yml file:

# Google Plus Profile
# Hidden: No visible button, just add author information to search results
googleplus_user: 111234567439674839635
googleplus_hidden: false

replacing the user number with your own, which you can find by going to your Google+ profile and copying the number in the address bar. Then, as long as you have added the URL of your Octopress blog to your "Contributor To" section on your Google+ profile page, your profile image should show up next to search results for your blog articles.

I had erroniously set my googleplus_user url to be the full URL of my Google plus account without realizing it, so authorship was not working. Thus, I sought to manually add the <link> tag in my original question.

Confine answered 2/8, 2012 at 1:6 Comment(0)
P
1

You'll want to update the head.html template (provided in the octopress theme) file with your authorship markup.

https://github.com/imathis/octopress/blob/master/.themes/classic/source/_includes/head.html#L20

Palmitin answered 31/7, 2012 at 2:5 Comment(1)
Thanks. Your solution does indeed allow the <link> tag to be placed directly in the header of all pages. This would be one way to add Google profile photos to blog search results and achieve the desired effect.Confine

© 2022 - 2024 — McMap. All rights reserved.