title - 如何操作 Blogger 模板中的字符串。不可能的?

标签 title blogger blogspot strip-tags

This question is about Blogger Template manipulation. People developing/changing or manipulating Blogger templates in any way know its syntax hence can provide some input.



我写了development blog在 Blogger 上,我更改了我的博客模板,因此帖子显示 HTML head标题不同(帖子名称在前)与默认(博客名称在前)。

但。因为我格式化我的内联编程代码字类似于 Stackoverflow(灰色背景等宽字体)并且在我在博客文章标题中使用它们中的任何一个时做同样的事情......我将这些代码字附在 <code/> 中元素,然后我为此特定元素设置了 CSS,以将其添加为灰色背景并在其上设置等宽字体。此格式适用于博客文章标题及其内容。

但我遇到的问题是这些 <code/>我使用的标签也显示在 HTML headtitle (显示在浏览器窗口标题中)。更重要的是,这些显示在 web search results 中。以及。那就更烦了。

默认模板使用 <data:blog.pageTitle/>title元素,它去掉任何标签,但将所有标题显示为博客名称:博客文章标题(谷歌搜索结果毫无意义,因为博客文章标题被截断了)。这就是我使用 <data:blog.pageName/> 的原因而是在头部只显示博客文章标题,但它仍然包含所有标签,我应该以某种方式将它们删除。

查询 this blog post例子。加载它,然后查看仍然显示标签的浏览器窗口标题栏。我要他们走了。

将帖子添加到 head 时,如何从帖子标题中删除标签元素?

最佳答案

更新

好的,到目前为止,这是我的工作:

  • 在设置-> 标题-> 放一个不错的&nbsp;
  • 使用 <data:blog.pageTitle/>如题;
  • 在设计中 -> 编辑 html -> 替换这些行

  • <b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
      <b:widget id='Header1' locked='true' title='  (Intestazione)' type='Header'/>
    </b:section>
    

    使用您的自定义标题
    <div class="header section" id="header">
      <div class="widget Header" id="Header1">
        <div id="header-inner">
          <div class="titlewrapper">
            <h1 class="title">
              <a href="http://aseptik.blogspot.com/">aSeptik Site</a></h1>
          </div>
          <div class="descriptionwrapper">
            <p class="description">
              <span>
              </span>
            </p>
          </div>
        </div>
      </div>
    </div>
    
    <title>将导致:
    jQuery <em>"scroll into view"</em> plugin (with an additional <code>":scrollable"</code> selector filter)
    


    : jQuery "scroll into view" plugin (with an additional ":scrollable" selector filter)
    

    希望这有助于,演示 http://aseptik.blogspot.com/2011/02/jquery-scroll-into-view-plugin-with.html


    尝试在您的 <body> 中使用一点 javascript像这样
    <script type='text/javascript'>
    document.title = document.title.replace(/(&lt;([^&gt;]+)&gt;)/ig,&#39;&#39;);
    </script>
    
    </body>
    

    按原样复制和过去不转换实体,

    although, i'm not sure this is the right solution for you since spiders usually avoid js execution, and i don't know how "html tags in the title" affects the search results.

    关于title - 如何操作 Blogger 模板中的字符串。不可能的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4827421/

    相关文章:

    seo - 在不影响 SEO 的情况下将自定义域添加到 Blogspot

    javascript - 如何将随机类名添加到博客模板中的元素

    html - 动画下划线 Css 导航菜单博主

    asp.net - 如何从ASP.NET 3.5中的Web内容页面设置页面标题

    java - Taskkill 一个无标题的进程?

    html - 如何在 Blogger 中自定义标签页眉?

    html - 如何删除 Blogger 中博客文章以外的页面上的侧边栏?

    javascript - 主页(Blogspot 博客)上的缩略图突然模糊?

    javascript - 如何将 span 的内容复制到它的 title 属性中?

    android - 如何实现LinearLayout标题/标签