Readme.rst 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. # Where your plug-ins reside
  40. PLUGIN_PATHS = ['/where/you/cloned/it/pelican-plugins/', ]
  41. PLUGINS=['sitemap',]
  42. SITEMAP = {
  43. 'format': 'xml',
  44. 'priorities': {
  45. 'articles': 0.5,
  46. 'indexes': 0.5,
  47. 'pages': 0.5
  48. },
  49. 'changefreqs': {
  50. 'articles': 'monthly',
  51. 'indexes': 'daily',
  52. 'pages': 'monthly'
  53. }
  54. }