File tree 8 files changed +31
-30
lines changed
8 files changed +31
-30
lines changed Original file line number Diff line number Diff line change @@ -51,19 +51,23 @@ defaults:
51
51
values :
52
52
image : https://bitcoinops.org/img/logos/optech-notext.png
53
53
breadcrumbs : true
54
+ localizable : true
54
55
- scope :
55
56
path : " _topics"
56
57
values :
57
58
layout : topic
58
59
permalink : /en/topics/:title/
60
+ localizable : false
59
61
60
62
collections :
61
63
topics :
62
64
output : true
63
65
64
66
languages :
65
- - ja
66
- - es
67
+ - code : ja
68
+ name : Japanese
69
+ - code : es
70
+ name : Spanish
67
71
68
72
# # In-text aliases
69
73
trb : " 709,632" # TapRoot Block (activation)
Original file line number Diff line number Diff line change 1
1
{% assign baseurl = page.permalink | remove_first: "/" | remove_first: page.lang %}
2
-
3
- {% for lang in site.languages %}
4
- {% assign localization = "/" | append: lang | append: baseurl %}
5
- {% assign locale = site.posts | where:"permalink", localization %}
6
- {% assign localizations = localizations | concat: locale %}
7
- {% endfor %}
2
+ <div class =" localization " >
3
+ <a href="{{ '/en' | append:baseurl }}">en</a>
4
+ {% for lang in site.languages %}
5
+ {% assign localization = "/" | append: lang.code | append:baseurl %}
6
+ {% assign locale = site.posts | where:"permalink", localization %}
7
+ {% if locale.size == 0 %}
8
+ | <span title="No {{lang.name}} translation currently available">{{ lang.code }}</span>
9
+ {% else %}
10
+ | <a href="{{ locale[0].url }}">{{lang.code}}</a>
11
+ {% endif %}
12
+ {% endfor %}
13
+ </div >
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ layout: default
7
7
<div class =" localization " >
8
8
<a href =" /en/blog/ " >en</a >
9
9
{% for lang in site.languages %}
10
- | <a href =" /{{ lang }}/blog/ " >{{lang}}</a >
10
+ | <a href =" /{{ lang.code }}/blog/ " >{{lang.code }}</a >
11
11
{% endfor %}
12
12
</div >
13
13
Original file line number Diff line number Diff line change 3
3
---
4
4
< link rel ="stylesheet " href ="/assets/css/main.css ">
5
5
6
- {% include functions/localization-finder.md %}
7
-
8
6
< article class ="newsletter ">
9
7
< header class ="post-header ">
10
- {% if localizations.size > 0 %}
11
- < div class ="localization ">
12
- < a href ="{{ '/en' | append:baseurl }} "> en</ a >
13
- {% for locale in localizations %}
14
- | < a href ="{{ locale.url }} "> {{locale.lang}}</ a >
15
- {% endfor %}
16
- </ div >
17
- {% endif %}
8
+ {% include functions/localization-finder.md %}
18
9
{% assign year = page.date | date: "%Y" %}
19
10
{% assign path = "/" | append: page.lang | append: "/newsletters/" | append: year | append: "/" %}
20
11
{% include linkers/breadcrumbs.md path=path %}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ layout: default
7
7
<div class =" localization " >
8
8
<a href =" /en/newsletters/ " >en</a >
9
9
{% for lang in site.languages %}
10
- | <a href =" /{{ lang }}/newsletters/ " >{{lang}}</a >
10
+ | <a href =" /{{ lang.code }}/newsletters/ " >{{lang.code }}</a >
11
11
{% endfor %}
12
12
</div >
13
13
Original file line number Diff line number Diff line change 3
3
---
4
4
< link rel ="stylesheet " href ="/assets/css/main.css ">
5
5
6
- {% include functions/localization-finder.md %}
6
+ {% assign baseurl = page.permalink | remove_first: "/" | remove_first: page.lang %}
7
7
8
8
< article class ="post ">
9
-
10
9
< header class ="post-header ">
11
- {% if localizations.size > 0 %}
12
- < div class ="localization ">
13
- < a href ="{{ '/en' | append:baseurl }} "> en</ a >
14
- {% for locale in localizations %}
15
- | < a href ="{{ locale.url }} "> {{locale.lang}}</ a >
16
- {% endfor %}
17
- </ div >
10
+ {% if page.localizable %}
11
+ {% include functions/localization-finder.md %}
18
12
{% endif %}
19
13
{% include linkers/breadcrumbs.md path=page.url %}
20
14
< h1 class ="post-title "> {{ page.title | escape }}</ h1 >
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ layout: default
7
7
<div class =" localization " >
8
8
<a href =" /en/publications/ " >en</a >
9
9
{% for lang in site.languages %}
10
- | <a href =" /{{ lang }}/publications/ " >{{lang}}</a >
10
+ | <a href =" /{{ lang.code }}/publications/ " >{{lang.code }}</a >
11
11
{% endfor %}
12
12
</div >
13
13
Original file line number Diff line number Diff line change @@ -249,6 +249,12 @@ div.compat-usability img
249
249
div .localization
250
250
{
251
251
text-align : right ;
252
+
253
+ span {
254
+ font-style : italic ;
255
+ color :gray ;
256
+ cursor : not-allowed ;
257
+ }
252
258
}
253
259
254
260
.pc125 {
You can’t perform that action at this time.
0 commit comments