more changes to css theming; it should now be much more responsive, have less FOUC's and not load a bunch of unused css when it isn't in use.

This commit is contained in:
Robert Clarke 2019-05-07 13:46:46 +01:00
parent 1e88a4bdcf
commit 09c17330d6
4 changed files with 104 additions and 81 deletions

View file

@ -16,23 +16,20 @@
{% block title %}{{ config.title }}{% endblock title %}
</title>
{% block css %}
{{ index_macros::css() }}
{% endblock css %}
{{ index_macros::css() }}
{% if config.extra.zulma_allow_theme_selection %}
<script type="text/javascript" src="{{ get_url(path="js/switchcss.js") }}"></script>
{% endif %}
{% if config.generate_rss %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") | safe }}">
{% endif %}
{% block js %}
{% if config.build_search_index %}
<script defer type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") }}"></script>
<script defer type="text/javascript" src="{{ get_url(path="search_index.en.js") }}"></script>
{% endif %}
{% if config.extra.zulma_allow_theme_selection %}
<script type="text/javascript" src="{{ get_url(path="js/switchcss.js") }}"></script>
{% endif %}
{% endblock js %}
{% block extra_head %}
{% endblock extra_head %}
@ -79,9 +76,11 @@
{% endif %}
<!-- END PAGINATION -->
</div>
{{ index_macros::footer() }}
</main>
{% endblock content %}
{% block footer %}
{{ index_macros::footer() }}
{% endblock footer %}
<script type="text/javascript" src="{{ get_url(path="js/bulma.js") }}"></script>

View file

@ -125,24 +125,10 @@
{% endmacro footer %}
{% macro css() %}
{% if config.extra.zulma_allow_theme_selection %}
{% for theme in config.extra.zulma_themes %}
{% if config.extra.zulma_theme %}
{% set default_theme = config.extra.zulma_theme %}
<link id="{{config.extra.zulma_theme}}" class="stylesheet" rel="stylesheet"
href="{{ get_url(path=config.extra.zulma_theme ~ ".css", trailing_slash=false) }}" />
{% else %}
{% set default_theme = "default" %}
{% endif %}
{% if default_theme == theme %}
<link id="{{theme}}" class="stylesheet" rel="stylesheet"
href="{{ get_url(path=theme ~ ".css", trailing_slash=false) }}" />
{% else %}
<link id="{{theme}}" class="alternate stylesheet" media="none" rel="stylesheet"
href="{{ get_url(path=theme ~ ".css", trailing_slash=false) }}" />
{% endif %}
{% endfor %}
{% elif config.extra.zulma_theme %}
<link rel="stylesheet" href="{{ get_url(path=config.extra.zulma_theme ~ ".css", trailing_slash=false) }}" />
{% else %}
<link rel="stylesheet" href="{{ get_url(path="default.css", trailing_slash=false) }}" />
<link id="default" class="stylesheet" rel="stylesheet" href="{{ get_url(path="default.css", trailing_slash=false) }}" />
{% endif %}
{% endmacro css %}

View file

@ -7,23 +7,25 @@
{{ super() }}
{% endblock header %}
<!-- END NAV -->
<section class="container">
<div class="columns is-desktop">
<div class="column is-10-desktop is-offset-1-desktop">
<article itemscope itemtype="http://schema.org/BlogPosting">
<div class="card article">
<div class="card-content">
{{ post_macros::article_header(page = page) }}
<div itemprop="articleBody" class="content article-body">
{{ page.content | safe }}
<main>
<section class="container">
<div class="columns is-desktop">
<div class="column is-10-desktop is-offset-1-desktop">
<article itemscope itemtype="http://schema.org/BlogPosting">
<div class="card article">
<div class="card-content">
{{ post_macros::article_header(page = page) }}
<div itemprop="articleBody" class="content article-body">
{{ page.content | safe }}
</div>
</div>
{% block page_footer %}
{{ post_macros::post_footer(page=page) }}
{% endblock page_footer %}
</div>
{% block page_footer %}
{{ post_macros::post_footer(page=page) }}
{% endblock page_footer %}
</div>
</article>
</article>
</div>
</div>
</div>
</section>
</section>
</main>
{% endblock content %}