H1标签指的是帖子的标题和博客的标题。而且每页应该只有一个H1标签。
这就是复杂的地方,因为博客的标题在帖子的页面中重复出现,从而导致每页有2个H1标签的错误。
当我们在博客标题中放置图片并设置要显示的图片而不是博客名称时,我们会从SEO角度自动删除标题。
如何解决这个问题?
这是我模板中引用博客标题的代码
<b:widget id='Header1' locked='true' title='Xamãs Urbanos (Cabeçalho)' type='Header' version='2' visible='true'>
<b:widget-settings>
<b:widget-setting name='displayUrl'>https://1.bp.blogspot.com/-Zq-xjYJ4FPg/W6N3Pw888DI/AAAAAAAAHms/123YJTNssl0xQJ5ES82c5QuV6Gr6YwD5ACLcBGAs/s1600/Logo_Xamas_Urbanos_Ayahuasca_em_Porto_Alegre.png</b:widget-setting>
<b:widget-setting name='displayHeight'>202</b:widget-setting>
<b:widget-setting name='sectionWidth'>150</b:widget-setting>
<b:widget-setting name='useImage'>true</b:widget-setting>
<b:widget-setting name='shrinkToFit'>true</b:widget-setting>
<b:widget-setting name='imagePlacement'>REPLACE</b:widget-setting>
<b:widget-setting name='displayWidth'>150</b:widget-setting>
</b:widget-settings>
<b:includable id='main' var='this'>
<div class='header-widget'>
<b:include cond='data:imagePlacement in {"REPLACE", "BEFORE_DESCRIPTION"}' name='image'/>
<b:include cond='data:imagePlacement not in {"REPLACE", "BEFORE_DESCRIPTION"}' name='title'/>
<b:include cond='data:imagePlacement != "REPLACE"' name='description'/>
</div>
</b:includable>
<b:includable id='behindImageStyle'>
<b:if cond='data:sourceUrl'>
<b:include cond='data:this.image' data='{ image: data:this.image, selector: ".header-widget" }' name='responsiveImageStyle'/>
<style type='text/css'>
.header-widget {
background-position: <data:blog.locale.languageAlignment/>;
background-repeat: no-repeat;
}
</style>
</b:if>
</b:includable>
<b:includable id='description'>
<p>
<data:this.description/>
</p>
</b:includable>
<b:includable id='image'>
<a class='header-brand' expr:href='data:blog.homepageUrl'>
<img expr:alt='data:blog.title.escaped' expr:data-height='data:height' expr:data-width='data:width' expr:src='data:image'/>
</a>
</b:includable>
<b:includable id='title'>
<h1>
<b:tag cond='data:view.url != data:blog.homepageUrl' expr:href='data:blog.homepageUrl' name='a'>
<data:title/>
</b:tag>
</h1>
</b:includable>
</b:widget>
答案 0 :(得分:0)
如何在图片标签后添加h1标题
尝试一下
<b:widget id='Header1' locked='true' title='Xamãs Urbanos (Cabeçalho)' type='Header' version='2' visible='true'>
<b:widget-settings>
<b:widget-setting name='displayUrl'>https://1.bp.blogspot.com/-Zq-xjYJ4FPg/W6N3Pw888DI/AAAAAAAAHms/123YJTNssl0xQJ5ES82c5QuV6Gr6YwD5ACLcBGAs/s1600/Logo_Xamas_Urbanos_Ayahuasca_em_Porto_Alegre.png</b:widget-setting>
<b:widget-setting name='displayHeight'>202</b:widget-setting>
<b:widget-setting name='sectionWidth'>150</b:widget-setting>
<b:widget-setting name='useImage'>true</b:widget-setting>
<b:widget-setting name='shrinkToFit'>true</b:widget-setting>
<b:widget-setting name='imagePlacement'>REPLACE</b:widget-setting>
<b:widget-setting name='displayWidth'>150</b:widget-setting>
</b:widget-settings>
<b:includable id='main' var='this'>
<div class='header-widget'>
<b:include cond='data:imagePlacement in {"REPLACE", "BEFORE_DESCRIPTION"}' name='image'/>
<b:if cond='data:imagePlacement in {"REPLACE", "BEFORE_DESCRIPTION"} and data:blog.pageType == "index"'><h1 style='display:none'><data:title/></h1></b:if>
<b:include cond='data:imagePlacement not in {"REPLACE", "BEFORE_DESCRIPTION"}' name='title'/>
<b:include cond='data:imagePlacement != "REPLACE"' name='description'/>
</div>
</b:includable>
<b:includable id='behindImageStyle'>
<b:if cond='data:sourceUrl'>
<b:include cond='data:this.image' data='{ image: data:this.image, selector: ".header-widget" }' name='responsiveImageStyle'/>
<style type='text/css'>
.header-widget {
background-position: <data:blog.locale.languageAlignment/>;
background-repeat: no-repeat;
}
</style>
</b:if>
</b:includable>
<b:includable id='description'>
<p>
<data:this.description/>
</p>
</b:includable>
<b:includable id='image'>
<a class='header-brand' expr:href='data:blog.homepageUrl'>
<img expr:alt='data:blog.title.escaped' expr:data-height='data:height' expr:data-width='data:width' expr:src='data:image'/>
</a>
</b:includable>
<b:includable id='title'>
<h1>
<b:tag cond='data:view.url != data:blog.homepageUrl' expr:href='data:blog.homepageUrl' name='a'>
<data:title/>
</b:tag>
</h1>
</b:includable>
</b:widget>