diff --git a/README.md b/README.md index fb2eb30..fe6b7c4 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,8 @@ Caddyfile iamkonstantin.eu reverse_proxy :8000 -``` \ No newline at end of file +``` + + +Tailwind: https://django-tailwind.readthedocs.io/en/latest/index.html + diff --git a/blog/templates/blog/blog_page.html b/blog/templates/blog/blog_page.html index f5980db..e5d4fbd 100644 --- a/blog/templates/blog/blog_page.html +++ b/blog/templates/blog/blog_page.html @@ -26,25 +26,29 @@ {{ page.body }} - {% for item in page.gallery_images.all %} -
- {% image item.image fill-320x240 %} -

{{ item.caption }}

-
- {% endfor %} +
+ {% for item in page.gallery_images.all %} +
+ {% image item.image fill-320x240 %} +

{{ item.caption }}

+
+ {% endfor %} +

Return to blog

{% with tags=page.tags.all %} - {% if tags %} -
-

Tags

- {% for tag in tags %} - {{ tag }} - {% endfor %} -
- {% endif %} + {% if tags %} +
+

Tags

+ +
+ {% endif %} -{% endwith %} + {% endwith %} {% endblock %} \ No newline at end of file diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html index 62c3e69..efe4851 100644 --- a/home/templates/home/home_page.html +++ b/home/templates/home/home_page.html @@ -1,10 +1,10 @@ {% extends "base.html" %} {% load wagtailcore_tags wagtailimages_tags %} -{% block body_class %}template-homepage{% endblock %} +{% block body_class %}{% endblock %} {% block content %} -
+

{{ page.title }}

{% image page.image fill-480x320 %}

{{ page.hero_text }}

@@ -13,7 +13,7 @@ {% firstof page.hero_cta page.hero_cta_link.title %} {% endif %} -
+ {{ page.body|richtext }} {% endblock content %} \ No newline at end of file diff --git a/iamkonstantin_web/settings/base.py b/iamkonstantin_web/settings/base.py index edf4a86..c207151 100644 --- a/iamkonstantin_web/settings/base.py +++ b/iamkonstantin_web/settings/base.py @@ -50,6 +50,9 @@ INSTALLED_APPS = [ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "tailwind", + "theme", + "django_browser_reload" ] MIDDLEWARE = [ @@ -61,7 +64,8 @@ MIDDLEWARE = [ "django.middleware.clickjacking.XFrameOptionsMiddleware", "django.middleware.security.SecurityMiddleware", "wagtail.contrib.redirects.middleware.RedirectMiddleware", - "blog.middleware.BlogRedirectMiddleware" + "blog.middleware.BlogRedirectMiddleware", + "django_browser_reload.middleware.BrowserReloadMiddleware" ] ROOT_URLCONF = "iamkonstantin_web.urls" @@ -197,4 +201,10 @@ WAGTAIL_CODE_BLOCK_LANGUAGES = ( ('yaml', 'YAML'), ) -WAGTAIL_CODE_BLOCK_THEME = 'twilight' \ No newline at end of file +WAGTAIL_CODE_BLOCK_THEME = 'twilight' + +TAILWIND_APP_NAME = 'theme' + +INTERNAL_IPS = [ + "127.0.0.1", +] \ No newline at end of file diff --git a/iamkonstantin_web/static/css/iamkonstantin_web.css b/iamkonstantin_web/static/css/iamkonstantin_web.css index 2a1d3de..0de4b85 100644 --- a/iamkonstantin_web/static/css/iamkonstantin_web.css +++ b/iamkonstantin_web/static/css/iamkonstantin_web.css @@ -1,26 +1,3 @@ -*, -::before, -::after { - box-sizing: border-box; -} - -html { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif, Apple Color Emoji, "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; -} - -body { - min-height: 100vh; - max-width: 800px; - margin: 0 auto; - padding: 10px; - display: grid; - gap: 3vw; - grid-template-rows: min-content 1fr min-content; -} - -a { - color: currentColor; -} footer { border-top: 2px dotted; @@ -31,10 +8,6 @@ header { border-bottom: 2px dotted; } -.template-homepage main { - text-align: center; -} - .skip-link { position: absolute; top: -30px; @@ -42,22 +15,4 @@ header { .skip-link:focus-visible { top: 5px; -} - -.page-form label { - display: block; - margin-top: 10px; - margin-bottom: 5px; -} - -.page-form :is(textarea, input, select) { - width: 100%; - max-width: 500px; - min-height: 40px; - margin-top: 5px; - margin-bottom: 10px; -} - -.page-form .helptext { - font-style: italic; } \ No newline at end of file diff --git a/iamkonstantin_web/templates/base.html b/iamkonstantin_web/templates/base.html index 3b91b65..79b4747 100644 --- a/iamkonstantin_web/templates/base.html +++ b/iamkonstantin_web/templates/base.html @@ -1,4 +1,4 @@ -{% load static wagtailcore_tags %} +{% load static wagtailcore_tags tailwind_tags %} @@ -16,7 +16,9 @@ {% if page.search_description %} {% endif %} - + + + {% tailwind_css %} {# Force all links in the live preview panel to be opened in a new tab #} {% if request.in_preview_panel %} @@ -37,7 +39,7 @@ {% endblock %} - + {% include "includes/header.html" %} diff --git a/iamkonstantin_web/urls.py b/iamkonstantin_web/urls.py index c2e8a0c..98d4e4a 100644 --- a/iamkonstantin_web/urls.py +++ b/iamkonstantin_web/urls.py @@ -23,6 +23,7 @@ if settings.DEBUG: # Serve static and media files from development server urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns += path("__reload__/", include("django_browser_reload.urls")), urlpatterns = urlpatterns + [ # For anything not caught by a more specific rule above, hand over to diff --git a/requirements.txt b/requirements.txt index 4d9c980..16afd8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ Django>=4.2,<5.1 wagtail>=6.0,<6.1 whitenoise>=6.6,<7.0 -wagtailcodeblock>=1.29.0.2,<2.0 \ No newline at end of file +wagtailcodeblock>=1.29.0.2,<2.0 +django-tailwind>=3.8.0,<4.0 +django-browser-reload>=1.12 \ No newline at end of file diff --git a/search/templates/search/search.html b/search/templates/search/search.html index 8fd268f..c914e66 100644 --- a/search/templates/search/search.html +++ b/search/templates/search/search.html @@ -6,44 +6,59 @@ {% block title %}Search{% endblock %} {% block content %} -

Search

+

Search

-
- - -
+
+
+ +
+ +
-{% if search_results %} +
+ +
+
-{# Add this paragraph to display the details of results found: #} -

You searched{% if search_query %} for “{{ search_query }}”{% endif %}, {{ search_results.paginator.count }} result{{ search_results.paginator.count|pluralize }} found.

-{# Replace the