Skip to content

Commit

Permalink
Adding styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed May 20, 2017
1 parent 74bc6d6 commit 4cc0564
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 13 deletions.
Expand Up @@ -23,5 +23,13 @@
</ul>
</nav>
{% endif %}
{% if other_archive_languages %}
<div class="translationslist translations">
<h3 class="translationslist-intro">{{ messages("Also available in:") }}</h3>
{% for language, archive_path, _ in other_archive_languages %}
<p><a href="{{ _link('archive', archive_path, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }}</a></p>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endmacro %}
3 changes: 3 additions & 0 deletions nikola/data/themes/base-jinja/templates/archiveindex.tmpl
Expand Up @@ -11,6 +11,9 @@
{% elif generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ archive_name }} archive" href="{{ _link("archive_atom", archive_name) }}">
{% endif %}
{% for language, archive_path, _ in other_archive_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link('archive', archive_path, language) }}">
{% endfor %}
{% endblock %}

{% block content_header %}
Expand Down
8 changes: 8 additions & 0 deletions nikola/data/themes/base-jinja/templates/list.tmpl
Expand Up @@ -2,6 +2,14 @@
{% extends 'base.tmpl' %}
{% import 'archive_navigation_helper.tmpl' as archive_nav with context %}

{% block extra_head %}
{% if 'archive_page' in pagekind %}
{% for language, archive_path, _ in other_archive_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link('archive', archive_path, language) }}">
{% endfor %}
{% endif %}
{% endblock %}

{% block content %}
<article class="listpage">
<header>
Expand Down
8 changes: 8 additions & 0 deletions nikola/data/themes/base-jinja/templates/list_post.tmpl
Expand Up @@ -2,6 +2,14 @@
{% extends 'base.tmpl' %}
{% import 'archive_navigation_helper.tmpl' as archive_nav with context %}

{% block extra_head %}
{% if 'archive_page' in pagekind %}
{% for language, archive_path, _ in other_archive_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link('archive', archive_path, language) }}">
{% endfor %}
{% endif %}
{% endblock %}

{% block content %}
<article class="listpage">
<header>
Expand Down
16 changes: 14 additions & 2 deletions nikola/data/themes/base/assets/css/theme.css
Expand Up @@ -84,7 +84,7 @@ body {
float: left;
}

.posttranslations h3 {
.posttranslations h3, .translationslist h3 {
display: inline;
font-size: 1em;
}
Expand All @@ -93,10 +93,22 @@ body {
font-size: 2em;
}

.posttranslations h3:last-child {
.posttranslations h3:last-child, .translationslist h3:last-child {
display: none;
}

.translationslist p:before {
content: " — ";
}

.translationslist p:first-of-type:before {
content: "";
}

.translationslist p {
display: inline;
}

.postindex article {
border-bottom: 1px solid #4F5151;
padding-bottom: 1em;
Expand Down
12 changes: 5 additions & 7 deletions nikola/data/themes/base/templates/archive_navigation_helper.tmpl
Expand Up @@ -24,14 +24,12 @@
</nav>
%endif
%if other_archive_languages:
<nav class="archivelang">
<h3 class="posttranslations-intro">${messages("Also available in:")}</h3>
<ul>
%for language, archive_path, title in other_archive_languages:
<li><a href="${_link('archive', archive_path, language)}" rel="alternate">${messages("LANGUAGE", language)} (${title|h})</a></li>
<div class="translationslist translations">
<h3 class="translationslist-intro">${messages("Also available in:")}</h3>
%for language, archive_path, _ in other_archive_languages:
<p><a href="${_link('archive', archive_path, language)}" rel="alternate">${messages("LANGUAGE", language)}</a></p>
%endfor
</ul>
</nav>
</div>
%endif
% endif
</%def>
16 changes: 14 additions & 2 deletions nikola/data/themes/bootstrap3-jinja/assets/css/theme.css
Expand Up @@ -130,16 +130,28 @@ article.post-micro {
display: inline;
}

.posttranslations h3 {
.posttranslations h3, .translationslist h3 {
display: inline;
font-size: 1em;
font-weight: bold;
}

.posttranslations h3:last-child {
.posttranslations h3:last-child, .translationslist h3:last-child {
display: none;
}

.translationslist p:before {
content: " — ";
}

.translationslist p:first-of-type:before {
content: "";
}

.translationslist p {
display: inline;
}

.entry-content {
margin-top: 1em;
}
Expand Down
7 changes: 7 additions & 0 deletions nikola/data/themes/bootstrap3-jinja/templates/gallery.tmpl
Expand Up @@ -49,6 +49,13 @@
width: 100%;
}
</style>
{% if translations|length > 1 %}
{% for langname in translations.keys() %}
{% if langname != lang %}
<link rel="alternate" hreflang="{{ langname }}" href="{{ _link('gallery', gallery_path, langname) }}">
{% endif %}
{% endfor %}
{% endif %}
{% endblock %}


Expand Down
16 changes: 14 additions & 2 deletions nikola/data/themes/bootstrap3/assets/css/theme.css
Expand Up @@ -130,16 +130,28 @@ article.post-micro {
display: inline;
}

.posttranslations h3 {
.posttranslations h3, .translationslist h3 {
display: inline;
font-size: 1em;
font-weight: bold;
}

.posttranslations h3:last-child {
.posttranslations h3:last-child, .translationslist h3:last-child {
display: none;
}

.translationslist p:before {
content: " — ";
}

.translationslist p:first-of-type:before {
content: "";
}

.translationslist p {
display: inline;
}

.entry-content {
margin-top: 1em;
}
Expand Down

0 comments on commit 4cc0564

Please sign in to comment.