Skip to content

Commit

Permalink
add notice to old news articles
Browse files Browse the repository at this point in the history
  • Loading branch information
tipsy committed Mar 1, 2024
1 parent 6524b54 commit 83cc8c6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions _layouts/news.html
Expand Up @@ -12,7 +12,32 @@ <h1 class="no-margin-top" itemprop="name headline">Javalin {{ page.version }} re
</div>
{% endunless %}
<div class="post-content" itemprop="articleBody">
{% assign thisMajor = page.version | split: "." | first %}
{% assign currentMajor = site.javalinversion | split: "." | first %}
{% if thisMajor < currentMajor %}
<div class="red-notice">
<strong>Important:</strong> This news article covers an old version of Javalin (v{{page.version}}).
The current version is v{{site.javalinversion}}.
<br>
See the <a href="/documentation">documentation page</a> for up-to-date information.
</div>
{% endif %}
{{ content }}
</div>
</article>
{% include socialButtons.html %}

<style>
.red-notice {
font-size: 18px;
background-color: #e53535;
border-radius: 4px;
color: #fff;
padding: 16px;
line-height: 1.6;
}
.red-notice a {
color: #fff;
text-decoration: underline;
}
</style>

0 comments on commit 83cc8c6

Please sign in to comment.