Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #173

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
DB_PORT=(str, ""),
WHITENOISE_STATIC=(bool, False),
ADMIN_URL=(str, "admin"),
BLOG_TITLE=(str, "stuartm.nz"),
SITE_TITLE=(str, "stuartm.nz"),
POST_PREFIX=(str, "{{ year }}/{{ month }}"),
MASTODON_ACCESS_TOKEN=(str, ""),
RESEND_API_KEY=(str, ""),
Expand Down Expand Up @@ -269,7 +269,7 @@

# DJPress settings
DJPRESS_SETTINGS = {
"BLOG_TITLE": env("BLOG_TITLE"),
"SITE_TITLE": env("SITE_TITLE"),
"POST_PREFIX": env("POST_PREFIX"),
"THEME": "stuartmnz",
"MARKDOWN_RENDERER": "config.markdown_renderer.mistune_renderer",
Expand Down
6 changes: 6 additions & 0 deletions config/settings_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@
]

CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}}

# DJPress settings
DJPRESS_SETTINGS = {
"POST_PREFIX": "{{ year }}/{{ month }}",
"PLUGINS": [],
}
2 changes: 1 addition & 1 deletion docker-compose-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
- "SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT}"
- "SENTRY_DSN=${SENTRY_DSN}"
- "SENTRY_TRACES_SAMPLE_RATE=${SENTRY_TRACES_SAMPLE_RATE}"
- "BLOG_TITLE=${BLOG_TITLE}"
- "SITE_TITLE=${SITE_TITLE}"
- "POST_PREFIX=${POST_PREFIX}"
- "POST_PERMALINK=${POST_PERMALINK}"
- "ARCHIVES_PATH_ENABLED=${ARCHIVES_PATH_ENABLED}"
Expand Down
2 changes: 1 addition & 1 deletion env.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ADMIN_URL=
SENTRY_ENVIRONMENT=
SENTRY_DSN=
SENTRY_TRACES_SAMPLE_RATE=
BLOG_TITLE=
SITE_TITLE=
POST_PREFIX=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "stuartm-nz"
version = "0.14.0"
version = "0.15.0"
description = "stuartm.nz"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"django-environ>=0.11.2",
"django~=5.1.0",
"djpress~=0.14.0",
"djpress~=0.15.0",
"whitenoise>=6.7.0",
"gunicorn>=23.0.0",
"rich>=13.8.1",
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '_base.html' %}
{% load djpress_tags static %}

{% block title %}{% blog_page_title post_text="| " %}{% blog_title %}{% endblock %}
{% block title %}{% page_title post_text="| " %}{% site_title %}{% endblock %}

{% block css %}
<link href="{% static "css/pico.jade.min.css" %}" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion templates/snippets/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<nav class="container">
<ul>
<li class="brand"><strong>{% blog_title_link link_class="secondary" %}</strong></li>
<li class="brand"><strong>{% site_title_link link_class="secondary" %}</strong></li>
</ul>

{% comment %} Pages menu {% endcomment %}
Expand Down
6 changes: 5 additions & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ def test_archives(client, test_post1) -> None:
@pytest.mark.django_db
def test_single_post(client, test_post1) -> None:
"""Test single post view."""
url = f"/{test_post1.date.year}/{test_post1.date.month:02}/test-post1/"
response: HttpResponse = client.get(url)
assert response.status_code == 200
assert "Test Post1" in str(response.content)

test_post1.date = timezone.make_aware(timezone.datetime(2024, 6, 1))
test_post1.save()

url = "/2024/06/test-post1/"
response: HttpResponse = client.get(url)
assert response.status_code == 200
Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading