django CMS page extension to handle sitemap customization
Project description
django CMS page extension to handle sitemap customization
Support Python version:
Python 2.7, 3.3, 3.4, 3.5
Supported Django versions:
Django 1.8 to 1.10
Supported django CMS versions:
django CMS 3.2+
Features
Support for changefreq and priority customisation per-page
Option to exclude a page from the Sitemap
Values are cached
django CMS toolbar integration
Quickstart
Install djangocms-page-sitemap:
pip install djangocms-page-sitemap
Add to INSTALLED_APPS with django.contrib.sitemaps:
INSTALLED_APPS = [ ... 'django.contrib.sitemaps', 'djangocms_page_sitemap', ]
Add to the urlconf, eventually removing django CMS sitemap:
from djangocms_page_sitemap.sitemap import ExtendedSitemap urlpatterns = patterns('', ... url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': {'cmspages': ExtendedSitemap}}), )
Add the following snippets to the django CMS templates:
{% load robots_index %} ... <head> <!-- somewhere in the head tag --> {% page_robots %} </head> ...
Usage
After installing as above, you will be able to tune the sitemap setting for each page.
A new menu item Sitemap properties will be available in the page toolbar.
For each page you will be able to set the following flags / values:
Sitemap changefreq (default: the django CMS default)
Sitemap priority (default: 0.5)
Include page in sitemap (default: True)
Set noindex value to page robots meta tag
Set noarchite value to page robots meta tag
Provide any additional robots meta tag values
page_robots options
page_robots meta tag accepts the following parameters:
page: the page to render robots meta tag (default: current page). Can be any valid page lookup
site: the current site id (default: current site).
Settings
PAGE_SITEMAP_CHANGEFREQ_LIST: List of frequency changes
PAGE_SITEMAP_DEFAULT_CHANGEFREQ: Default changefrequency (default: django CMS value -monthly-)
PAGE_SITEMAP_CACHE_DURATION: Cache duration: same as django CMS menu cache)
History
0.4.3 (2019-07-13)
Fix error when page_robots is executed outside a request
Fix tox for older environments
0.4.2 (2019-04-08)
Add support for noindex, noarchive robots meta tag
0.4.1 (2016-12-02)
Add Django 1.10 support
0.4.0 (2016-10-26)
Drop compatibility with django CMS 3.1 and below, Django 1.7 and below
0.3.1 (2015-10-18)
Improve defaults
0.3.0 (2015-10-18)
Add Python 3.5
Add option to exclude page from sitemap
0.2.0 (2015-08-15)
Update to support django CMS 3.1
Drop support for Django 1.4, 1.5
Add support for Django 1.8
0.1.0 (2014-08-26)
Initial version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for djangocms-page-sitemap-0.4.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0caabaf356fe9368e0c14985c2150ae4800904581607ca82b989590113fb0e4f |
|
MD5 | d81c278d9e00ac7be33088812fa5857f |
|
BLAKE2b-256 | 4971c8b6dc4458992056e7066654de6e2be5aa460205a5c01f930ad67b85a885 |
Hashes for djangocms_page_sitemap-0.4.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d455ad5e31d28f5aef7bc9fdbaea163dc42bc994faa55e07817ddbb8a0f5ad3 |
|
MD5 | c5931cba48d7397b60cdee25704e540f |
|
BLAKE2b-256 | 03b2e9240c9f2ee6674e6baf3e4f3670ebfd6adcb297ebd97e8096388bc43a5a |