Adding Right-to-Left support for template (#875)

This commit is contained in:
Hamid Reza
2020-11-01 13:24:57 +03:30
committed by GitHub
parent b17b3d40da
commit caecc2c98e
2 changed files with 12 additions and 0 deletions

View File

@@ -445,3 +445,11 @@ h5 {
a strong { a strong {
color: #268bd2; color: #268bd2;
} }
.right-to-left {
direction: rtl;
}
.left-to-right, .right-to-left pre {
direction: ltr;
}

View File

@@ -33,11 +33,13 @@
{% endblock toc_aside %} {% endblock toc_aside %}
{% block main %} {% block main %}
<div class="{% if page.extra.rtl %}right-to-left{% endif %}">
<h1>{{ page.title }}</h1> <h1>{{ page.title }}</h1>
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date"> <time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
{{ page.date | date(format="%b %d, %Y") }} {{ page.date | date(format="%b %d, %Y") }}
{% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %} {% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %}
</time> </time>
</div>
{% if page.extra.warning %} {% if page.extra.warning %}
<div class="warning"> <div class="warning">
@@ -67,7 +69,9 @@
</div> </div>
{% endif %} {% endif %}
<div class="{% if page.extra.rtl %}right-to-left{% endif %}">
{{ page.content | replace(from="<!-- toc -->", to=macros::toc(toc=page.toc)) | safe }} {{ page.content | replace(from="<!-- toc -->", to=macros::toc(toc=page.toc)) | safe }}
</div>
<div class="post-footer-support"> <div class="post-footer-support">
<h2>Support Me</h2> <h2>Support Me</h2>