Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _data/overviews-ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
文字列補間は、ユーザーが加工文字列リテラル(processed string literal)に変数参照を直接埋め込めるようにしてくれる。以下例。
<pre><code>val name = "James"
println(s"Hello, $name") // Hello, James</code></pre>
上記例では、リテラル <code>s"Hello, $name"</code> は加工文字列リテラルだ。これはコンパイラーがこのリテラルに追加の仕事をしていることを意味する。加工文字列リテラルは <code>"</code> に先行するいくつかの文字で示される。文字列補間は <a href="/sips/string-interpolation.html">SIP-11</a> で導入され、そこには実装の全詳細が含まれる。
上記例では、リテラル <code>s"Hello, $name"</code> は加工文字列リテラルだ。これはコンパイラーがこのリテラルに追加の仕事をしていることを意味する。加工文字列リテラルは <code>"</code> に先行するいくつかの文字で示される。文字列補間は <a href="/sips/11">SIP-11</a> で導入され、そこには実装の全詳細が含まれる。
- title: 暗黙クラス
by: Josh Suereth
description: "Scala 2.10 は暗黙クラス(implicit class)と呼ばれる新しい機能を導入した。暗黙クラスは implicit キーワードでマークされたクラスだ。このキーワードはそのクラスがスコープ内にあるとき、そのプライマリコンストラクターが暗黙変換に利用可能にする。"
Expand Down
17 changes: 16 additions & 1 deletion _plugins/sip_number_permalink.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# This plugin allows using front matter variables in permalinks.
# This plugin allows using front matter variables in permalinks and redirect_from.
# For example: permalink: /sips/:number will use the 'number' front matter field.

Jekyll::Hooks.register :site, :after_init do
Expand All @@ -10,3 +10,18 @@ def number
end
end
end

# Expand :number and :title in redirect_from values
Jekyll::Hooks.register :documents, :pre_render do |doc|
next unless doc.data["redirect_from"]

redirects = doc.data["redirect_from"]
redirects = [redirects] unless redirects.is_a?(Array)

doc.data["redirect_from"] = redirects.map do |redirect|
result = redirect
result = result.gsub(":number", doc.data["number"].to_s) if doc.data["number"]
result = result.gsub(":title", Jekyll::Utils.slugify(doc.data["title"])) if doc.data["title"]
result
end
end