Remove site_config file & add templates_local
This commit is contained in:
parent
8c11e02d9c
commit
e37c412fd9
9 changed files with 24 additions and 76 deletions
|
@ -1,20 +0,0 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.cache import cache
|
||||
|
||||
|
||||
def site_config(request):
|
||||
config = cache.get('site_config')
|
||||
|
||||
if not config:
|
||||
config_path = Path(settings.BASE_DIR) / 'config' / 'site_config.json'
|
||||
try:
|
||||
with open(config_path, 'r') as f:
|
||||
config = json.load(f)
|
||||
cache.set('site_config', config, 3600)
|
||||
except FileNotFoundError:
|
||||
config = {}
|
||||
|
||||
return {'site_config': config}
|
|
@ -27,35 +27,16 @@
|
|||
<div class="uk-width-1-1">
|
||||
<div class="uk-card uk-card-default uk-card-body uk-text-center">
|
||||
|
||||
<h3 class="uk-card-title">{{ site_config.about_title }}</h3>
|
||||
<h3 class="uk-card-title">Muistox gallery</h3>
|
||||
|
||||
<img class="uk-border-circle uk-box-shadow-small uk-margin-small"
|
||||
src="{% static site_config.about_profile_image %}"
|
||||
src="{% static "img/default.png" %}"
|
||||
alt="Profile photo" width="120">
|
||||
|
||||
<p class="uk-text-muted uk-margin-small">
|
||||
{{ site_config.about_description }}
|
||||
Just another wannabe photographer...
|
||||
</p>
|
||||
|
||||
<p class="uk-text-muted uk-margin-small">
|
||||
Contact:
|
||||
<a href="mailto:{{ site_config.contact_email }}">
|
||||
{{ site_config.contact_email }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div class="uk-flex uk-flex-center uk-child-width-auto uk-margin-small-top" uk-grid>
|
||||
{% if site_config.bluesky_url %}
|
||||
<a href="{{ site_config.bluesky_url }}" uk-icon="icon: bluesky" uk-tooltip="Bluesky"></a>
|
||||
{% endif %}
|
||||
{% if site_config.twitter_url %}
|
||||
<a href="{{ site_config.twitter_url }}" uk-icon="icon: twitter" uk-tooltip="Twitter"></a>
|
||||
{% endif %}
|
||||
{% if site_config.instagram_url %}
|
||||
<a href="{{ site_config.instagram_url }}" uk-icon="icon: instagram" uk-tooltip="Instagram"></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<hr class="uk-divider-icon">
|
||||
|
||||
<div class="uk-text-small uk-text-muted">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{% load image_tags %}
|
||||
|
||||
<!-- Title -->
|
||||
{% block title %}{{ site_config.description }}{% endblock %}
|
||||
{% block title %}Home{% endblock %}
|
||||
|
||||
<!-- Parallax -->
|
||||
{% block parallax %}
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
<a class="uk-position-center-left uk-position-small uk-hidden-hover" href="#" uk-slidenav-previous uk-slideshow-item="previous"></a>
|
||||
<a class="uk-position-center-right uk-position-small uk-hidden-hover" href="#" uk-slidenav-next uk-slideshow-item="next"></a>
|
||||
<div class="uk-position-top uk-padding-small">
|
||||
<h1>{{ site_config.title }}</h1>
|
||||
<h1>Gallery</h1>
|
||||
</div>
|
||||
<div class="uk-overlay uk-overlay-primary uk-position-bottom uk-padding-small">
|
||||
<p class="uk-text-small uk-margin-remove-top">{{ site_config.description }}</p>
|
||||
<p class="uk-text-small uk-margin-remove-top">Just another wannabe photographer...</p>
|
||||
</div>
|
||||
</div>
|
|
@ -4,8 +4,8 @@
|
|||
{% load static %}
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="{{ site_config.site_head_description }}">
|
||||
<title>{{ site_config.site_head_title }} : Slideshow : {{ photo.album.name }}</title>
|
||||
<meta name="description" content="Muistox Photo Gallery">
|
||||
<title>Slideshow : {{ photo.album.name }} - Gallery</title>
|
||||
{% if next_photo %}
|
||||
<meta http-equiv="refresh" content="5; url={% url 'gallery:photo_slideshow_url' next_photo.album.slug next_photo.slug %}" />
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue