Skip to content

Commit

Permalink
Add EOL warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kyanagi committed Dec 5, 2024
1 parent 2a2028a commit 747a2a5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/bitclust/catalog/ja_JP.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,7 @@ module %s
%sモジュール
object %s
%sオブジェクト
This reference manual is for a version of Ruby that is no longer maintained.
このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。
Latest version
最新版URL
6 changes: 6 additions & 0 deletions data/bitclust/template/layout
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<link rel="search" type="application/opensearchdescription+xml" title="<%= _('Ruby %s Reference Manual', ruby_version()) %>" href="<%=h opensearchdescription_url() %>">
</head>
<body>
<% if eol?() %>
<p class="eol-warning">
<%= _('This reference manual is for a version of Ruby that is no longer maintained.') %>
<a href="https://www.ruby-lang.org/ja/documentation/"><%= _('Latest version') %></a>
</p>
<% end %>
<%= yield %>
<div id="footer">
<a rel="license" href="https://creativecommons.org/licenses/by/3.0/">
Expand Down
6 changes: 6 additions & 0 deletions lib/bitclust/screen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ def meta_description
%Q(<meta name="description" content="">)
end

MINIMUM_SUPPORTED_RUBY_VERSION = '3.1'

def eol?
/\A\d(\.\d)+\z/ =~ ruby_version && ruby_version < MINIMUM_SUPPORTED_RUBY_VERSION
end

private

def default_encoding
Expand Down
11 changes: 11 additions & 0 deletions theme/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,17 @@ hr {
right: 10px;
}

.eol-warning {
background-color: #aa3333;
color: white;
padding: 0.4em;
}

.eol-warning a {
color: white;
text-decoration: underline;
}

@media only screen and (max-width:425px) {
table.entries tr {
display: block;
Expand Down

0 comments on commit 747a2a5

Please sign in to comment.