Skip to content
Snippets Groups Projects
Commit 9894baa9 authored by jan.bednarik's avatar jan.bednarik
Browse files

senate: SEO metadata

parent 4590ad9e
No related branches found
No related tags found
1 merge request!26SEO
......@@ -4,4 +4,4 @@ line_length = 88
multi_line_output = 3
default_sectiont = "THIRDPARTY"
include_trailing_comma = true
known_third_party = arrow,django,environ,faker,ics,pirates,pytest,pytz,requests,snapshottest,wagtail
known_third_party = arrow,django,environ,faker,ics,pirates,pytest,pytz,requests,snapshottest,wagtail,wagtailmetadata
# Generated by Django 3.0.6 on 2020-06-01 14:39
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailimages", "0022_uploadedimage"),
("senate", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="senatehomepage",
name="search_image",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.Image",
verbose_name="Search image",
),
),
]
from django.db import models
from django.utils.translation import gettext_lazy
from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel, StreamFieldPanel
from wagtail.admin.edit_handlers import (
FieldPanel,
HelpPanel,
MultiFieldPanel,
StreamFieldPanel,
)
from wagtail.core import blocks
from wagtail.core.fields import StreamField
from wagtail.core.models import Page
from wagtail.images.blocks import ImageChooserBlock
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtailmetadata.models import MetadataPageMixin
class PersonBlock(blocks.StructBlock):
......@@ -21,7 +28,7 @@ class PersonBlock(blocks.StructBlock):
label = "osoba"
class SenateHomePage(Page):
class SenateHomePage(MetadataPageMixin, Page):
senators = StreamField(
[("item", PersonBlock())], verbose_name="naši senátoři", blank=True
)
......@@ -39,7 +46,15 @@ class SenateHomePage(Page):
promote_panels = [
MultiFieldPanel(
[FieldPanel("seo_title"), FieldPanel("search_description")],
[
HelpPanel(
"Název stránky na předchozím tabu slouží k rozlišení stránek "
"v Majáku. V prohlížeči a SEO metadatech se zobrazí tento titulek."
),
FieldPanel("seo_title"),
FieldPanel("search_description"),
ImageChooserPanel("search_image"),
],
gettext_lazy("Common page configuration"),
),
]
......
{% load static wagtailuserbar wagtailcore_tags %}
{% load static wagtailuserbar wagtailcore_tags wagtailmetadata_tags %}
<!doctype html>
<html lang="cs">
<head>
<meta charset="utf-8">
<title>{% firstof page.seo_title page.title %}</title>
<meta name="description" content="{{ page.search_description }}">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">
<meta name="author" content="Piráti">
{% meta_tags %}
<script src="https://kit.fontawesome.com/cbdc6198f3.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="{% static "shared/vendor/bootstrap-4.4.1/css/bootstrap.min.css" %}">
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto+Condensed:wght@300;400;700&family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment