Skip to content

Commit b4ea93d

Browse files
committed
Automatically generate release blog post
1 parent 4ae336b commit b4ea93d

16 files changed

+121
-156
lines changed

_data/translations.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ en:
1111
rss_feed: "Bitcoin Core Blog RSS Feed"
1212
rss_meetings_feed: "Meetings feed"
1313
rss_blog_feed: "Blog posts feed"
14+
released: "Bitcoin Core %version Released"
1415
release_excerpt: "Bitcoin Core version %version is now available"
1516

1617
zh_CN:
@@ -26,6 +27,7 @@ zh_CN:
2627
rss_feed: "Bitcoin Core Blog RSS Feed"
2728
rss_meetings_feed: "Meetings feed"
2829
rss_blog_feed: "Blog posts feed"
30+
released: ""
2931
release_excerpt: ""
3032

3133
zh_TW:
@@ -41,6 +43,7 @@ zh_TW:
4143
rss_feed: "Bitcoin Core Blog RSS Feed"
4244
rss_meetings_feed: "Meetings feed"
4345
rss_blog_feed: "Blog posts feed"
46+
released: ""
4447
release_excerpt: ""
4548

4649
ja:
@@ -56,6 +59,7 @@ ja:
5659
rss_feed: "Bitcoin Core Blog RSS Feed"
5760
rss_meetings_feed: "Meetings feed"
5861
rss_blog_feed: "Blog posts feed"
62+
released: "Bitcoin Core 29.0 リリース"
5963
release_excerpt: "Bitcoin Core バージョン %version が利用可能になりました"
6064

6165
es:
@@ -71,4 +75,5 @@ es:
7175
rss_feed: "Fuente RSS del Blog de Bitcoin Core"
7276
rss_meetings_feed: "Feed de reuniones"
7377
rss_blog_feed: "Feed de entradas del blog"
78+
released: "Lanzamiento de Bitcoin Core %version"
7479
release_excerpt: "Bitcoin Core versión %version ya está disponible"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Bitcoin Core version {{ page.release_version }} is now available for [download][download
2+
page]. See the [release notes][release notes] for more information about the
3+
features and bug fixes in this release.
4+
5+
With the release of this new major version, versions {{ page.eol_version }} and older are at
6+
"Maintenance End" and will no longer receive updates. In accordance with the
7+
[security policy][security policy], two weeks after this release, medium and
8+
high severity vulnerabilities affecting versions {{ page.eol_version }} (if any) will be
9+
disclosed. Additionally, low severity vulnerabilities affecting versions {{ page.old_version }}
10+
(if any) will be disclosed.
11+
12+
[release notes]: /en/releases/{{ page.release_version}}/
13+
[download page]: /en/download
14+
[security policy]: /en/security-advisories
15+
16+
{% include references.md %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Bitcoin Core version {{ page.release_version }} is now available for [download][download
2+
page]. See the [release notes][] for more information about the
3+
bug fixes in this release.
4+
5+
If you have any questions, please stop by the #bitcoin IRC chatroom
6+
([IRC][irc], [web][web irc]) and we’ll do our best to help you.
7+
8+
[release notes]: /en/releases/{{ page.release_version }}/
9+
[IRC]: irc://irc.libera.chat/bitcoin
10+
[web irc]: https://web.libera.chat/#bitcoin
11+
[download page]: /en/download
12+
13+
{% include references.md %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
La versión {{ page.release_version}} de Bitcoin Core ya está disponible para su [descarga][download
2+
page]. Vea las [notas de lanzamiento][] para más información sobre los arreglos de fallos que trae esta nueva edición.
3+
4+
Si tiene alguna pregunta, por favor diríjase a la sala de IRC #bitcoin
5+
(en idioma inglés, [IRC][irc], [web][web irc]) y haremos lo que esté
6+
en nuestras manos para ayudarle.
7+
8+
[notas de lanzamiento]: /es/releases/{{ page.release_version}}/
9+
[IRC]: irc://irc.libera.chat/bitcoin
10+
[web irc]: https://web.libera.chat/#bitcoin
11+
[download page]: /es/download
12+
13+
{% include references.md %}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Bitcoin Core バージョン {{ page.release_version }}が[ダウンロード][download page]できるようになりました。
2+
このリリースのバグ修正の詳細については、[リリースノート][release notes]をご覧ください。
3+
4+
この新しいメジャーバージョンのリリースに伴い、バージョン{{ page.eol_version }}以前のバージョンは
5+
「メンテナンス終了」となり、アップデートの提供が停止されます。
6+
[セキュリティポリシー][security policy]に従い、このリリースの2週間後に、
7+
バージョン26.xに影響する重大度中および高の脆弱性(存在する場合)が公開されます。
8+
さらに、バージョン{{ page.old_version }}に影響する重大度低の脆弱性(存在する場合)も公開されます。
9+
10+
[release notes]: /ja/releases/{{ page.release_version }}/
11+
[download page]: /ja/download
12+
[security policy]: /ja/security-advisories
13+
14+
{% include references.md %}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Bitcoin Core バージョン {{ page.release_version }}が[ダウンロード][download page]できるようになりました。
2+
このリリースのバグ修正の詳細については、[リリースノート][release notes]をご覧ください。
3+
4+
ご不明な点がありましたら、#bitcoin IRCチャットルーム([IRC][irc][web][web irc])にお立ち寄りください。
5+
可能な限り支援します。
6+
7+
[release notes]: /ja/releases/{{ page.release_version }}/
8+
[IRC]: irc://irc.libera.chat/bitcoin
9+
[web irc]: https://web.libera.chat/#bitcoin
10+
[download page]: /ja/download
11+
12+
{% include references.md %}

_plugins/release-posts.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
class ReleasePostGenerator < Jekyll::Generator
22
def generate(site)
3+
4+
release_blog_templates = {}
5+
site.data["translations"].each do |lang, _|
6+
release_blog_templates[lang] = [
7+
File.exists?(File.join(site.source, "_includes", "posts", lang, "release-blog-major.md")),
8+
File.exists?(File.join(site.source, "_includes", "posts", lang, "release-blog-minor.md")),
9+
]
10+
end
11+
312
site.documents.each do |page|
413
next unless page.data.key?("release")
514

@@ -21,6 +30,41 @@ def generate(site)
2130

2231
# Wrap the page with the download include and githubify
2332
page.content = "{% include download.html %}\n{% githubify https://github.com/bitcoin/bitcoin %}\n#{page.content}\n{% endgithubify %}"
33+
34+
# Generate the release blog post if we have the templates
35+
is_major = version[1] == 0
36+
if version[1] >= 28 and ((is_major and release_blog_templates[lang][0]) or (not is_major and release_blog_templates[lang][1]))
37+
release_blog_id = "#{lang}-blog-release-#{version_str}"
38+
if not site.posts.docs.find { |post| post.data["id"] == release_blog_id }
39+
date = page.data["date"]
40+
release_blog = Jekyll::Document.new("_posts/#{lang}/posts/#{date.strftime('%F')}-release-#{version_str}.md", site: site, collection: site.posts)
41+
release_blog.data["date"] = date
42+
release_blog.data["name"] = "blog-release-#{version_str}"
43+
release_blog.data["id"] = release_blog_id
44+
release_blog.data["lang"] = lang
45+
release_blog.data["type"] = "posts"
46+
release_blog.data["layout"] = "post"
47+
release_blog.data["version"] = 1
48+
release_blog.data["announcement"] = 1
49+
release_blog.data["excerpt"] = page.data["excerpt"]
50+
release_blog.data["release_version"] = version_str
51+
release_blog.data["title"] = site.data["translations"][lang]['released'].sub("%version", version_str)
52+
release_blog.data["permalink"] = "/#{lang}/#{date.strftime('%Y/%m/%d')}/release-#{version_str}/"
53+
54+
if is_major and release_blog_templates[lang][0]
55+
release_blog.data["eol_version"] = "#{version[0] - 3}.x"
56+
release_blog.data["old_version"] = "#{version[0] - 1}.x"
57+
58+
release_blog.content = "{% include posts/#{lang}/release-blog-major.md %}"
59+
elsif not is_major and release_blog_templates[lang][1]
60+
release_blog.content = "{% include posts/#{lang}/release-blog-minor.md %}"
61+
end
62+
63+
site.posts.docs << release_blog
64+
end
65+
end
2466
end
67+
68+
site.posts.docs.sort_by!(&:date)
2569
end
2670
end

_posts/en/posts/2025-04-14-release-29.0.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

_posts/en/posts/2025-06-26-release-28.2.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

_posts/es/posts/2025-06-26-release-28.2.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)