django-meta
django-meta copied to clipboard
robots choice feature should be added for stronger SEO
Description
I would like to add index, follow or no index, nofollow to certain pages.
Use cases
for SEO purposes the crawler can identify wich page need to be crawled, index or not crawled
Proposed solution
I've tried something like this but it doesn't work: ROBOTS_PARAMETERS = ( "index, follow", "index, nofollow", "noindex, nofollow", "index, follow, nosnippet", "index, nofollow, nosnippet", "noindex, nofollow, nosnippet", "noimageindex, nofollow, nosnippet", "none", )
meta_robots = models.IntegerField( _("Meta Robots"), null=True, choices=tuple(enumerate(sorted(ROBOTS_PARAMETERS))) ) _metadata = { 'title': 'title', 'description': 'abstract', 'robots': 'meta_robots', 'extra_props': { 'robots': meta_robots, },
in the html for robots content it just shows "meta_robots" instead of the selected meta robot directive.
maybe something can be added to this approach to make it work or meta_robots could be built in.
@LanceMeister thanks for your report. From the top of my head your code should work, but I will investigate more on the issue.