如何为Tumblr主题的标签页和索引页设置不同的标题和元标签 [英] How to have different titles and meta tags for tag pages and index pages of Tumblr themes

查看:122
本文介绍了如何为Tumblr主题的标签页和索引页设置不同的标题和元标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在tumblr主题中,我分别为索引页和标签页找到了以下块。

  {block:IndexPage} {/ block:IndexPage} 
{block:TagPage} {/ block:TagPage}

页面被当作索引页面的子集,所以我在索引页面块中定义的内容也出现在标签页面上,以及标签页面块中的内容。在这种情况下,如何为标签页和索引页独立定义不同的标题和元标签?

$标签页上的不同标题

b
$ b

 < title> {block:TagPage}文章标记为{Tag}  -  {/ block:TagPage} {Title}< / title> 

你不能在tumblr上定义不同的meta标签。然而,您可以为背景色定义多个元标记,并在标记页上用作标准和开启。

 < meta name =color:Backgroundcontent =#eee/> 
< meta name =color:Background Tag Pagecontent =#666/>

在css中:

  body {
background:{color:background};
{block:TagPage}
background:{color:background tag page};
{/ block:TagPage}
}

这种方法的用处是但有争议。至少在个人博客上,我认为它会起作用。


In tumblr themes I found the following blocks for index page and tag pages respectively.

{block:IndexPage}{/block:IndexPage}  
{block:TagPage}{/block:TagPage}

But tag pages are taken as subset of index pages, so what i define in index page blocks also appear on tag pages along with whats in tag page blocks.

In such case how to define different title and meta tags independently for tag pages and index pages?

解决方案

Different titles on tag page:

<title>{block:TagPage}Posts tagged {Tag} - {/block:TagPage} {Title}</title>

You can't define different meta tags on tumblr.

You can however define multiple meta tags for background color for instance, and use on as standard and on on the tag page.

<meta name="color:Background" content="#eee"/>
<meta name="color:Background Tag Page" content="#666"/>

In the css:

body {
  background: {color:background};
  {block:TagPage}
  background: {color:background tag page};
  {/block:TagPage}
}

The usefulness of this method is debatable though. I think it would work okay for a personal blog at least.

这篇关于如何为Tumblr主题的标签页和索引页设置不同的标题和元标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆