Upgrade to Wagtail 5.2 #100
2 changed files with 2 additions and 8 deletions
|
@ -1,8 +1,8 @@
|
||||||
{% load util_tags %}
|
{% load wagtailcore_tags %}
|
||||||
|
|
||||||
<section class="container has-text-centered shareon-container" id="shareon">
|
<section class="container has-text-centered shareon-container" id="shareon">
|
||||||
<p>Share this page</p>
|
<p>Share this page</p>
|
||||||
<div class="shareon" data-title="{{ page.title }}" data-url="{% pagefullurl page %}">
|
<div class="shareon" data-title="{{ page.title }}" data-url="{% fullpageurl page %}">
|
||||||
<a class="facebook" title="Share on Facebook"></a>
|
<a class="facebook" title="Share on Facebook"></a>
|
||||||
<a class="linkedin" title="Share on LinkedIn"></a>
|
<a class="linkedin" title="Share on LinkedIn"></a>
|
||||||
<a class="mastodon" title="Share on Mastodon"></a>
|
<a class="mastodon" title="Share on Mastodon"></a>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.template import Library
|
from django.template import Library
|
||||||
from django.utils.encoding import force_str
|
from django.utils.encoding import force_str
|
||||||
from wagtail.models import Page
|
|
||||||
from wagtail.rich_text import RichText
|
from wagtail.rich_text import RichText
|
||||||
|
|
||||||
from website.common import utils
|
from website.common import utils
|
||||||
|
@ -13,11 +12,6 @@ def do_range(stop: int) -> range:
|
||||||
return range(stop)
|
return range(stop)
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag(takes_context=True)
|
|
||||||
def pagefullurl(context: dict, page: Page) -> str:
|
|
||||||
return page.get_full_url(context["request"])
|
|
||||||
|
|
||||||
|
|
||||||
@register.filter()
|
@register.filter()
|
||||||
def extract_text(html: str | RichText) -> str:
|
def extract_text(html: str | RichText) -> str:
|
||||||
return utils.extract_text(force_str(html))
|
return utils.extract_text(force_str(html))
|
||||||
|
|
Loading…
Reference in a new issue