2016年11月11日 星期五

schema.org, 提升網站的排名

Ref : http://schema.org/docs/schemas.html

ref : https://search.google.com/structured-data/testing-tool/

Ref : http://codepen.io/liao/pen/waaamx

Ref : https://support.google.com/webmasters/answer/6001102?hl=zh-Hant&utm_source=wmx&utm_campaign=links
  content ->  itemprop="description"

<div class="block"  >
  <div class="block-leftArea">
    <ul class="block-product-list">
      <li itemscope itemtype="http://schema.org/Product">
        <img itemprop="image" class="img" src="http://placehold.it/96x96" />
        <h2 class="title" itemprop="name">title Lorem</h2>
        <p class="content" itemprop="description">: 
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sint, illum Lorem ipsum dolor sit amet....
        </p>
      </li>
     
    </ul>
  </div>
  <div class="block-rightArea">
    <img src="http://placehold.it/208x208"  />
  </div>
</div>
老師的範例程式:







Or you can jump di rectly to a commonly used type:

example 1

  1. <div itemscope itemtype="http://schema.org/Product">
  2.   <span itemprop="name">Kenmore White 17" Microwave</span>
  3.   <img itemprop="image" src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' />
  4.   <div itemprop="aggregateRating"
  5.     itemscope itemtype="http://schema.org/AggregateRating">
  6.    Rated <span itemprop="ratingValue">3.5</span>/5
  7.    based on <span itemprop="reviewCount">11</span> customer reviews
  8.   </div>
  9.   <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  10.     <!--price is 1000, a number, with locale-specific thousands separator
  11.     and decimal mark, and the $ character is marked up with the
  12.     machine-readable code "USD" -->
  13.     <span itemprop="priceCurrency" content="USD">$</span><span
  14.           itemprop="price" content="1000.00">1,000.00</span>
  15.     <link itemprop="availability" href="http://schema.org/InStock" />In stock
  16.   </div>
  17.   Product description:
  18.   <span itemprop="description">0.7 cubic feet countertop microwave.
  19.   Has six preset cooking categories and convenience features like
  20.   Add-A-Minute and Child Lock.</span>
  21.   Customer reviews:
  22.   <div itemprop="review" itemscope itemtype="http://schema.org/Review">
  23.     <span itemprop="name">Not a happy camper</span> -
  24.     by <span itemprop="author">Ellie</span>,
  25.     <meta itemprop="datePublished" content="2011-04-01">April 1, 2011
  26.     <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
  27.       <meta itemprop="worstRating" content = "1">
  28.       <span itemprop="ratingValue">1</span>/
  29.       <span itemprop="bestRating">5</span>stars
  30.     </div>
  31.     <span itemprop="description">The lamp burned out and now I have to replace
  32.     it. </span>
  33.   </div>
  34.   <div itemprop="review" itemscope itemtype="http://schema.org/Review">
  35.     <span itemprop="name">Value purchase</span> -
  36.     by <span itemprop="author">Lucas</span>,
  37.     <meta itemprop="datePublished" content="2011-03-25">March 25, 2011
  38.     <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
  39.       <meta itemprop="worstRating" content = "1"/>
  40.       <span itemprop="ratingValue">4</span>/
  41.       <span itemprop="bestRating">5</span>stars
  42.     </div>
  43.     <span itemprop="description">Great microwave for the price. It is small and
  44.     fits in my apartment.</span>
  45.   </div>
  46.   ...
  47. </div>



example3


  1. <div itemscope itemtype="http://schema.org/ItemList">
  2.   <link itemprop="url" href="http://multivarki.ru?filters%5Bprice%5D%5BLTE%5D=39600" />
  3.   <span itemprop="numberOfItems">315</span>
  4.   <div itemprop="itemListElement" itemscope itemtype="http://schema.org/Product">
  5.     <img alt="Photo of product" itemprop="image"
  6.      src="http://img01.multivarki.ru.ru/c9/f1/a5fe6642-18d0-47ad-b038-6fca20f1c923.jpeg" />
  7.     <a itemprop="url" href="http://multivarki.ru/brand_502/">
  8.       <span itemprop="name">BRAND 502</span>
  9.     </a>
  10.     <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  11.       <span itemprop="price">4399 р.</span>
  12.     </div>...
  13.     <div itemprop="itemListElement" itemtype="http://schema.org/Product">
  14.     ...
  15.     </div>
  16.   </div>
  17. </div>

沒有留言:

張貼留言