add SEO
This commit is contained in:
parent
8f5d475dd4
commit
bc2be24e7e
9 changed files with 325 additions and 6 deletions
4
Makefile
4
Makefile
|
@ -4,7 +4,7 @@ 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}'
|
||||
|
||||
build:
|
||||
@docker build -t code.headbright.be/konstantin/iamkonstantin:1.0.14 .
|
||||
@docker build -t code.headbright.be/konstantin/iamkonstantin:1.0.15 .
|
||||
|
||||
publish:
|
||||
@docker push code.headbright.be/konstantin/iamkonstantin:1.0.14
|
||||
@docker push code.headbright.be/konstantin/iamkonstantin:1.0.15
|
||||
|
|
18
blog/migrations/0011_alter_blogpage_intro.py
Normal file
18
blog/migrations/0011_alter_blogpage_intro.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.0.2 on 2024-03-23 15:34
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0010_alter_blogpage_body'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='blogpage',
|
||||
name='intro',
|
||||
field=models.TextField(),
|
||||
),
|
||||
]
|
File diff suppressed because one or more lines are too long
|
@ -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')
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,8 +3,10 @@ from django.db import models
|
|||
from wagtail.models import Page
|
||||
from wagtail.fields import RichTextField
|
||||
from wagtail.admin.panels import FieldPanel, MultiFieldPanel
|
||||
from wagtailseo.models import SeoMixin
|
||||
|
||||
class HomePage(Page):
|
||||
|
||||
class HomePage(SeoMixin, Page):
|
||||
image = models.ForeignKey(
|
||||
"wagtailimages.Image",
|
||||
null=True,
|
||||
|
@ -46,3 +48,5 @@ class HomePage(Page):
|
|||
),
|
||||
FieldPanel('body'),
|
||||
]
|
||||
|
||||
promote_panels = SeoMixin.seo_panels
|
||||
|
|
|
@ -30,6 +30,7 @@ INSTALLED_APPS = [
|
|||
"home",
|
||||
"search",
|
||||
"wagtailcodeblock",
|
||||
"wagtailseo",
|
||||
"wagtail.contrib.settings",
|
||||
"wagtail.contrib.forms",
|
||||
"wagtail.contrib.redirects",
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<html lang="en" class="h-full antialiased">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
{% include "wagtailseo/meta.html" %}
|
||||
<title>
|
||||
{% block title %}
|
||||
{% if page.seo_title %}{{ page.seo_title }}{% else %}{{ page.title }}{% endif %}
|
||||
|
@ -59,5 +60,6 @@
|
|||
{% block extra_js %}
|
||||
{# Override this in templates to add extra javascript #}
|
||||
{% endblock %}
|
||||
{% include "wagtailseo/struct_data.html" %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -5,3 +5,4 @@ wagtailcodeblock>=1.29.0.2,<2.0
|
|||
django-tailwind>=3.6.0
|
||||
django-browser-reload>=1.12
|
||||
Wand==0.6.13
|
||||
wagtail-seo==2.5.0
|
Loading…
Add table
Add a link
Reference in a new issue