Compare commits
No commits in common. "7794003791fedb11066f8d4074ec12cef65b6762" and "cf6f1b6d654d761197f3b126653c7c353ce8f7eb" have entirely different histories.
7794003791
...
cf6f1b6d65
15 changed files with 6 additions and 214 deletions
|
@ -1,6 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class BaseConfig(AppConfig):
|
|
||||||
default_auto_field = "django.db.models.BigAutoField"
|
|
||||||
name = "base"
|
|
|
@ -1,51 +0,0 @@
|
||||||
# Generated by Django 5.0.6 on 2024-06-14 13:23
|
|
||||||
|
|
||||||
import django.db.models.deletion
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("wagtailcore", "0093_uploadedfile"),
|
|
||||||
("wagtailimages", "0026_delete_uploadedimage"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name="SiteSettings",
|
|
||||||
fields=[
|
|
||||||
(
|
|
||||||
"id",
|
|
||||||
models.BigAutoField(
|
|
||||||
auto_created=True,
|
|
||||||
primary_key=True,
|
|
||||||
serialize=False,
|
|
||||||
verbose_name="ID",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"logo",
|
|
||||||
models.ForeignKey(
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
related_name="+",
|
|
||||||
to="wagtailimages.image",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"site",
|
|
||||||
models.OneToOneField(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="wagtailcore.site",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
"abstract": False,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Generated by Django 5.0.6 on 2024-06-14 13:46
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
("base", "0001_initial"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="sitesettings",
|
|
||||||
name="title",
|
|
||||||
field=models.CharField(blank=True, max_length=32),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,20 +0,0 @@
|
||||||
from django.db import models
|
|
||||||
from wagtail.admin.panels import FieldPanel
|
|
||||||
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
|
|
||||||
|
|
||||||
|
|
||||||
@register_setting
|
|
||||||
class SiteSettings(BaseSiteSetting):
|
|
||||||
title = models.CharField(max_length=32, blank=True)
|
|
||||||
logo = models.ForeignKey(
|
|
||||||
"wagtailimages.Image",
|
|
||||||
on_delete=models.CASCADE,
|
|
||||||
related_name="+",
|
|
||||||
null=True,
|
|
||||||
blank=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
panels = [
|
|
||||||
FieldPanel("title"),
|
|
||||||
FieldPanel("logo"),
|
|
||||||
]
|
|
|
@ -24,12 +24,10 @@ BASE_DIR = os.path.dirname(PROJECT_DIR)
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
"base",
|
|
||||||
"home",
|
"home",
|
||||||
"search",
|
"search",
|
||||||
"wagtail.contrib.forms",
|
"wagtail.contrib.forms",
|
||||||
"wagtail.contrib.redirects",
|
"wagtail.contrib.redirects",
|
||||||
"wagtail.contrib.settings",
|
|
||||||
"wagtail.embeds",
|
"wagtail.embeds",
|
||||||
"wagtail.sites",
|
"wagtail.sites",
|
||||||
"wagtail.users",
|
"wagtail.users",
|
||||||
|
@ -75,7 +73,6 @@ TEMPLATES = [
|
||||||
"django.template.context_processors.request",
|
"django.template.context_processors.request",
|
||||||
"django.contrib.auth.context_processors.auth",
|
"django.contrib.auth.context_processors.auth",
|
||||||
"django.contrib.messages.context_processors.messages",
|
"django.contrib.messages.context_processors.messages",
|
||||||
"wagtail.contrib.settings.context_processors.settings",
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -94,8 +91,6 @@ DATABASES = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
||||||
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
||||||
|
@ -194,5 +189,3 @@ WAGTAILDOCS_EXTENSIONS = [
|
||||||
"xlsx",
|
"xlsx",
|
||||||
"zip",
|
"zip",
|
||||||
]
|
]
|
||||||
|
|
||||||
WAGTAILIMAGES_EXTENSIONS = ["gif", "jpg", "jpeg", "png", "webp", "svg"]
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
:root {
|
|
||||||
--pico-font-family: InterVariable, sans-serif;
|
|
||||||
--pico-font-weight: 350;
|
|
||||||
font-feature-settings: "ss01", "ss02", "ss03";
|
|
||||||
}
|
|
||||||
h1, h2, h3 {
|
|
||||||
--pico-font-weight: 250;
|
|
||||||
}
|
|
||||||
h4, h5, h6 {
|
|
||||||
--pico-font-weight: 700;
|
|
||||||
}
|
|
||||||
strong {
|
|
||||||
--pico-font-weight: 550;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav img {
|
|
||||||
height: 2rem;
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% load static wagtailcore_tags wagtailimages_tags wagtailuserbar %}
|
{% load static wagtailcore_tags wagtailuserbar %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -25,16 +25,13 @@
|
||||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
|
||||||
<link rel="preconnect" href="https://cdn.jsdelivr.net/">
|
<link rel="preconnect" href="https://cdn.jsdelivr.net/">
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.lime.min.css" />
|
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.fluid.classless.lime.min.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'css/blog.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'css/blog.css' %}">
|
||||||
{% block extra_css %}{# Override this in templates to add extra stylesheets #}{% endblock %}
|
{% block extra_css %}{# Override this in templates to add extra stylesheets #}{% endblock %}
|
||||||
{% image settings.base.SiteSettings.logo width-32 format-png preserve-svg as favicon %}
|
|
||||||
<link rel="icon" href="{{ favicon.url }}">
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% wagtailuserbar %}
|
{% wagtailuserbar %}
|
||||||
{% include "nav.html" %}
|
<main>
|
||||||
<main class="container">
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</main>
|
</main>
|
||||||
{# Global javascript #}
|
{# Global javascript #}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
{% load wagtailimages_tags %}
|
|
||||||
<nav class="container">
|
|
||||||
<ul>
|
|
||||||
<li>{% srcset_image settings.base.SiteSettings.logo height-{32,64} format-png preserve-svg %}</li>
|
|
||||||
{% if settings.base.SiteSettings.title %}
|
|
||||||
<li>
|
|
||||||
<a href="/">
|
|
||||||
<strong>{{ settings.base.SiteSettings.title }}</strong>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li>Lien</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
|
@ -1,25 +0,0 @@
|
||||||
# Generated by Django 5.0.6 on 2024-06-14 13:04
|
|
||||||
|
|
||||||
import django.db.models.deletion
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
("home", "0003_homepage_body_homepagelink"),
|
|
||||||
("wagtailimages", "0026_delete_uploadedimage"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="homepage",
|
|
||||||
name="logo",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
related_name="+",
|
|
||||||
to="wagtailimages.image",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,16 +0,0 @@
|
||||||
# Generated by Django 5.0.6 on 2024-06-14 13:18
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
("home", "0004_homepage_logo"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name="homepage",
|
|
||||||
name="logo",
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,19 +0,0 @@
|
||||||
# Generated by Django 5.0.6 on 2024-06-14 13:24
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
("home", "0005_remove_homepage_logo"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="homepagelink",
|
|
||||||
name="id",
|
|
||||||
field=models.BigAutoField(
|
|
||||||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -10,7 +10,7 @@ class HomePage(Page):
|
||||||
|
|
||||||
content_panels = Page.content_panels + [
|
content_panels = Page.content_panels + [
|
||||||
FieldPanel("body"),
|
FieldPanel("body"),
|
||||||
InlinePanel("links", heading="Links", label="Link"),
|
InlinePanel("links"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,7 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load wagtailcore_tags %}
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
{% if page.body %}
|
<section>
|
||||||
<section>
|
{% for link in page.links.all %}<a href="{{ link.link }}"><article>{{ link.title }}</article></a>{% endfor %}
|
||||||
{{ page.body|richtext }}
|
|
||||||
</section>
|
|
||||||
{% endif %}
|
|
||||||
<section class="grid">
|
|
||||||
{% for link in page.links.all %}
|
|
||||||
<a href="{{ link.link }}">
|
|
||||||
<article>{{ link.title }}</article>
|
|
||||||
</a>
|
|
||||||
{% endfor %}
|
|
||||||
</section>
|
</section>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
Loading…
Reference in a new issue