No project description provided
Project description
Helpers and mixins for making meta and open graph tags less annoying.
Usage
Inherit feincms3_meta.models.MetaMixin
Optional, but recommended: Add a setting for default tags:
META_TAGS = { 'site_name': 'My site', 'title': 'Default title', 'description': ( 'The default description,' ' maybe long.' ), 'image': '/static/app/logo.png', }
If you define fieldsets on a ModelAdmin subclass, you may want to use the helper MetaMixin.admin_fieldset(), or maybe not.
Use the dictionary returned by feincms3_meta.utils.meta_tags either directly (its __str__ method renders as a HTML fragment) or access individual properties using standard dictionary access:
return render(request, ..., { ... 'meta_tags': meta_tags( [object], request=request, ), })
meta_tags also supports overriding or removing individual tags using keyword arguments. Falsy values are discarded, None causes the complete removal of the tag from the dictionary.
The rendering of a meta tags dictionary is also usable standalone with feincms3_meta.utils.format_meta_tags.
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 feincms3_meta-1.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88a404698637649f4171e1dc7cb31ee81771ba2356550834915423cc6709d977 |
|
MD5 | e3c0117b27ef2ced813fcc5d3e8b0f9e |
|
BLAKE2b-256 | eeac5a0e7f5b04029cf3a7c9d6675df05fe56779d77c230371003d15d0df2dc7 |