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
File details
Details for the file feincms3-meta-1.4.0.tar.gz
.
File metadata
- Download URL: feincms3-meta-1.4.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d682e377d46217f866989f21a5827f239eeba866d9bf0a10660e99ac63e49e4 |
|
MD5 | 6f42364bcc9206f4beb1c29a07b2c7a1 |
|
BLAKE2b-256 | be4aba5ea0ba16e9c0e3795e88b4e554974f990a2da163430a4ea5bbdafcaaaa |
File details
Details for the file feincms3_meta-1.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: feincms3_meta-1.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7754906ab6e6ce1f49c75d179807cbc5fc90d8d87bfdb9bafaedeb437123871 |
|
MD5 | 327cb9c3cf387ee53e5a2526fd557b82 |
|
BLAKE2b-256 | df606927275530336d84f2468991beb0ab2fa80b2a8350bdbb8d4485f7214138 |