Skip to content

Commit 3f165aa

Browse files
committed
precedence: offline > localhost
1 parent 42efd4d commit 3f165aa

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ sourcecode:
33
root: "https://github.com/CoderDojoPotsdam/intro/blob/master/"
44
keep_files:
55
- offline
6+
local_server: "http://localhost:25444"

_includes/tutorial.html

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111
{%- for link in tutorial.links -%}
1212
{%- if link.offline -%}
1313
<span class="offline">
14-
{%- endif -%}
15-
{%- include lang-link.html text=link.name href=link.url -%}
16-
{%- if forloop.last -%}{%- else %} | {% endif -%}
17-
{%- if link.offline -%}
14+
{% include lang-link.html text=link.name href=link.url -%} |
1815
</span>
16+
<span class="local">
17+
{%- assign local_link = site.local_server | append: "/" | append: link.url -%}
18+
{%- include lang-link.html text=link.name href=local_link -%}
19+
{%- else -%}
20+
<span class="online">
21+
{% include lang-link.html text=link.name href=link.url -%}
1922
{%- endif -%}
23+
{%- if forloop.last -%}{%- else %} | {% endif %}
24+
</span>
2025
{% endfor -%}
2126
{%- endif -%}
2227
</div>

_layouts/overview.html

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<link href="css/fonts.css" rel="stylesheet"/>
1010
<link href="css/grid.css" rel="stylesheet"/>
1111
<link href="css/deactivate-offline.css" rel="stylesheet"/>
12+
<link href="{{ site.local_server }}/offline/activate_localhost.css" rel="stylesheet"/>
1213
<link href="offline/activate.css" rel="stylesheet"/>
1314
</head>
1415
<body>

css/deactivate-offline.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
/*
22
* This css file deactivates all the offline supported links.
3-
*
3+
* And the local links.
44
*/
55

66
.offline {
77
display: none;
88
}
99

10+
.local {
11+
display: none;
12+
}
13+
1014
@import url("../offline/activate.css");

0 commit comments

Comments
 (0)