This project is read-only.

Post Titles as Links

Topics: Themes
Mar 17, 2013 at 12:54 AM
I've noticed that all blog post title tags are published as <h1> tags which contain a hyperlink, with the hyperlink containing the page title. From what I've read in terms of SEO it's better to have just text in the <h1> tags and not hyperlinks.

I can remove the hyperlink through the "PostView.ascx" page and make it text-only, but this will also remove the hyperlink from the blog titles on the home page, which mean you cannot navigate to the page-specific post.

Is there some way to configure PostView.ascx so that posts on the home page have a hyperlink in the page title whereas post-specific pages have only text in the <h1> header tags?
Mar 17, 2013 at 11:12 AM
 <% if (Location == ServingLocation.SinglePost) { %> 
        <h1><%=Server.HtmlEncode(Post.Title) %></h1>
    <% } else { %>  
        <h1><a href="<%=Post.RelativeLink %>" rel="bookmark"><%=Server.HtmlEncode(Post.Title) %></a></h1>
    <%} %>    
Mar 17, 2013 at 5:06 PM
Thanks Andy. I had to fully-qualify SinglePost (BlogEngine.Core.ServingLocation.SinglePost) but other than that it worked great.