michelc Blog

Just <strong>another</strong> WordPress.com weblog

Archive for the ‘html’ Category

Sémantique HTML et PageRank

leave a comment »

Mike Davidson tried to rank for the term lodefizzle on Google. He wrote a dozen different pages to find out what aspects of HTML Google really cares about. Scroll down to the Google…

  1. The H1 tag does indeed assert some dominance and we can therefore assume you are better off using proper headings in your HTML documents.
  2. The mere appearance of many nested tables in your code does not have a strong enough negative effect to be considered a drag on search engine ranking.
  3. It’s not clear that validity helps search engine ranking, but it’s definitely true that certain errors in your code can get you completely removed from indexes.
  4. The semantic effect of hierarchical HTML headings is a stronger factor in search rankings than more rudimentary measures such as physical keyword placement.
  5. Although good semantics are somewhat valuable in optimization, simple things like proper titles, descriptive filenames, and incoming links are dramatically more important.

Written by michel

3 février 2006 at 8:33

Publié dans html, Référencement

Comment cibler les publicités AdSense

leave a comment »

Il est possible d’indiquer à Google quelle sont les parties de la page dont on souhaite mettre le contenu en avant. Cela permet de cibler les annonces affichées sur le site en fonction de ce contenu.

Pour cela, il suffit d’encadrer le contenu « intéressant » par :

<!-- google_ad_section_start -->
    ....
<!-- google_ad_section_end -->

Il est aussi possible de « masquer » du contenu pour éviter d’avoir des annonces relatives à celui-ci :

<!-- google_ad_section_start(weight=ignore) -->

    ....
<!-- google_ad_section_end -->

Via «What is section targeting and how do I implement it?»

Written by michel

20 janvier 2006 at 3:10

Publié dans html, Référencement

Blogmarks to Html conversion

with one comment

Ce fichier permet de transformer le fil atom de Blogmarks (par exemple http://api.blogmarks.net/user/ms_michel) en code html afin de pouvoir l’intégrer à une page web.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:atom="http://purl.org/atom/ns#draft-ietf-atompub-format-05" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <xsl:output method="html" />
  <xsl:template match="/">
    <xsl:apply-templates select="/atom:feed/atom:head" mode="before" />
    <xsl:apply-templates select="/atom:feed/atom:entry" />
    <xsl:apply-templates select="/atom:feed/atom:head" mode="after" />
  </xsl:template>
  <xsl:template match="atom:feed/atom:head" mode="before" >
    <!-- <h3><xsl:value-of select="atom:title" /></h3> -->
  </xsl:template>
  <xsl:template match="atom:feed/atom:head" mode="after">
    <p><a href="{atom:link[@rel='alternate']/@href}"><img src="http://blogmarks.net/img/88x31_neg.png" alt="blogmarks.net" /></a></p>
  </xsl:template>
  <xsl:template match="atom:feed/atom:entry">
    <div>
      <xsl:choose>
        <xsl:when test="position() mod 2 = 1">
          <xsl:attribute name="class">bm_blogmarks bm_odd</xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
          <xsl:attribute name="class">bm_blogmarks bm_even</xsl:attribute>
        </xsl:otherwise>
      </xsl:choose>
      <a href="{atom:link[@rel='related']/@href}"><img src="{atom:link[@rel='image']/@href}" alt="" /></a>
      <h4><a href="{atom:link[@rel='related']/@href}"><xsl:value-of select="atom:title" /></a></h4>
      <p><xsl:value-of select="atom:summary" disable-output-escaping="yes" /></p>
      <p class="blogmarks-tags">
        <xsl:value-of select="substring(atom:published, 0, 11)" />
        <xsl:if test="atom:category">
          <xsl:for-each select="atom:category">
            <xsl:text> - </xsl:text><a href="{@term}{@sheme}"><xsl:value-of select="@label" /></a>
          </xsl:for-each>
        </xsl:if>
      </p>
    </div>
  </xsl:template>
</xsl:stylesheet>

Le code html généré est inspiré par celui de Hot Links. Il peut ensuite être présenté grâce à la feuille de style CSS suivante :

.bm_blogmarks {
  margin: 10px auto;
  padding: 1%;
  background-color: #f5f5f5;
  border: 1px solid #d9d9d9;
  width: 97%;
  overflow:auto;
}
.bm_even {
  background-color: #fcfcfc;
}
.bm_blogmarks h4 {
  margin-top: 0;
}
.bm_blogmarks p.bm_tags {
  margin-bottom: 0;
  display: block;
  clear: left;
}
.bm_blogmarks img {
  margin: 0 0px 5px 10px;
  float: right;
  border: 0;
  clear: none;
  width: 144px;
  height: 107px;
}
.bm_even img {
  margin: 0 10px 5px 0px;
  float: left;
}

(Publié à l’origine sur http://www.bigbold.com/snippets/posts/show/1206)

Written by michel

19 janvier 2006 at 8:18

Publié dans Code Snippets, html, xml

RDF to Html conversion

with one comment

Ce fichier permet de transformer un fil RDF en code html afin de pouvoir l’intégrer à une page web.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:foo="http://purl.org/rss/1.0/">
    <xsl:output method="html"/>
    <xsl:template match="/">
        <xsl:apply-templates select="/rdf:RDF/foo:channel"/>
    </xsl:template>
    <xsl:template match="/rdf:RDF/foo:channel">
        <h3><xsl:value-of select="foo:title"/></h3>
        <p><xsl:value-of select="foo:description"/></p>
        <ul>
            <xsl:apply-templates select="/rdf:RDF/foo:item"/>
        </ul>
    </xsl:template>
    <xsl:template match="/rdf:RDF/foo:item">
        <li>
            <a href="{foo:link}" title="{substring(dc:date, 0, 11)}"><xsl:value-of select="foo:title"/></a>
            <p><xsl:value-of select="foo:description" disable-output-escaping="yes" /></p>
        </li>
    </xsl:template>
</xsl:stylesheet>

(Publié à l’origine sur http://www.bigbold.com/snippets/posts/show/1164)

Written by michel

16 janvier 2006 at 3:04

Publié dans Code Snippets, html, xml

RSS to Html conversion

leave a comment »

Ce fichier permet de transformer un fil RSS (version 0.9x ou 2.0) en code html afin de pouvoir l’intégrer à une page web.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <xsl:output method="html"/>
    <xsl:template match="/">
        <xsl:apply-templates select="/rss/channel"/>
    </xsl:template>
    <xsl:template match="/rss/channel">
        <h3><xsl:value-of select="title"/></h3>
        <p><xsl:value-of select="description"/></p>
        <ul>
            <xsl:apply-templates select="item"/>
        </ul>
    </xsl:template>
    <xsl:template match="/rss/channel/item">
        <li>
            <a href="{link}" title="{substring(pubDate, 0, 11)}"><xsl:value-of select="title"/></a>
            <p><xsl:value-of select="description" disable-output-escaping="yes" /></p>
        </li>
    </xsl:template>
</xsl:stylesheet>

(Publié à l’origine sur http://www.bigbold.com/snippets/posts/show/1163)

Written by michel

16 janvier 2006 at 3:03

Publié dans Code Snippets, html, xml

Atom to Html conversion

with one comment

Ce fichier permet de transformer un fil atom en code html afin de pouvoir l’intégrer à une page web.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:atom="http://purl.org/atom/ns#"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:dc="http://purl.org/dc/elements/1.1/">
    <xsl:output method="html"/>
    <xsl:template match="/">
    <xsl:apply-templates select="/atom:feed/atom:head"/>
        <xsl:apply-templates select="/atom:feed"/>
    </xsl:template>
    <xsl:template match="atom:feed/atom:head">
        <h3><xsl:value-of select="atom:title"/></h3>
        <xsl:if test="atom:tagline"><p><xsl:value-of select="atom:tagline"/></p></xsl:if>
        <xsl:if test="atom:subtitle"><p><xsl:value-of select="atom:subtitle"/></p></xsl:if>
    </xsl:template>
    <xsl:template match="/atom:feed">
        <h3><xsl:value-of select="atom:title"/></h3>
        <xsl:if test="atom:tagline"><p><xsl:value-of select="atom:tagline"/></p></xsl:if>
        <xsl:if test="atom:subtitle"><p><xsl:value-of select="atom:subtitle"/></p></xsl:if>
        <ul>
            <xsl:apply-templates select="atom:entry"/>
        </ul>
    </xsl:template>
    <xsl:template match="atom:entry">
        <li>
            <a href="{atom:link[@rel='related']/@href}" title="{substring(atom:published, 0, 11)}"><xsl:value-of select="atom:title"/></a>
            <xsl:choose>
                <xsl:when test="atom:content != ''">
                    <p><xsl:value-of select="atom:content" disable-output-escaping="yes" /></p>
                </xsl:when>
                <xsl:otherwise>
                    <p><xsl:value-of select="atom:summary" disable-output-escaping="yes" /></p>
                </xsl:otherwise>
            </xsl:choose>
        </li>
    </xsl:template>
</xsl:stylesheet>

(Publié à l’origine sur http://www.bigbold.com/snippets/posts/show/1162)

Written by michel

16 janvier 2006 at 2:59

Publié dans Code Snippets, html, xml