-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: corentinbettiol <[email protected]>
- Loading branch information
1 parent
ef53f1f
commit 7caa375
Showing
13 changed files
with
183 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add meta robots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...gocms_page_meta/migrations/0014_pagemeta_robots_alter_genericmetaattribute_id_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 4.2.4 on 2023-08-03 13:23 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("djangocms_page_meta", "0013_auto_20200821_1457"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="pagemeta", | ||
name="robots", | ||
field=models.CharField(blank=True, max_length=512, verbose_name="Robots meta tag"), | ||
), | ||
migrations.AlterField( | ||
model_name="genericmetaattribute", | ||
name="id", | ||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), | ||
), | ||
migrations.AlterField( | ||
model_name="pagemeta", | ||
name="id", | ||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), | ||
), | ||
migrations.AlterField( | ||
model_name="titlemeta", | ||
name="id", | ||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
def get_setting(name): | ||
from django.conf import settings | ||
|
||
description_length = getattr(settings, "PAGE_META_DESCRIPTION_LENGTH", None) or 320 | ||
|
||
tw_description_length = getattr(settings, "PAGE_META_TWITTER_DESCRIPTION_LENGTH", None) or 320 | ||
|
||
robots_choices = getattr(settings, "PAGE_META_ROBOTS_CHOICES", None) or ( | ||
("none", _("None [noindex, nofollow]")), | ||
("noindex", _("No Index")), | ||
("nofollow", _("No Follow")), | ||
("noimageindex", _("No Image Index")), | ||
("nosnippet", _("No Snippet")), | ||
("noarchive", _("No Archive")), | ||
("notranslate", _("No Translate")), | ||
("nositelinkssearchbox", _("No Site Links Search Box")), | ||
) | ||
|
||
default = { | ||
"PAGE_META_DESCRIPTION_LENGTH": description_length, | ||
"PAGE_META_TWITTER_DESCRIPTION_LENGTH": tw_description_length, | ||
"PAGE_META_ROBOTS_CHOICES": robots_choices, | ||
} | ||
return default["PAGE_META_%s" % name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters