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 or even the HTML fragment returned by feincms3_meta.utils.meta_tags_html in your project:
return render(request, ..., { ... 'meta_tags': meta_tags_html( [object], request=request, ), })
meta_tags and meta_tags_html also support overriding or removing individual tags using keyword arguments. Falsy values are discarded, None causes the complete removal of the tag from the dictionary.
If you want to modify the dictionary in some way before rendering, use feincms3_meta.utils.meta_tags together 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.2.0.tar.gz
.
File metadata
- Download URL: feincms3-meta-1.2.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2468cbbbf5ef69aad236c2725828ea40ced54e60263809930bad1792f35bdcba |
|
MD5 | 469ee3e2c27ebc1e94b6558f6cac5a66 |
|
BLAKE2b-256 | dc9df0ab057fd34710a18ecd285925114783dc8241a0f016f10c0bb3435a0f1e |
File details
Details for the file feincms3_meta-1.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: feincms3_meta-1.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0a5491627a9d77217e2a89ef4e1a67a7d9f6f623538bf197cc71cc66411d5eb |
|
MD5 | 1dfa7426deacf3497eee5c02b40547df |
|
BLAKE2b-256 | 5dc2b12e784498a351e5ca0b354e4b9672e7a9707bf871f69df0c106491759e4 |