This commit is contained in:
Konstantin 2024-03-23 16:50:24 +01:00
parent 8f5d475dd4
commit bc2be24e7e
9 changed files with 325 additions and 6 deletions

View file

@ -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}' @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: build:
@docker build -t code.headbright.be/konstantin/iamkonstantin:1.0.14 . @docker build -t code.headbright.be/konstantin/iamkonstantin:1.0.15 .
publish: publish:
@docker push code.headbright.be/konstantin/iamkonstantin:1.0.14 @docker push code.headbright.be/konstantin/iamkonstantin:1.0.15

View 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

View file

@ -12,9 +12,9 @@ from wagtail.search import index
from wagtail.snippets.models import register_snippet from wagtail.snippets.models import register_snippet
from blog.blocks import BlogPostBlock from blog.blocks import BlogPostBlock
from wagtailseo.models import SeoMixin, SeoType
class BlogIndexPage(SeoMixin, Page):
class BlogIndexPage(Page):
intro = RichTextField(blank=True) intro = RichTextField(blank=True)
def get_context(self, request): def get_context(self, request):
@ -27,6 +27,7 @@ class BlogIndexPage(Page):
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [
FieldPanel('intro') FieldPanel('intro')
] ]
promote_panels = SeoMixin.seo_panels
class BlogTagIndexPage(Page): class BlogTagIndexPage(Page):
@ -46,7 +47,7 @@ class BlogPageTag(TaggedItemBase):
on_delete=models.CASCADE on_delete=models.CASCADE
) )
class BlogPage(Page): class BlogPage(SeoMixin, Page):
date = models.DateField("Post date") date = models.DateField("Post date")
intro = models.TextField() intro = models.TextField()
body = StreamField( body = StreamField(
@ -83,6 +84,9 @@ class BlogPage(Page):
InlinePanel('gallery_images', label="Gallery images"), InlinePanel('gallery_images', label="Gallery images"),
] ]
promote_panels = SeoMixin.seo_panels
seo_content_type = SeoType.ARTICLE
class BlogPageGalleryImage(Orderable): class BlogPageGalleryImage(Orderable):
page = ParentalKey(BlogPage, on_delete=models.CASCADE, related_name='gallery_images') page = ParentalKey(BlogPage, on_delete=models.CASCADE, related_name='gallery_images')

File diff suppressed because one or more lines are too long

View file

@ -3,8 +3,10 @@ from django.db import models
from wagtail.models import Page from wagtail.models import Page
from wagtail.fields import RichTextField from wagtail.fields import RichTextField
from wagtail.admin.panels import FieldPanel, MultiFieldPanel from wagtail.admin.panels import FieldPanel, MultiFieldPanel
from wagtailseo.models import SeoMixin
class HomePage(Page):
class HomePage(SeoMixin, Page):
image = models.ForeignKey( image = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
null=True, null=True,
@ -46,3 +48,5 @@ class HomePage(Page):
), ),
FieldPanel('body'), FieldPanel('body'),
] ]
promote_panels = SeoMixin.seo_panels

View file

@ -30,6 +30,7 @@ INSTALLED_APPS = [
"home", "home",
"search", "search",
"wagtailcodeblock", "wagtailcodeblock",
"wagtailseo",
"wagtail.contrib.settings", "wagtail.contrib.settings",
"wagtail.contrib.forms", "wagtail.contrib.forms",
"wagtail.contrib.redirects", "wagtail.contrib.redirects",

View file

@ -4,6 +4,7 @@
<html lang="en" class="h-full antialiased"> <html lang="en" class="h-full antialiased">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
{% include "wagtailseo/meta.html" %}
<title> <title>
{% block title %} {% block title %}
{% if page.seo_title %}{{ page.seo_title }}{% else %}{{ page.title }}{% endif %} {% if page.seo_title %}{{ page.seo_title }}{% else %}{{ page.title }}{% endif %}
@ -59,5 +60,6 @@
{% block extra_js %} {% block extra_js %}
{# Override this in templates to add extra javascript #} {# Override this in templates to add extra javascript #}
{% endblock %} {% endblock %}
{% include "wagtailseo/struct_data.html" %}
</body> </body>
</html> </html>

View file

@ -5,3 +5,4 @@ wagtailcodeblock>=1.29.0.2,<2.0
django-tailwind>=3.6.0 django-tailwind>=3.6.0
django-browser-reload>=1.12 django-browser-reload>=1.12
Wand==0.6.13 Wand==0.6.13
wagtail-seo==2.5.0