Set <base> on every page
This commit is contained in:
parent
a7e71525f4
commit
8e974e3745
2 changed files with 8 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
{% load compress favtags lemoncurry_tags meta static %}<!doctype html>
|
||||
<html lang="en" class="{% block html_class %}{% endblock %}">
|
||||
<head{% meta_namespaces %}>{% site_name as site_name %}{% request_uri request as uri %}
|
||||
<base href="{% request_origin request %}" />
|
||||
<title class="p-name">{% if title %}{{ title }} ~ {% endif %}{{ site_name }}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
|
|
|
@ -30,14 +30,18 @@ def get_package_json():
|
|||
|
||||
|
||||
@register.simple_tag
|
||||
def request_uri(request):
|
||||
return '{scheme}://{host}{path}'.format(
|
||||
def request_origin(request):
|
||||
return '{scheme}://{host}'.format(
|
||||
scheme=request.scheme,
|
||||
host=request.META['HTTP_HOST'],
|
||||
path=request.path
|
||||
)
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def request_uri(request):
|
||||
return request_origin(request) + request.path
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def site_name():
|
||||
return settings.LEMONCURRY_SITE_NAME
|
||||
|
|
Loading…
Reference in a new issue