improve structured SEO data, v39
This commit is contained in:
parent
a498c81e99
commit
a5372e1238
3 changed files with 18 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
.PHONY: help build publish
|
||||
VERSION = 1.0.38
|
||||
VERSION = 1.0.39
|
||||
|
||||
help:
|
||||
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from typing import Optional
|
||||
|
||||
from django import forms
|
||||
from django.db import models
|
||||
from modelcluster.fields import ParentalKey, ParentalManyToManyField
|
||||
|
@ -95,6 +97,19 @@ class BlogPage(SeoMixin, Page):
|
|||
promote_panels = SeoMixin.seo_panels
|
||||
seo_content_type = SeoType.ARTICLE
|
||||
|
||||
@property
|
||||
def seo_author(self) -> str:
|
||||
return ', '.join([author.name for author in self.authors.all()])
|
||||
|
||||
@property
|
||||
def seo_canonical_url(self) -> str:
|
||||
# replace http:// with https://
|
||||
return super().seo_canonical_url.replace('http://', 'https://')
|
||||
|
||||
@property
|
||||
def seo_struct_publisher_dict(self) -> Optional[dict]:
|
||||
return None
|
||||
|
||||
|
||||
class BlogPageGalleryImage(Orderable):
|
||||
page = ParentalKey(BlogPage, on_delete=models.CASCADE, related_name='gallery_images')
|
||||
|
|
|
@ -3,7 +3,7 @@ from django.db import models
|
|||
from wagtail.models import Page
|
||||
from wagtail.fields import RichTextField, StreamField
|
||||
from wagtail.admin.panels import FieldPanel, MultiFieldPanel
|
||||
from wagtailseo.models import SeoMixin
|
||||
from wagtailseo.models import SeoMixin, SeoType
|
||||
from .blocks import HomeContentBlock
|
||||
|
||||
|
||||
|
@ -56,3 +56,4 @@ class HomePage(SeoMixin, Page):
|
|||
]
|
||||
|
||||
promote_panels = SeoMixin.seo_panels
|
||||
seo_content_type = SeoType.WEBSITE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue