Compare commits
1 commit
master
...
renovate/p
Author | SHA1 | Date | |
---|---|---|---|
8fe058ffd2 |
16 changed files with 1140 additions and 341 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
version: '3.7'
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build:
|
build:
|
||||||
|
|
1345
package-lock.json
generated
1345
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"
|
"stylelint-config-standard-scss": "6.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/fira-code": "5.0.18",
|
"@fontsource/fira-code": "5.0.2",
|
||||||
"@fortawesome/fontawesome-free": "6.5.2",
|
"@fortawesome/fontawesome-free": "6.5.2",
|
||||||
"@ledge/is-ie-11": "7.0.0",
|
"@ledge/is-ie-11": "7.0.0",
|
||||||
"bulma": "0.9.4",
|
"bulma": "0.9.4",
|
||||||
"elevator.js": "1.0.1",
|
"elevator.js": "1.0.1",
|
||||||
"esbuild": "0.20.2",
|
"esbuild": "0.20.2",
|
||||||
"glightbox": "3.3.0",
|
"glightbox": "3.3.0",
|
||||||
"htmx.org": "2.0.1",
|
"htmx.org": "1.9.2",
|
||||||
"lite-youtube-embed": "0.3.2",
|
"lite-youtube-embed": "0.3.0",
|
||||||
"lodash.clamp": "4.0.3",
|
"lodash.clamp": "4.0.3",
|
||||||
"lodash.debounce": "4.0.8",
|
"lodash.debounce": "4.0.8",
|
||||||
"lodash.throttle": "4.1.1",
|
"lodash.throttle": "4.1.1",
|
||||||
"npm-run-all2": "5.0.0",
|
"npm-run-all": "4.1.5",
|
||||||
"sass": "1.75.0",
|
"sass": "1.75.0",
|
||||||
"shareon": "2.4.0"
|
"shareon": "2.4.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:base",
|
"config:base"
|
||||||
"replacements:all",
|
|
||||||
"workarounds:all"
|
|
||||||
],
|
],
|
||||||
"prConcurrentLimit": 0,
|
"prConcurrentLimit": 0,
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchUpdateTypes": ["patch"],
|
||||||
|
"schedule": ["every weekend"],
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
],
|
||||||
"regexManagers": [
|
"regexManagers": [
|
||||||
{
|
{
|
||||||
"fileMatch": ["^Dockerfile$"],
|
"fileMatch": ["^Dockerfile$"],
|
||||||
|
@ -13,6 +18,5 @@
|
||||||
"depNameTemplate": "just-containers/s6-overlay",
|
"depNameTemplate": "just-containers/s6-overlay",
|
||||||
"datasourceTemplate": "github-releases"
|
"datasourceTemplate": "github-releases"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"dependencyDashboardApproval": true
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
Django==4.2.15
|
Django==5.0.4
|
||||||
wagtail==5.2.6
|
wagtail==5.2.5
|
||||||
django-environ==0.11.2
|
django-environ==0.11.2
|
||||||
whitenoise[brotli]==6.6.0
|
whitenoise[brotli]==6.6.0
|
||||||
Pygments==2.18.0
|
Pygments==2.17.2
|
||||||
beautifulsoup4[lxml]
|
beautifulsoup4
|
||||||
|
lxml==5.2.1
|
||||||
requests
|
requests
|
||||||
wagtail-generic-chooser==0.6
|
wagtail-generic-chooser==0.6
|
||||||
django-redis==5.4.0
|
django-redis==5.4.0
|
||||||
gunicorn==22.0.0
|
gunicorn==22.0.0
|
||||||
psycopg==3.1.18
|
psycopg==3.2.1
|
||||||
djangorestframework
|
djangorestframework
|
||||||
django-htmx==1.17.2
|
django-htmx==1.17.2
|
||||||
wagtail-metadata==5.0.0
|
wagtail-metadata==5.0.0
|
||||||
|
@ -28,7 +29,7 @@ django-proxy==1.2.2
|
||||||
wagtail-lite-youtube-embed==0.1.0
|
wagtail-lite-youtube-embed==0.1.0
|
||||||
django-minify-html==1.7.1
|
django-minify-html==1.7.1
|
||||||
metadata-parser==0.12.1
|
metadata-parser==0.12.1
|
||||||
django-tasks==0.3.0
|
django-tasks==0.2.0
|
||||||
lightningcss==0.2.0
|
lightningcss==0.2.0
|
||||||
|
|
||||||
# DRF OpenAPI dependencies
|
# DRF OpenAPI dependencies
|
||||||
|
|
|
@ -3,7 +3,6 @@ const STORAGE_KEY = "dark-mode";
|
||||||
|
|
||||||
const htmlTag = document.getElementsByTagName("html")[0];
|
const htmlTag = document.getElementsByTagName("html")[0];
|
||||||
const darkModeToggle = document.getElementById("dark-mode-toggle");
|
const darkModeToggle = document.getElementById("dark-mode-toggle");
|
||||||
const comentarioComments = document.getElementsByTagName("comentario-comments");
|
|
||||||
|
|
||||||
const matchesDarkMode = window.matchMedia("(prefers-color-scheme: dark)");
|
const matchesDarkMode = window.matchMedia("(prefers-color-scheme: dark)");
|
||||||
|
|
||||||
|
@ -15,10 +14,6 @@ function handleDarkMode(darkMode) {
|
||||||
} else {
|
} else {
|
||||||
htmlTag.classList.remove(DARK_MODE_CLASS);
|
htmlTag.classList.remove(DARK_MODE_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const commentElement of comentarioComments) {
|
|
||||||
commentElement.setAttribute("theme", darkMode ? "dark" : "light");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.localStorage.getItem(STORAGE_KEY) === null) {
|
if (window.localStorage.getItem(STORAGE_KEY) === null) {
|
||||||
|
|
46
static/src/scss/_comments.scss
Normal file
46
static/src/scss/_comments.scss
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
#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,6 +67,5 @@ section.content {
|
||||||
}
|
}
|
||||||
|
|
||||||
#comments {
|
#comments {
|
||||||
margin-top: 2rem;
|
|
||||||
scroll-margin-top: var(--hero-height); // hero height (ish)
|
scroll-margin-top: var(--hero-height); // hero height (ish)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
@import "spotify";
|
@import "spotify";
|
||||||
@import "404";
|
@import "404";
|
||||||
@import "password_required";
|
@import "password_required";
|
||||||
|
@import "comments";
|
||||||
@import "similar_content";
|
@import "similar_content";
|
||||||
@import "support_pill";
|
@import "support_pill";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from django.db.models.functions import Cast, Coalesce
|
||||||
from django.http import HttpRequest, HttpResponse, HttpResponsePermanentRedirect
|
from django.http import HttpRequest, HttpResponse, HttpResponsePermanentRedirect
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from metadata_parser import ParsedResult
|
from metadata_parser import MetadataParser
|
||||||
from modelcluster.fields import ParentalManyToManyField
|
from modelcluster.fields import ParentalManyToManyField
|
||||||
from wagtail.admin.panels import FieldPanel
|
from wagtail.admin.panels import FieldPanel
|
||||||
from wagtail.models import Page, PageQuerySet, Site
|
from wagtail.models import Page, PageQuerySet, Site
|
||||||
|
@ -239,7 +239,7 @@ class ExternalBlogPostPage(BaseContentPage):
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def metadata(self) -> ParsedResult:
|
def metadata(self) -> MetadataParser:
|
||||||
return get_page_metadata(self.external_url)
|
return get_page_metadata(self.external_url)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import pickle
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
|
@ -98,9 +96,7 @@ class ExternalBlogPostPageTestCase(TestCase):
|
||||||
def setUpTestData(cls) -> None:
|
def setUpTestData(cls) -> None:
|
||||||
cls.home_page = HomePage.objects.get()
|
cls.home_page = HomePage.objects.get()
|
||||||
cls.blog_post_list_page = BlogPostListPageFactory(parent=cls.home_page)
|
cls.blog_post_list_page = BlogPostListPageFactory(parent=cls.home_page)
|
||||||
cls.page = ExternalBlogPostPageFactory(
|
cls.page = ExternalBlogPostPageFactory(parent=cls.blog_post_list_page)
|
||||||
parent=cls.blog_post_list_page, external_url="https://example.com"
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_redirects(self) -> None:
|
def test_redirects(self) -> None:
|
||||||
with self.assertNumQueries(10):
|
with self.assertNumQueries(10):
|
||||||
|
@ -111,11 +107,3 @@ class ExternalBlogPostPageTestCase(TestCase):
|
||||||
status_code=301,
|
status_code=301,
|
||||||
fetch_redirect_response=False,
|
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.http.request import HttpRequest
|
||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
from django_cache_decorator import django_cache_decorator
|
from django_cache_decorator import django_cache_decorator
|
||||||
from metadata_parser import MetadataParser, ParsedResult
|
from metadata_parser import MetadataParser
|
||||||
from wagtail.models import Page, Site
|
from wagtail.models import Page, Site
|
||||||
from wagtail.models import get_page_models as get_wagtail_page_models
|
from wagtail.models import get_page_models as get_wagtail_page_models
|
||||||
|
|
||||||
|
@ -128,13 +128,8 @@ def get_ai_robots_txt() -> str:
|
||||||
|
|
||||||
|
|
||||||
@django_cache_decorator(time=21600)
|
@django_cache_decorator(time=21600)
|
||||||
def get_page_metadata(url: str) -> ParsedResult:
|
def get_page_metadata(url: str) -> MetadataParser:
|
||||||
metadata = MetadataParser(url=url, search_head_only=True).parsed_result
|
return MetadataParser(url=url, search_head_only=True)
|
||||||
|
|
||||||
# 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:
|
def extend_query_params(url: str, params: dict[str, Any]) -> str:
|
||||||
|
|
|
@ -12,14 +12,6 @@ class TalksListPage(BaseListingPage):
|
||||||
max_count = 1
|
max_count = 1
|
||||||
subpage_types = ["talks.TalkPage"]
|
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):
|
class TalkPage(BaseContentPage):
|
||||||
subpage_types: list[Any] = []
|
subpage_types: list[Any] = []
|
||||||
|
|
|
@ -37,7 +37,7 @@ class TalksListPageTestCase(TestCase):
|
||||||
self.assertEqual(len(response.context["listing_pages"]), 2)
|
self.assertEqual(len(response.context["listing_pages"]), 2)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(34):
|
with self.assertNumQueries(35):
|
||||||
self.client.get(self.page.url)
|
self.client.get(self.page.url)
|
||||||
|
|
||||||
def test_feed_accessible(self) -> None:
|
def test_feed_accessible(self) -> None:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
"base_url": "https://matrix.theorangeone.net"
|
"base_url": "https://matrix.jakehoward.tech"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"m.server": "matrix.theorangeone.net:443"}
|
{"m.server": "matrix.jakehoward.tech:443"}
|
||||||
|
|
Loading…
Reference in a new issue