Compare commits

...

17 commits

Author SHA1 Message Date
b08c4a69f6
Link to Mastodon account
https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/
2024-10-17 21:04:46 +01:00
62e3cd13da
Prune DB task results 2024-10-01 21:28:24 +01:00
d211e2b27b
Replace gunicorn with granian
More rust is more good
2024-10-01 21:08:15 +01:00
ea73189b9c
Update matrix domain 2024-09-01 16:45:01 +01:00
0bd43a4bee
Update Django 2024-08-06 14:49:29 +01:00
9788b8e4dd
Replace npm-run-all with npm-run-all2 2024-07-28 21:47:36 +01:00
7d4a9647d4
Use native dark mode for comentario 2024-07-28 21:37:04 +01:00
4cfb0a896e
Update fira-code 2024-07-28 21:12:54 +01:00
09dbbc407b
Update HTMX 2024-07-28 21:09:55 +01:00
040647b506
Update lite-youtube-embed 2024-07-28 21:00:41 +01:00
4134426823
Remove deprecated version key 2024-07-28 20:53:40 +01:00
451c2d4cf9
Update django-tasks 2024-07-28 20:45:12 +01:00
5e34485fec
Update Wagtail to 5.2.6 2024-07-28 20:41:08 +01:00
91de1fcf19
Unpin lxml, and use bs4 extra 2024-07-28 20:38:59 +01:00
009b4926a4
Order talks by date 2024-07-11 11:35:55 +01:00
1822f1c4d5
Use LTS version of Django
This is supported for much longer, and I don't seem to be using any of the 5.0 features
2024-07-10 18:40:42 +01:00
a8fe244ab4
Update Django 2024-07-10 17:36:15 +01:00
18 changed files with 324 additions and 1142 deletions

View file

@ -109,12 +109,6 @@ djlint:
script:
- djlint website/ --lint --check
gunicorn_check:
extends: .python_test_template
script:
- apt-get update && apt-get install --yes libpq-dev
- gunicorn --check-config --config etc/gunicorn.conf.py
npm_lint:
image: node:20-slim
stage: test

View file

@ -39,7 +39,14 @@ ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLA
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
ENV PATH=$VIRTUAL_ENV/bin:$PATH \
PYTHONUNBUFFERED=1
PYTHONUNBUFFERED=1 \
GRANIAN_INTERFACE=wsgi \
GRANIAN_HOST=0.0.0.0 \
GRANIAN_PORT=8080 \
GRANIAN_WORKERS_LIFETIME=1800 \
GRANIAN_RESPAWN_INTERVAL=10 \
GRANIAN_PROCESS_NAME=website \
GRANIAN_RESPAWN_FAILED_WORKERS=1
EXPOSE 8000

View file

@ -1,4 +1,3 @@
version: '3.7'
services:
web:
build:

View file

@ -3,4 +3,5 @@
@daily ./manage.py update_unsplash_photos
@daily ./manage.py rebuild_references_index
@weekly ./manage.py refresh_spotify_playlists
@weekly ./manage.py prune_db_task_results
*/10 * * * * ./manage.py publish_scheduled_pages

View file

@ -1,10 +0,0 @@
wsgi_app = "website.wsgi:application"
disable_redirect_access_to_syslog = True
preload_app = True
bind = "127.0.0.1:8080"
max_requests = 1200
max_requests_jitter = 50
forwarded_allow_ips = "*"
# Run additional threads so the GIL isn't sitting completely idle
threads = 4

View file

@ -4,4 +4,4 @@ set -e
cd /app
exec gunicorn -c etc/gunicorn.conf.py
exec granian website.wsgi:application

1349
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -28,19 +28,19 @@
"stylelint-config-standard-scss": "6.1.0"
},
"dependencies": {
"@fontsource/fira-code": "5.0.2",
"@fontsource/fira-code": "5.0.18",
"@fortawesome/fontawesome-free": "6.5.2",
"@ledge/is-ie-11": "7.0.0",
"bulma": "0.9.4",
"elevator.js": "1.0.1",
"esbuild": "0.20.2",
"glightbox": "3.3.0",
"htmx.org": "1.9.2",
"lite-youtube-embed": "0.3.0",
"htmx.org": "2.0.1",
"lite-youtube-embed": "0.3.2",
"lodash.clamp": "4.0.3",
"lodash.debounce": "4.0.8",
"lodash.throttle": "4.1.1",
"npm-run-all": "4.1.5",
"npm-run-all2": "5.0.0",
"sass": "1.75.0",
"shareon": "2.4.0"
}

View file

@ -1,14 +1,13 @@
Django==5.0.4
wagtail==5.2.5
Django==4.2.15
wagtail==5.2.6
django-environ==0.11.2
whitenoise[brotli]==6.6.0
Pygments==2.18.0
beautifulsoup4
lxml==5.2.1
beautifulsoup4[lxml]
requests
wagtail-generic-chooser==0.6
django-redis==5.4.0
gunicorn==22.0.0
granian[pname]==1.6.0
psycopg==3.1.18
djangorestframework
django-htmx==1.17.2
@ -29,7 +28,7 @@ django-proxy==1.2.2
wagtail-lite-youtube-embed==0.1.0
django-minify-html==1.7.1
metadata-parser==0.12.1
django-tasks==0.2.0
django-tasks==0.5.0
lightningcss==0.2.0
# DRF OpenAPI dependencies

View file

@ -3,6 +3,7 @@ const STORAGE_KEY = "dark-mode";
const htmlTag = document.getElementsByTagName("html")[0];
const darkModeToggle = document.getElementById("dark-mode-toggle");
const comentarioComments = document.getElementsByTagName("comentario-comments");
const matchesDarkMode = window.matchMedia("(prefers-color-scheme: dark)");
@ -14,6 +15,10 @@ function handleDarkMode(darkMode) {
} else {
htmlTag.classList.remove(DARK_MODE_CLASS);
}
for (const commentElement of comentarioComments) {
commentElement.setAttribute("theme", darkMode ? "dark" : "light");
}
}
if (window.localStorage.getItem(STORAGE_KEY) === null) {

View file

@ -1,46 +0,0 @@
#comments {
margin-top: 2rem;
}
.comentario-text-muted,
.comentario-root,
.comentario-card .comentario-name {
@include dark-mode {
color: $dark-mode-text !important;
}
}
.comentario-add-comment-host,
.comentario-comment-editor textarea,
.comentario-toolbar.comentario-disabled {
background-color: transparent !important;
}
.comentario-add-comment-host:not(.comentario-editor-inserted) {
border: 1px solid color.adjust($white, $alpha: -0.5) !important;
}
.comentario-comment-editor textarea {
background-color: transparent !important;
@include dark-mode {
color: $dark-mode-text !important;
}
}
.comentario-footer a {
color: $link !important;
}
.comentario-btn-link {
color: $link !important;
}
.comentario-card {
@include dark-mode {
border-top: 1px solid color.adjust($white, $alpha: -0.5);
p {
color: $dark-mode-text;
}
}
}

View file

@ -67,5 +67,6 @@ section.content {
}
#comments {
margin-top: 2rem;
scroll-margin-top: var(--hero-height); // hero height (ish)
}

View file

@ -19,7 +19,6 @@
@import "spotify";
@import "404";
@import "password_required";
@import "comments";
@import "similar_content";
@import "support_pill";

View file

@ -13,6 +13,8 @@
<meta name="article:modified_time" content="{{ object.last_published_at|date:'c' }}" />
{% if object.date %}<meta name="article:published_time" content="{{ object.date|date:'c' }}" />{% endif %}
<meta name="fediverse:creator" content="@jake@theorangeone.net" />
{% endblock %}
{% block meta %}

View file

@ -12,6 +12,14 @@ class TalksListPage(BaseListingPage):
max_count = 1
subpage_types = ["talks.TalkPage"]
def get_listing_pages(self) -> models.QuerySet:
return (
TalkPage.objects.live()
.public()
.descendant_of(self)
.order_by("-date", "title")
)
class TalkPage(BaseContentPage):
subpage_types: list[Any] = []

View file

@ -37,7 +37,7 @@ class TalksListPageTestCase(TestCase):
self.assertEqual(len(response.context["listing_pages"]), 2)
def test_queries(self) -> None:
with self.assertNumQueries(35):
with self.assertNumQueries(34):
self.client.get(self.page.url)
def test_feed_accessible(self) -> None:

View file

@ -1,5 +1,5 @@
{
"m.homeserver": {
"base_url": "https://matrix.jakehoward.tech"
"base_url": "https://matrix.theorangeone.net"
}
}

View file

@ -1 +1 @@
{"m.server": "matrix.jakehoward.tech:443"}
{"m.server": "matrix.theorangeone.net:443"}