Skip to content

Commit aac607b

Browse files
authored
Merge pull request scala#6596 from exoego/older-version-notice
Add older version notice & version in spec title
2 parents bd76826 + 2f91930 commit aac607b

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

spec/_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
baseurl: /files/archive/spec/2.12
2+
latestScalaVersion: 2.12
3+
thisScalaVersion: 2.12
24
safe: true
35
lsi: false
46
highlighter: false

spec/_includes/version-notice.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% if site.thisScalaVersion != site.latestScalaVersion %}
2+
<div class="version-notice">This is the specification of a previous version of Scala. See the <a href="{{ site.baseurl}}/../{{ site.latestScalaVersion }}/">Scala {{ site.latestScalaVersion }} spec</a>.</div>
3+
{% endif %}

spec/_layouts/default.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,26 @@
2626
<link rel="stylesheet" type="text/css" media="(max-width: 1400px), (orientation: portrait)" href="public/stylesheets/screen-small.css">
2727
<link rel="stylesheet" type="text/css" media="print" href="public/stylesheets/print.css">
2828
<link rel="stylesheet" type="text/css" href="public/stylesheets/fonts.css">
29-
<title>{{ page.title }}</title>
29+
<title>{{ page.title }} | Scala {{ site.thisScalaVersion }}</title>
3030
</head>
3131

3232
<body>
3333
<header>
34-
<nav id="chapters"><a id="github" href="https://github.com/scala/scala/tree/2.12.x/spec"><img src="public/images/[email protected]" alt="Edit at GitHub"></a>{% assign sorted_pages = site.pages | sort:"name" %}{% for post in sorted_pages %}{% if post.chapter >= 0 %}<a href="{{site.baseurl}}{{ post.url }}">{{post.chapter}} {{ post.title }}</a>{% endif %}{% endfor %}</nav>
34+
<nav id="chapters">
35+
<a href="{{site.baseurl}}/" title="Table of Contents">Scala {{ site.thisScalaVersion }}</a>
36+
<a id="github" href="https://github.com/scala/scala/tree/2.12.x/spec"><img src="public/images/[email protected]" alt="Edit at GitHub"></a>
37+
{% assign sorted_pages = site.pages | sort:"name" %}
38+
{% for post in sorted_pages %}
39+
{% if post.chapter >= 0 %}
40+
<a href="{{site.baseurl}}{{ post.url }}">{{post.chapter}} {{ post.title }}</a>
41+
{% endif %}
42+
{% endfor %}
43+
</nav>
3544
</header>
3645
<aside class="left"><nav id="toc"></nav></aside>
3746

3847
<main id="content">
48+
{% include version-notice.yml %}
3949
{{ content }}
4050
</main>
4151

spec/_layouts/toc.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link rel="shortcut icon" type="image/png" href="public/favicon.ico">
88

99
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
10-
<title>{{ page.title }}</title>
10+
<title>{{ page.title }} | Scala {{ site.thisScalaVersion }}</title>
1111

1212
<link rel="stylesheet" type="text/css" href="public/stylesheets/screen.css">
1313
<link rel="stylesheet" type="text/css" href="public/stylesheets/screen-toc.css">
@@ -19,11 +19,12 @@
1919
<div id="header-main">
2020
<img id="scala-logo" src="public/images/scala-spiral-white.png" />
2121
<span id="title">Scala Language Specification</span>
22-
<a id="github" href="https://github.com/scala/scala/tree/2.12.x/spec"><img src="public/images/[email protected]" alt="Edit at GitHub"></a>
22+
<a id="github" href="https://github.com/scala/scala/tree/{{ site.thisScalaVersion }}.x/spec"><img src="public/images/[email protected]" alt="Edit at GitHub"></a>
2323
</div>
24-
<div id="header-sub">Version 2.12</div>
24+
<div id="header-sub">Version {{ site.thisScalaVersion }}</div>
2525
</header>
2626
<main>
27+
{% include version-notice.yml %}
2728
{{ content }}
2829
</main>
2930
</body>

spec/public/stylesheets/screen.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,3 +502,16 @@ header {
502502
/* proper rendering of MathJax into highlighted code blocks */
503503
.fixws { white-space: pre; }
504504
.fixws .math { white-space: nowrap; }
505+
506+
.version-notice {
507+
background-color: #C93A3A;
508+
color: #f2f2f2;
509+
border:1px solid #ccc;
510+
padding: 1em;
511+
margin-bottom: 1em;
512+
}
513+
.version-notice a {
514+
color: #f2f2f2;
515+
font-weight: bold;
516+
text-decoration: underline;
517+
}

0 commit comments

Comments
 (0)