Compare commits
18 commits
renovate/p
...
master
Author | SHA1 | Date | |
---|---|---|---|
ea73189b9c | |||
0bd43a4bee | |||
9788b8e4dd | |||
7d4a9647d4 | |||
4cfb0a896e | |||
09dbbc407b | |||
040647b506 | |||
4134426823 | |||
451c2d4cf9 | |||
5e34485fec | |||
91de1fcf19 | |||
009b4926a4 | |||
1822f1c4d5 | |||
a8fe244ab4 | |||
df84b28114 | |||
a25e83a0df | |||
46669c9b17 | |||
41a04af8dc |
16 changed files with 341 additions and 1140 deletions
|
@ -1,4 +1,3 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
|
|
1343
package-lock.json
generated
1343
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base"
|
||||
"config:base",
|
||||
"replacements:all",
|
||||
"workarounds:all"
|
||||
],
|
||||
"prConcurrentLimit": 0,
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": ["patch"],
|
||||
"schedule": ["every weekend"],
|
||||
"enabled": false
|
||||
}
|
||||
],
|
||||
"regexManagers": [
|
||||
{
|
||||
"fileMatch": ["^Dockerfile$"],
|
||||
|
@ -18,5 +13,6 @@
|
|||
"depNameTemplate": "just-containers/s6-overlay",
|
||||
"datasourceTemplate": "github-releases"
|
||||
}
|
||||
]
|
||||
],
|
||||
"dependencyDashboardApproval": true
|
||||
}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
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.17.2
|
||||
beautifulsoup4
|
||||
lxml==5.2.1
|
||||
Pygments==2.18.0
|
||||
beautifulsoup4[lxml]
|
||||
requests
|
||||
wagtail-generic-chooser==0.6
|
||||
django-redis==5.4.0
|
||||
gunicorn==22.0.0
|
||||
psycopg==3.2.1
|
||||
psycopg==3.1.18
|
||||
djangorestframework
|
||||
django-htmx==1.17.2
|
||||
wagtail-metadata==5.0.0
|
||||
|
@ -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.3.0
|
||||
lightningcss==0.2.0
|
||||
|
||||
# DRF OpenAPI dependencies
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -67,5 +67,6 @@ section.content {
|
|||
}
|
||||
|
||||
#comments {
|
||||
margin-top: 2rem;
|
||||
scroll-margin-top: var(--hero-height); // hero height (ish)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
@import "spotify";
|
||||
@import "404";
|
||||
@import "password_required";
|
||||
@import "comments";
|
||||
@import "similar_content";
|
||||
@import "support_pill";
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ from django.db.models.functions import Cast, Coalesce
|
|||
from django.http import HttpRequest, HttpResponse, HttpResponsePermanentRedirect
|
||||
from django.utils import timezone
|
||||
from django.utils.functional import cached_property
|
||||
from metadata_parser import MetadataParser
|
||||
from metadata_parser import ParsedResult
|
||||
from modelcluster.fields import ParentalManyToManyField
|
||||
from wagtail.admin.panels import FieldPanel
|
||||
from wagtail.models import Page, PageQuerySet, Site
|
||||
|
@ -239,7 +239,7 @@ class ExternalBlogPostPage(BaseContentPage):
|
|||
return tags
|
||||
|
||||
@cached_property
|
||||
def metadata(self) -> MetadataParser:
|
||||
def metadata(self) -> ParsedResult:
|
||||
return get_page_metadata(self.external_url)
|
||||
|
||||
@cached_property
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import pickle
|
||||
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
|
||||
|
@ -96,7 +98,9 @@ class ExternalBlogPostPageTestCase(TestCase):
|
|||
def setUpTestData(cls) -> None:
|
||||
cls.home_page = HomePage.objects.get()
|
||||
cls.blog_post_list_page = BlogPostListPageFactory(parent=cls.home_page)
|
||||
cls.page = ExternalBlogPostPageFactory(parent=cls.blog_post_list_page)
|
||||
cls.page = ExternalBlogPostPageFactory(
|
||||
parent=cls.blog_post_list_page, external_url="https://example.com"
|
||||
)
|
||||
|
||||
def test_redirects(self) -> None:
|
||||
with self.assertNumQueries(10):
|
||||
|
@ -107,3 +111,11 @@ class ExternalBlogPostPageTestCase(TestCase):
|
|||
status_code=301,
|
||||
fetch_redirect_response=False,
|
||||
)
|
||||
|
||||
def test_metadata(self) -> None:
|
||||
metadata = self.page.metadata
|
||||
|
||||
self.assertIsNone(metadata.soup)
|
||||
|
||||
# Confirm it can pickle
|
||||
pickle.dumps(metadata)
|
||||
|
|
|
@ -11,7 +11,7 @@ from django.http import QueryDict
|
|||
from django.http.request import HttpRequest
|
||||
from django.utils.text import slugify
|
||||
from django_cache_decorator import django_cache_decorator
|
||||
from metadata_parser import MetadataParser
|
||||
from metadata_parser import MetadataParser, ParsedResult
|
||||
from wagtail.models import Page, Site
|
||||
from wagtail.models import get_page_models as get_wagtail_page_models
|
||||
|
||||
|
@ -128,8 +128,13 @@ def get_ai_robots_txt() -> str:
|
|||
|
||||
|
||||
@django_cache_decorator(time=21600)
|
||||
def get_page_metadata(url: str) -> MetadataParser:
|
||||
return MetadataParser(url=url, search_head_only=True)
|
||||
def get_page_metadata(url: str) -> ParsedResult:
|
||||
metadata = MetadataParser(url=url, search_head_only=True).parsed_result
|
||||
|
||||
# HACK: BeautifulSoup doesn't pickle nicely, and so can't be cached
|
||||
metadata.soup = None
|
||||
|
||||
return metadata
|
||||
|
||||
|
||||
def extend_query_params(url: str, params: dict[str, Any]) -> str:
|
||||
|
|
|
@ -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] = []
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"m.homeserver": {
|
||||
"base_url": "https://matrix.jakehoward.tech"
|
||||
"base_url": "https://matrix.theorangeone.net"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"m.server": "matrix.jakehoward.tech:443"}
|
||||
{"m.server": "matrix.theorangeone.net:443"}
|
||||
|
|
Loading…
Reference in a new issue