Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Tips / SEO Tips

SEO Tips

Search Engine Optimization Tips

PageSpeed Insights

Google Manual

SiteMap

設定 SiteMap 的步驟

Verifying a website to Google

  1. Visit the Google Webmaster page (logged in with your Google account).
  2. Add site (e.g. www.mysite.org)
  3. Google then provides a downloadable HTML page you need to insert at the root of your site.
  4. This page has a filename of something such as googled40ce42b4137a946.html and will have contents such as google-site-verification: googled40ce42b4137a946.html
  5. At the root of  your Plone site, add a new "File".
    1. Set the ID of te new file as the filename above.
    2. Then upload Google's supplied HTML file.
  6. If you have collective.xdv installed, then under "Site Setup > XDV Theme" add the following to unstyled paths:
    ^.*googled40ce42b4137a946.html$
  7. Then you are able to verify to Google that you own the site!

Exposing a sitemap for your website

  1. Under "Site Setup > Site" put a tick in "Expose sitemap.xml.gz in the portal root".
  2. Now the URL www.mysite.org/sitemap.xml.gz will be available and can be added via the Google Webmaster tools pages.

Query Strings, Multiple Languages, Forms

http://plone.org/documentation/kb/google-sitemap

可直接修改內建的 robots.txt 或編輯 Skin 裡的 robots.txt 檔案

http://pypi.python.org/pypi/cs.seopack

SiteMap: make all items in navigation visible, but still protect content. Creating SiteMap XML

Google Crawl Error on search_rss URLs

分析搜尋關鍵字

限定 SiteMap 階層數量

class LocalSiteMap(BrowserView):
  template = ViewPageTemplateFile('localsitemap.pt')
  def __init__(self, context, request):
    self.context = context
    self.request = request
  def get_children(self, path, depth):
    if depth==3"
      return None
    results = []
    entries = self.context.portal_catalog.searchResults({
      'path': {'query': path, 'depth': 1},
      'review_state': "published",
      'is_default_page': False,
      }, sort_on='getObjPositionInParent')
    for entry in entries:
      data = {'entry': entry}
      children = None
      if entry.portal_type in ['Folder', 'FolderMeteo']:
        children = self.get_children(path+'/'+entry.id, depth+1)
      if children:
        data['children'] = children
      results.append(data)
    return results
  def __call__(self):
    catalog = self.context.portal_catalog
    depth = 0
    root = "/".join(self.context.getPhysicalPath())
    entries = self.get_children(root, 0)
    return self.template(entries=entries)

啟用 plone.app.multilingual 造成 sitemap.xml.gz 失效