Skip to content
Open
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
12 changes: 8 additions & 4 deletions editing_tools/generate_index_and_editors_note.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
require 'erb'
require 'pathname'
require 'yaml'

class Article
attr_reader :path
attr_reader :path, :id

def initialize(file_path)
@file_path = file_path
pn = Pathname.new(@file_path.gsub('_posts', ''))
@path = (pn.dirname + pn.basename('.md')).to_s
@id = "/#{pn.dirname}/#{pn.basename('.md').to_s.sub(/^\d{4,4}-\d\d-\d\d-/, '')}"
@meta_data = fetch_meta_data!
end

Expand All @@ -22,8 +24,10 @@ def author
private

def fetch_meta_data!
meta_data = File.readlines(@file_path).slice_after { |l| l.chomp == '---' }.to_a[1][0..-2]
meta_data.map! { |m| m.chomp.split(': ') }.to_h
front_matter = File.read(@file_path).split(/^---\s*$/)[1]
front_matter.gsub!(/^tags:\s+(\d+)\s*$/, 'tags: "\1"')
# tags: 0065 -> tags: "0065"
YAML.load(front_matter, permitted_classes: [Date])
end
end

Expand All @@ -43,7 +47,7 @@ def fetch_meta_data!
foreword: foreword[0],
articles: articles
}
index_content = ERB.new(File.read(index_template_path)).result_with_hash(variables)
index_content = ERB.new(File.read(index_template_path), trim_mode: "-").result_with_hash(variables)
File.write("#{release_dir}/#{release_date}-index.md", index_content)

editors_note_template_path = "#{__dir__}/template/EditorsNote.md.erb"
Expand Down
49 changes: 21 additions & 28 deletions editing_tools/template/index.md.erb
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
---
layout: post
title: Rubyist Magazine <%= release_no %> 号
short_title: <%= release_no %>(<%= release_month %>)
short_title: <%= release_no %>号(<%= release_month %>)
tags: <%= release_no %> index
articles_in_volume:
- id: <%= foreword.id %>
title: 巻頭言
authors: <%= foreword.author %>
comment: <%= foreword.author %>からの <%= release_no %> 号発行の挨拶です。(難易度:低)
- id: /articles/first_step_ruby/FirstStepRuby
authors: ""
comment: Ruby をはじめるにあたって必要な情報をご紹介します。本稿は Rubyist Magazine 常設記事です。(難易度:低)
<% articles.each do |article| -%>
- id: <%= article.id %>
authors: <%= article.author %>さん
comment: TODO (難易度:TODO)
<% end -%>
- url: https://scrapbox.io/ruby-jp/RubyEventCheck

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

調べてみてもよくわからなかったのでご存知だったら教えてください 🙏

Scrapboxって今はCosenseに変わってドメインもその時にcosen.seになったかと思うのですが今はscrapbox.ioに戻ったんですかね?
Cosenseになった時の記事→ https://corp.helpfeel.com/news/pressrelease-20240521

今https://cosen.se/ruby-no-kai/にアクセスしたらhttps://scrapbox.io/ruby-jp/にリダイレクトされて、「あ、そうなんだ」とちょっと驚いてしまいました🫣
きちんとキャッチアップできてなくて申し訳ない 🙏

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0065号の表紙から https://cosen.se/ruby-no-kai/RubyEventCheck へリンクされている RubyEventCheck をクリックしてリダイレクトされた先の https://scrapbox.io/ruby-no-kai/RubyEventCheck に表示された

2026年以降のRubyEventCheckは、ruby-jpのCosenseで更新されています(いてほしい)。今後は/ruby-jp/RubyEventCheckを参照してください

というメッセージを見て、 #669 を起票しました。経緯は知りませんすみません…。

@kakutani さん、お手数ですが、

  • るびまの次号の表紙の RubyEventCheck からリンクするべきURLを、
  • もしおてすきでしたら変更の経緯を、

お知らせいただけますか?

title: RubyEventCheck
comment: Ruby 関連、または Rubyist が興味を持ちそうなイベントをご紹介します。本稿は [日本 Ruby の会 公式 Wiki](https://scrapbox.io/ruby-jp/) にて常時更新されている同名ページへのリンクとなります。(難易度:低)
- id: /articles/<%= release_no %>/<%= release_no %>-EditorsNote
authors: ""
---
{% include base.html %}

『るびま』は、Ruby に関する技術記事はもちろんのこと、Rubyist へのインタビューやエッセイ、その他をお届けするウェブ雑誌です。

## 目次

### ![title_mark.gif]({{base}}{{site.baseurl}}/images/title_mark.gif) [巻頭言]({{base}}{% post_url <%= foreword.path %> %})

書いた人:<%= foreword.author %>

<%= foreword.author %>からの <%= release_no %> 号発行の挨拶です。(難易度:低)

### ![title_mark.gif]({{base}}{{site.baseurl}}/images/title_mark.gif) [FirstStepRuby]({{base}}{% post_url articles/first_step_ruby/2000-01-01-FirstStepRuby %})

Ruby をはじめるにあたって必要な情報をご紹介します。本稿は Rubyist Magazine 常設記事です。(難易度:低)

<% articles.each do |article| %>

### ![title_mark.gif]({{base}}{{site.baseurl}}/images/title_mark.gif) [{% post_title <%= article.path %> %}]({{base}}{% post_url <%= article.path %> %})

書いた人:<%= article.author %>さん

TODO: 一言書く (難易度:X)


<% end %>

### ![title_mark.gif]({{base}}{{site.baseurl}}/images/title_mark.gif) [RubyEventCheck](https://cosen.se/ruby-no-kai/RubyEventCheck)

Ruby 関連、または Rubyist が興味を持ちそうなイベントをご紹介します。本稿は [日本 Ruby の会 公式 Wiki](https://cosen.se/ruby-no-kai/) にて常時更新されている同名ページへのリンクとなります。(難易度:低)

### ![title_mark.gif]({{base}}{{site.baseurl}}/images/title_mark.gif) [0060 号 編集後記]({{base}}{% post_url articles/0060/2019-08-18-0060-EditorsNote %})
{% include index_toc.md %}

## 次号予告

TODO: ここは書く
TODO

## おねがい

Expand Down