mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-11 19:31:04 +00:00
Fix site_path tag
This commit is contained in:
parent
3ea935e7ce
commit
7ea3153026
5 changed files with 8 additions and 14 deletions
|
@ -1,5 +1,6 @@
|
||||||
""" customize the info available in context for rendering templates """
|
""" customize the info available in context for rendering templates """
|
||||||
from bookwyrm import models
|
from bookwyrm import models
|
||||||
|
from bookwyrm.settings import DOMAIN
|
||||||
|
|
||||||
|
|
||||||
def site_settings(request): # pylint: disable=unused-argument
|
def site_settings(request): # pylint: disable=unused-argument
|
||||||
|
@ -7,4 +8,5 @@ def site_settings(request): # pylint: disable=unused-argument
|
||||||
return {
|
return {
|
||||||
"site": models.SiteSettings.objects.get(),
|
"site": models.SiteSettings.objects.get(),
|
||||||
"active_announcements": models.Announcement.active_announcements(),
|
"active_announcements": models.Announcement.active_announcements(),
|
||||||
|
"site_path": "https://%s" % DOMAIN,
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
{% block title %}{{ book|book_title }}{% endblock %}
|
{% block title %}{{ book|book_title }}{% endblock %}
|
||||||
|
|
||||||
{% block opengraph_images %}
|
{% block opengraph_images %}
|
||||||
<meta name="twitter:image" content="{{ get_path }}/images/{{ book.preview_image }}">
|
<meta name="twitter:image" content="{{ site_path }}/images/{{ book.preview_image }}">
|
||||||
<meta name="og:image" content="{{ get_path }}/images/{{ book.preview_image }}">
|
<meta name="og:image" content="{{ site_path }}/images/{{ book.preview_image }}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
<meta name="og:description" content="{{ site.instance_tagline }}">
|
<meta name="og:description" content="{{ site.instance_tagline }}">
|
||||||
|
|
||||||
{% block opengraph_images %}
|
{% block opengraph_images %}
|
||||||
<meta name="twitter:image" content="{{ get_path }}/images/{{ site.preview_image }}">
|
<meta name="twitter:image" content="{{ site_path }}/images/{{ site.preview_image }}">
|
||||||
<meta name="og:image" content="{{ get_path }}/images/{{ site.preview_image }}">
|
<meta name="og:image" content="{{ site_path }}/images/{{ site.preview_image }}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<meta name="twitter:image:alt" content="BookWyrm Logo">
|
<meta name="twitter:image:alt" content="BookWyrm Logo">
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
{% block title %}{{ user.display_name }}{% endblock %}
|
{% block title %}{{ user.display_name }}{% endblock %}
|
||||||
|
|
||||||
{% block opengraph_images %}
|
{% block opengraph_images %}
|
||||||
<meta name="twitter:image" content="{{ get_path }}/images/{{ user.preview_image }}">
|
<meta name="twitter:image" content="{{ site_path }}/images/{{ user.preview_image }}">
|
||||||
<meta name="og:image" content="{{ get_path }}/images/{{ user.preview_image }}">
|
<meta name="og:image" content="{{ site_path }}/images/{{ user.preview_image }}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
""" template filters used for creating the layout"""
|
""" template filters used for creating the layout"""
|
||||||
from django import template, utils
|
from django import template, utils
|
||||||
|
|
||||||
from bookwyrm.settings import DOMAIN
|
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,9 +9,3 @@ def get_lang():
|
||||||
"""get current language, strip to the first two letters"""
|
"""get current language, strip to the first two letters"""
|
||||||
language = utils.translation.get_language()
|
language = utils.translation.get_language()
|
||||||
return language[0 : language.find("-")]
|
return language[0 : language.find("-")]
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag(takes_context=False)
|
|
||||||
def get_path():
|
|
||||||
"""get protocol and host"""
|
|
||||||
return "https://%s" % DOMAIN
|
|
||||||
|
|
Loading…
Reference in a new issue