diff --git a/.dockerignore b/.dockerignore index bb246a0..fa8fa40 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -.idea/ # Django project /media/ /static/ diff --git a/.idea/iamkonstantin-web.iml b/.idea/iamkonstantin-web.iml index 79d7ae9..4a1b312 100644 --- a/.idea/iamkonstantin-web.iml +++ b/.idea/iamkonstantin-web.iml @@ -15,9 +15,8 @@ - - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 6de942c..d0b0933 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 1b241e0..92c6246 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use an official Python runtime based on Debian 10 "buster" as a parent image. -FROM python:3.13-slim +FROM python:3.11-slim-buster # Add user that will be used in the container. # RUN useradd wagtail @@ -15,10 +15,10 @@ ENV PYTHONUNBUFFERED=1 \ PORT=8000 # Install system packages required by Wagtail and Django. -RUN apt-get update --yes --quiet && apt-get install --yes --no-install-recommends \ -# build-essential \ -# libpq-dev \ -# libmariadbclient-dev \ +RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \ + build-essential \ + libpq-dev \ + libmariadbclient-dev \ libjpeg62-turbo-dev \ zlib1g-dev \ libwebp-dev \ diff --git a/Makefile b/Makefile index 9fc9251..e2885df 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: help build publish -VERSION = 1.5.0 +VERSION = 1.2.2 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}' @@ -8,8 +8,7 @@ build: @docker build -t code.headbright.be/konstantin/iamkonstantin:$(VERSION) . publish: - # something to try: --provenance=false - @docker buildx build -t code.headbright.be/konstantin/iamkonstantin:$(VERSION) --platform linux/arm64 --push . + @docker push code.headbright.be/konstantin/iamkonstantin:$(VERSION) bump: @bash ./bump_version.sh upgrade: build publish \ No newline at end of file diff --git a/base/migrations/0007_remove_formpage_page_ptr_delete_formfield_and_more.py b/base/migrations/0007_remove_formpage_page_ptr_delete_formfield_and_more.py deleted file mode 100644 index 637011d..0000000 --- a/base/migrations/0007_remove_formpage_page_ptr_delete_formfield_and_more.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 5.0.2 on 2024-10-06 15:19 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0006_navigationsettings_bluesky_url_and_more'), - ] - - operations = [ - migrations.RemoveField( - model_name='formpage', - name='page_ptr', - ), - migrations.DeleteModel( - name='FormField', - ), - migrations.DeleteModel( - name='FormPage', - ), - ] diff --git a/base/models.py b/base/models.py index 748e1f0..a590d8c 100644 --- a/base/models.py +++ b/base/models.py @@ -76,25 +76,25 @@ class FooterText( class Meta(TranslatableMixin.Meta): verbose_name_plural = "Footer Text" -# -# class FormField(AbstractFormField): -# page = ParentalKey('FormPage', on_delete=models.CASCADE, related_name='form_fields') -# -# -# class FormPage(AbstractEmailForm): -# intro = RichTextField(blank=True) -# thank_you_text = RichTextField(blank=True) -# -# content_panels = AbstractEmailForm.content_panels + [ -# FormSubmissionsPanel(), -# FieldPanel('intro'), -# InlinePanel('form_fields', label="Form fields"), -# FieldPanel('thank_you_text'), -# MultiFieldPanel([ -# FieldRowPanel([ -# FieldPanel('from_address'), -# FieldPanel('to_address'), -# ]), -# FieldPanel('subject'), -# ], "Email"), -# ] + +class FormField(AbstractFormField): + page = ParentalKey('FormPage', on_delete=models.CASCADE, related_name='form_fields') + + +class FormPage(AbstractEmailForm): + intro = RichTextField(blank=True) + thank_you_text = RichTextField(blank=True) + + content_panels = AbstractEmailForm.content_panels + [ + FormSubmissionsPanel(), + FieldPanel('intro'), + InlinePanel('form_fields', label="Form fields"), + FieldPanel('thank_you_text'), + MultiFieldPanel([ + FieldRowPanel([ + FieldPanel('from_address'), + FieldPanel('to_address'), + ]), + FieldPanel('subject'), + ], "Email"), + ] diff --git a/blog/templates/blog/blog_index_page.html b/blog/templates/blog/blog_index_page.html index da226bd..fd44827 100644 --- a/blog/templates/blog/blog_index_page.html +++ b/blog/templates/blog/blog_index_page.html @@ -15,54 +15,55 @@
{% for post in blogpages %} {% with post=post.specific %} -
-
-

- - - {{ post.title }} - -

-

{{ post.intro }}

-
- {% if post.main_image %} -
- {% with post.main_image as main_image %} - {% if main_image %} - {% image main_image width-1600 class="blog" %}{% endif %} - {% endwith %} -
-
- {% endif %} -
-
- -
- - {% with tags=post.tags.all %} - {% if tags %} -
-

Tags

-
    - {% for tag in tags %} -
  • 🏷️ - {{ tag }} -
  • - {% endfor %} -
-
- {% endif %} +
+
+

+ + + {{ post.title }} + +

+

{{ post.intro }}

+
+ {% if post.main_image %} +
+ {% with post.main_image as main_image %} + {% if main_image %} + {% image main_image width-1600 class="blog" %}{% endif %} {% endwith %} +
+ {% endif %} +
+
+ +
+ + {% with tags=post.tags.all %} + {% if tags %} +
+

Tags

+
    + {% for tag in tags %} +
  • 🏷️ + {{ tag }} +
  • + {% endfor %} +
+
+ {% endif %} + {% endwith %} +
+
{% endwith %} {% endfor %} - +
- + {% endblock %} \ No newline at end of file diff --git a/blog/templates/blog/blog_page.html b/blog/templates/blog/blog_page.html index c790824..5e85027 100644 --- a/blog/templates/blog/blog_page.html +++ b/blog/templates/blog/blog_page.html @@ -80,7 +80,4 @@ -
- {% include 'newsletter/snippets/signup_form.html' %} -
{% endblock %} \ No newline at end of file diff --git a/home/models.py b/home/models.py index 140aece..34d4bb1 100644 --- a/home/models.py +++ b/home/models.py @@ -4,8 +4,6 @@ from wagtail.models import Page from wagtail.fields import RichTextField, StreamField from wagtail.admin.panels import FieldPanel, MultiFieldPanel from wagtailseo.models import SeoMixin, SeoType - -from blog.models import BlogPage from .blocks import HomeContentBlock @@ -59,10 +57,3 @@ class HomePage(SeoMixin, Page): promote_panels = SeoMixin.seo_panels seo_content_type = SeoType.WEBSITE - - def get_context(self, request, *args, **kwargs): - context = super().get_context(request) - # retrieve the last 3 blogposts - recent_blog_items = BlogPage.objects.live().order_by('-first_published_at')[:3] - context['recent_blog_items'] = recent_blog_items - return context \ No newline at end of file diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html index 161686a..e54aff8 100644 --- a/home/templates/home/home_page.html +++ b/home/templates/home/home_page.html @@ -5,19 +5,749 @@ {% block content %}
- Drawing of my computer desk where we see a computer with an open Terminal - with Elixir code snippets. On the shelf behind we can see programming - books for Rust, Elixir and JavaScript. The books are arranges vertically - next to a small flower pot. The flower has big green leaves. A cup of - steaming coffee sits on the desk, to the left of the computer. The cup has a Python logo on it. + Drawing of my computer desk where we see an iMac with an open Terminal + with Swift code snippets. On the shelf behind we can see programming + books for Rust, Swift and JavaScript. The books are arranges vertically + next to a small flower pot. The flower has big green leafes. A cup of + steaming coffee sits on the desk, to the left of the iMac.
- +
-
+

@@ -45,43 +775,10 @@

-
-

From the blog

-
    - {% for post in recent_blog_items %} - {% with post=post.specific %} -
    -
    -

    - - - {{ post.title }} - -

    -

    {{ post.intro }}

    -
    - {% if post.main_image %} -
    - {% with post.main_image as main_image %} - {% if main_image %} - {% image main_image width-1600 class="blog" %}{% endif %} - {% endwith %} -
    -
    - {% endif %} -
    - {% endwith %} - {% endfor %} -
-
-
{{ page.body }}
-
- {% include 'newsletter/snippets/signup_form.html' %} -
{% endblock content %} \ No newline at end of file diff --git a/iamkonstantin_web/settings/base.py b/iamkonstantin_web/settings/base.py index 44ac0f7..be1a823 100644 --- a/iamkonstantin_web/settings/base.py +++ b/iamkonstantin_web/settings/base.py @@ -29,7 +29,6 @@ INSTALLED_APPS = [ "blog", "home", "search", - "newsletter", "wagtailcodeblock", "wagtailseo", "wagtail.contrib.settings", diff --git a/iamkonstantin_web/templates/base.html b/iamkonstantin_web/templates/base.html index 90c1c93..48dd9f2 100644 --- a/iamkonstantin_web/templates/base.html +++ b/iamkonstantin_web/templates/base.html @@ -4,7 +4,7 @@ - + {% include "wagtailseo/meta.html" %} {% block title %} @@ -64,7 +64,7 @@ <div class="relative w-full sm:px-8"> {% include "includes/header.html" %} - <main id="main" class="mx-auto max-w-5xl px-0 md:px-4 lg:px-8"> + <main id="main" class="mx-auto max-w-7xl px-0 md:px-4 lg:px-8"> {% block content %}{% endblock %} </main> diff --git a/iamkonstantin_web/urls.py b/iamkonstantin_web/urls.py index d53a50e..1a7982a 100644 --- a/iamkonstantin_web/urls.py +++ b/iamkonstantin_web/urls.py @@ -8,7 +8,6 @@ from wagtail import urls as wagtail_urls from wagtail.documents import urls as wagtaildocs_urls from blog.feeds import RssBlogFeed -from newsletter import views as newsletter_views from search import views as search_views from wagtail.contrib.sitemaps.views import sitemap from base.views import KeyView @@ -21,8 +20,7 @@ urlpatterns = [ path("blog/feed/", RssBlogFeed(), name="blog_feed"), path('sitemap.xml', sitemap), path('robots.txt', TemplateView.as_view(template_name="robots.txt", content_type="text/plain")), - path('<str:key>.txt', KeyView.as_view()), - path('newsletter/thanks', newsletter_views.thanks, name='thanks') + path('<str:key>.txt', KeyView.as_view()) ] if settings.DEBUG: diff --git a/newsletter/__init__.py b/newsletter/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/newsletter/admin.py b/newsletter/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/newsletter/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/newsletter/apps.py b/newsletter/apps.py deleted file mode 100644 index 76e54c1..0000000 --- a/newsletter/apps.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class NewsletterConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'newsletter' diff --git a/newsletter/migrations/__init__.py b/newsletter/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/newsletter/models.py b/newsletter/models.py deleted file mode 100644 index 71a8362..0000000 --- a/newsletter/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/newsletter/templates/newsletter/snippets/signup_form.html b/newsletter/templates/newsletter/snippets/signup_form.html deleted file mode 100644 index 500fc82..0000000 --- a/newsletter/templates/newsletter/snippets/signup_form.html +++ /dev/null @@ -1,4 +0,0 @@ -<div class="py-16 sm:py-24 lg:py-32"> - <iframe data-w-type="embedded" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://sgx7y.mjt.lu/wgt/sgx7y/xtn1/form?c=c9b8015e" width="100%" style="height: 0;"></iframe> -<script type="text/javascript" src="https://app.mailjet.com/pas-nc-embedded-v1.js"></script> -</div> \ No newline at end of file diff --git a/newsletter/templates/newsletter/thanks.html b/newsletter/templates/newsletter/thanks.html deleted file mode 100644 index cf6b061..0000000 --- a/newsletter/templates/newsletter/thanks.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base.html" %} -{% load static wagtailcore_tags %} - -{% block title %}Newsletter{% endblock %} - -{% block content %} - <div class="min-h-96 flex flex-col"> - <section class="flex-grow h-full px-0 md:px-4 lg:px-8"> - <div class="px-0 md:px-4 lg:px-8"> - <h1>Thank you</h1> - Your newsletter subscription is confirmed. - </div> - </section> - </div> -{% endblock %} \ No newline at end of file diff --git a/newsletter/tests.py b/newsletter/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/newsletter/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/newsletter/views.py b/newsletter/views.py deleted file mode 100644 index d15538c..0000000 --- a/newsletter/views.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.template.response import TemplateResponse - - -def thanks(request): - return TemplateResponse( - request, - "newsletter/thanks.html", - ) diff --git a/requirements.txt b/requirements.txt index 69558ab..a373c2a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -Django>=4.2,<5.2 -wagtail>=6.3,<6.4 +Django>=4.2,<5.1 +wagtail>=6.2.2,<6.3 whitenoise>=6.6,<7.0 wagtailcodeblock>=1.29.0.2,<2.0 django-tailwind>=3.6.0 diff --git a/theme/static/images/my-office.png b/theme/static/images/my-office.png deleted file mode 100644 index a83e1ba..0000000 Binary files a/theme/static/images/my-office.png and /dev/null differ