6

我想将我的 Octopress 博客配置为在所有页面的 head 元素中添加作者链接,以便我的 Google+ 图片将显示在我的博客帖子的搜索结果旁边。目前,我相信我可以包括一个

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

在每个帖子中,但这变得乏味。由于我博客上的每篇文章都是我写的,我希望上面的链接只显示在我博客的每个 Octopress 页面的标题中。然后在 Google+ 上,我可以将我的博客列为我贡献的网站,而不是列出我对每篇文章的贡献。

我是 Google Authorship 的新手,所以也许我想做的不是最好的方法。我的总体目标只是让我的 Google+ 照片出现在我在 Google 搜索结果和 Google+ 中的所有 Octopress 博客文章旁边,仅将我的博客列为我贡献的网站(而不是每篇文章)。

4

2 回答 2

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.

于 2012-08-02T01:06:30.550 回答
1

您需要使用您的作者身份标记更新 head.html 模板(在 octopress 主题中提供)文件。

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

于 2012-07-31T02:05:16.610 回答