add SEO
This commit is contained in:
parent
8f5d475dd4
commit
bc2be24e7e
9 changed files with 325 additions and 6 deletions
|
@ -12,9 +12,9 @@ from wagtail.search import index
|
|||
from wagtail.snippets.models import register_snippet
|
||||
|
||||
from blog.blocks import BlogPostBlock
|
||||
from wagtailseo.models import SeoMixin, SeoType
|
||||
|
||||
|
||||
class BlogIndexPage(Page):
|
||||
class BlogIndexPage(SeoMixin, Page):
|
||||
intro = RichTextField(blank=True)
|
||||
|
||||
def get_context(self, request):
|
||||
|
@ -27,6 +27,7 @@ class BlogIndexPage(Page):
|
|||
content_panels = Page.content_panels + [
|
||||
FieldPanel('intro')
|
||||
]
|
||||
promote_panels = SeoMixin.seo_panels
|
||||
|
||||
class BlogTagIndexPage(Page):
|
||||
|
||||
|
@ -46,7 +47,7 @@ class BlogPageTag(TaggedItemBase):
|
|||
on_delete=models.CASCADE
|
||||
)
|
||||
|
||||
class BlogPage(Page):
|
||||
class BlogPage(SeoMixin, Page):
|
||||
date = models.DateField("Post date")
|
||||
intro = models.TextField()
|
||||
body = StreamField(
|
||||
|
@ -83,6 +84,9 @@ class BlogPage(Page):
|
|||
InlinePanel('gallery_images', label="Gallery images"),
|
||||
]
|
||||
|
||||
promote_panels = SeoMixin.seo_panels
|
||||
seo_content_type = SeoType.ARTICLE
|
||||
|
||||
|
||||
class BlogPageGalleryImage(Orderable):
|
||||
page = ParentalKey(BlogPage, on_delete=models.CASCADE, related_name='gallery_images')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue