Readme.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Sitemap
  2. -------
  3. This plugin generates plain-text or XML sitemaps. You can use the ``SITEMAP``
  4. variable in your settings file to configure the behavior of the plugin.
  5. The ``SITEMAP`` variable must be a Python dictionary and can contain these keys:
  6. - ``format``, which sets the output format of the plugin (``xml`` or ``txt``)
  7. - ``priorities``, which is a dictionary with three keys:
  8. - ``articles``, the priority for the URLs of the articles and their
  9. translations
  10. - ``pages``, the priority for the URLs of the static pages
  11. - ``indexes``, the priority for the URLs of the index pages, such as tags,
  12. author pages, categories indexes, archives, etc...
  13. All the values of this dictionary must be decimal numbers between ``0`` and ``1``.
  14. - ``changefreqs``, which is a dictionary with three items:
  15. - ``articles``, the update frequency of the articles
  16. - ``pages``, the update frequency of the pages
  17. - ``indexes``, the update frequency of the index pages
  18. Valid frequency values are ``always``, ``hourly``, ``daily``, ``weekly``, ``monthly``,
  19. ``yearly`` and ``never``.
  20. You can exclude URLs from being included in the sitemap via regular expressions.
  21. For example, to exclude all URLs containing ``tag/`` or ``category/`` you can
  22. use the following ``SITEMAP`` setting.
  23. .. code-block:: python
  24. SITEMAP = {
  25. 'exclude': ['tag/', 'category/']
  26. }
  27. If a key is missing or a value is incorrect, it will be replaced with the
  28. default value.
  29. You can also exclude an individual URL by adding metadata to it setting ``private``
  30. to ``True``.
  31. The sitemap is saved in ``<output_path>/sitemap.<format>``.
  32. .. note::
  33. ``priorities`` and ``changefreqs`` are information for search engines.
  34. They are only used in the XML sitemaps.
  35. For more information: <http://www.sitemaps.org/protocol.html#xmlTagDefinitions>
  36. **Example**
  37. Here is an example configuration (it's also the default settings):
  38. .. code-block:: python
  39. PLUGINS=['pelican.plugins.sitemap',]
  40. SITEMAP = {
  41. 'format': 'xml',
  42. 'priorities': {
  43. 'articles': 0.5,
  44. 'indexes': 0.5,
  45. 'pages': 0.5
  46. },
  47. 'changefreqs': {
  48. 'articles': 'monthly',
  49. 'indexes': 'daily',
  50. 'pages': 'monthly'
  51. }
  52. }