From 75402b673c0f630b620904ce3153f8645d89d700 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 20 Nov 2022 21:42:50 +0900 Subject: implement cache busting for stylesheets --- NOTE.md | 5 + lib/command.rb | 19 ++- lib/html_converter.rb | 16 +++ lib/parser.rb | 4 +- nuldoc.rb | 4 + public/posts/2021-03-05/my-first-post/index.html | 17 ++- public/posts/2021-03-30/phperkaigi-2021/index.html | 111 ++-------------- .../index.html | 10 +- .../python-unbound-local-error/index.html | 10 +- .../ruby-detect-running-implementation/index.html | 10 +- .../ruby-then-keyword-and-case-in/index.html | 40 +----- .../rust-where-are-primitive-types-from/index.html | 25 +--- .../index.html | 35 +---- .../vim-swap-order-of-selected-lines/index.html | 52 ++------ .../2022-04-09/phperkaigi-2022-tokens/index.html | 126 ++---------------- .../index.html | 37 ++---- public/posts/2022-05-01/phperkaigi-2022/index.html | 49 ++----- .../php-conference-okinawa-code-golf/index.html | 54 ++------ .../index.html | 27 ++-- .../index.html | 74 ++--------- .../phperkaigi-2023-unused-token-quiz-1/index.html | 37 ++---- .../setup-server-for-this-site/index.html | 143 ++------------------- .../phperkaigi-2023-unused-token-quiz-2/index.html | 37 ++---- public/posts/index.html | 20 +-- public/tags/conference/index.html | 20 +-- public/tags/cpp/index.html | 20 +-- public/tags/cpp17/index.html | 20 +-- public/tags/note-to-self/index.html | 20 +-- public/tags/php/index.html | 20 +-- public/tags/phpcon/index.html | 20 +-- public/tags/phperkaigi/index.html | 20 +-- public/tags/python/index.html | 20 +-- public/tags/python3/index.html | 20 +-- public/tags/ruby/index.html | 20 +-- public/tags/ruby3/index.html | 20 +-- public/tags/rust/index.html | 20 +-- public/tags/vim/index.html | 20 +-- templates/document.html.erb | 69 ---------- templates/document__post.html.erb | 69 ++++++++++ templates/posts_list.html.erb | 8 +- templates/tag.html.erb | 8 +- 41 files changed, 367 insertions(+), 1009 deletions(-) create mode 100644 lib/html_converter.rb delete mode 100644 templates/document.html.erb create mode 100644 templates/document__post.html.erb diff --git a/NOTE.md b/NOTE.md index 7adbcb2..8cc3a17 100644 --- a/NOTE.md +++ b/NOTE.md @@ -20,6 +20,7 @@ $ touch content/posts/$(date +'%Y-%m-%d')/[TITLE].md * [x] Add /posts/ page * [x] Stylesheets * [x] Syntax highlight +* [ ] Add /tags/ page * [ ] Add / page * [ ] Add /about/ page * [ ] Add navigation bar @@ -46,6 +47,10 @@ $ touch content/posts/$(date +'%Y-%m-%d')/[TITLE].md * https://www.sitemaps.org/protocol.html * https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap?hl=ja * [ ] Admonitions +* [x] Stylesheet cache busting +* [ ] templates + * Define custom converter using ERB + ## Structure diff --git a/lib/command.rb b/lib/command.rb index 81692b3..5662eec 100644 --- a/lib/command.rb +++ b/lib/command.rb @@ -4,9 +4,11 @@ module NulDoc @config = config @content_dir = @config[:content_dir] @dest_dir = @config[:dest_dir] + @static_dir = @config[:static_dir] @template_dir = @config[:template_dir] @parser = NulDoc::Parser.new( { + 'stylesheets' => stylesheets, 'author' => @config[:author], 'site-copyright-year' => @config[:site_copyright_year], 'site-name' => @config[:site_name], @@ -43,7 +45,7 @@ module NulDoc end def parse_posts(post_file_paths) - post_file_paths.map { @parser.parse_file(_1) } + post_file_paths.map { @parser.parse_file(_1, 'post') } end def output_posts(posts) @@ -92,8 +94,9 @@ module NulDoc end def build_tag_doc(tag, posts) - erb = ERB.new(File.read(@template_dir + '/tag.html.erb')) + erb = ERB.new(File.read(@template_dir + '/tag.html.erb'), trim_mode: '<>') erb.result_with_hash({ + stylesheets: stylesheets, tag: tag, posts: posts, author: @config[:author], @@ -124,8 +127,9 @@ module NulDoc end def build_posts_list_doc(posts) - erb = ERB.new(File.read(@template_dir + '/posts_list.html.erb')) + erb = ERB.new(File.read(@template_dir + '/posts_list.html.erb'), trim_mode: '<>') erb.result_with_hash({ + stylesheets: stylesheets, posts: posts.reverse, author: @config[:author], site_copyright_year: @config[:site_copyright_year], @@ -148,5 +152,14 @@ module NulDoc f.puts(html) end end + + def stylesheets + stylesheet_file_names = %w[hl.css style.css custom.css] + stylesheet_file_names.map {|ss_file_name| + ss_file_path = "#{@static_dir}/#{ss_file_name}" + hash = Digest::MD5.file(ss_file_path).hexdigest + "/#{ss_file_name}?#{hash}" + } + end end end diff --git a/lib/html_converter.rb b/lib/html_converter.rb new file mode 100644 index 0000000..126d72a --- /dev/null +++ b/lib/html_converter.rb @@ -0,0 +1,16 @@ +module NulDoc + class HTMLConverter < (Asciidoctor::Converter.for 'html5') + register_for 'html5' + + def initialize(backend, opts) + super + @template_dir = opts[:template_dirs].first + end + + def convert_document(node) + template_file_name = "document__#{node.attr('document-type')}.html.erb" + erb = Tilt::ERBTemplate.new("#{@template_dir}/#{template_file_name}") + erb.render(node, {}) + end + end +end diff --git a/lib/parser.rb b/lib/parser.rb index 8ae3303..e644dc6 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -6,7 +6,7 @@ module NulDoc @template_dir = template_dir end - def parse_file(file_path) + def parse_file(file_path, document_type) Asciidoctor.load_file( file_path, backend: :html5, @@ -15,9 +15,11 @@ module NulDoc safe: :unsafe, template_dirs: [@template_dir], template_engine: 'erb', + template_engine_options: { erb: { trim: '<>' } }, attributes: @common_attributes.merge({ 'source-file-path' => file_path, 'href' => file_path.sub(@content_dir, '').sub('.adoc', '/'), + 'document-type' => document_type, }), extension_registry: Asciidoctor::Extensions.create do tree_processor Nuldoc::Extensions::RevisionHistoryProcessor diff --git a/nuldoc.rb b/nuldoc.rb index 363383e..c702981 100644 --- a/nuldoc.rb +++ b/nuldoc.rb @@ -1,8 +1,11 @@ require 'date' +require 'digest/md5' require 'fileutils' + require 'asciidoctor' require_relative 'lib/command' +require_relative 'lib/html_converter' require_relative 'lib/parser' require_relative 'lib/extensions/document_title_processor' require_relative 'lib/extensions/lang_attribute_processor' @@ -20,5 +23,6 @@ NulDoc::Command.new({ site_copyright_year: 2021, content_dir: __dir__ + '/content', dest_dir: __dir__ + '/public', + static_dir: __dir__ + '/static', template_dir: __dir__ + '/templates', }).run diff --git a/public/posts/2021-03-05/my-first-post/index.html b/public/posts/2021-03-05/my-first-post/index.html index fbf7237..6ca0ae8 100644 --- a/public/posts/2021-03-05/my-first-post/index.html +++ b/public/posts/2021-03-05/my-first-post/index.html @@ -9,9 +9,13 @@ My First Post | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -38,12 +42,7 @@ - - - - - -
+

Test diff --git a/public/posts/2021-03-30/phperkaigi-2021/index.html b/public/posts/2021-03-30/phperkaigi-2021/index.html index 46fce9b..965f0c9 100644 --- a/public/posts/2021-03-30/phperkaigi-2021/index.html +++ b/public/posts/2021-03-30/phperkaigi-2021/index.html @@ -9,9 +9,13 @@ PHPerKaigi 2021 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -54,12 +58,7 @@

- - - - - -
+

PHPerKaigi 2021 参加レポ @@ -81,11 +80,6 @@

発表はトラック A、B に分かれていたのだが、今回はすべて A トラックを視聴している (切り替えるのが面倒だっただけ)。

- - - - -

@@ -105,11 +99,6 @@

- - - - -

@@ -117,12 +106,7 @@

- - - - - -
+

17:30 [A] @@ -194,11 +178,6 @@ Laravel などでは動かなさそう)

- - - - -

@@ -269,11 +248,6 @@ Laravel などでは動かなさそう)

- - - - -

@@ -372,11 +346,6 @@ Laravel などでは動かなさそう)

- - - - -

@@ -473,11 +442,6 @@ Laravel などでは動かなさそう)

- - - - -

@@ -485,12 +449,7 @@ Laravel などでは動かなさそう)

- - - - - -
+

10:50 [A] @@ -636,11 +595,6 @@ Laravel などでは動かなさそう)

- - - - -

@@ -698,11 +652,6 @@ Ruby の typeprof には注目している。

- - - - -

@@ -715,11 +664,6 @@ Ruby の typeprof には注目している。

- - - - -

@@ -791,11 +735,6 @@ text markup * automation

- - - - -

@@ -812,11 +751,6 @@ text markup * automation

- - - - -

@@ -958,11 +892,6 @@ C言語時代への回帰ともいえるが、その頃と異なるのはエラ

- - - - -

@@ -979,11 +908,6 @@ C言語時代への回帰ともいえるが、その頃と異なるのはエラ

- - - - -

@@ -1046,11 +970,6 @@ streaming RPCs

- - - - -

@@ -1115,11 +1034,6 @@ private のみ * 依存関係の制御が困難

- - - - -

@@ -1135,11 +1049,6 @@ private のみ * 依存関係の制御が困難

- - - - -

diff --git a/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html b/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html index 16a8188..a3b1d50 100644 --- a/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html +++ b/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html @@ -9,9 +9,13 @@ 【C++】属性構文の属性名にはキーワードが使える | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/posts/2021-10-02/python-unbound-local-error/index.html b/public/posts/2021-10-02/python-unbound-local-error/index.html index 20e1e0e..b08be62 100644 --- a/public/posts/2021-10-02/python-unbound-local-error/index.html +++ b/public/posts/2021-10-02/python-unbound-local-error/index.html @@ -9,9 +9,13 @@ 【Python】クロージャとUnboundLocalError: local variable 'x' referenced before assignment | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/posts/2021-10-02/ruby-detect-running-implementation/index.html b/public/posts/2021-10-02/ruby-detect-running-implementation/index.html index 6fe62d7..d248feb 100644 --- a/public/posts/2021-10-02/ruby-detect-running-implementation/index.html +++ b/public/posts/2021-10-02/ruby-detect-running-implementation/index.html @@ -9,9 +9,13 @@ 【Ruby】自身を実行している処理系の種類を判定する | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html b/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html index 7ddf636..b702b57 100644 --- a/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html +++ b/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html @@ -9,9 +9,13 @@ 【Ruby】then キーワードと case in | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -59,11 +63,6 @@
- - - - -

@@ -77,11 +76,6 @@

- - - - -

@@ -133,11 +127,6 @@

- - - - -

@@ -185,11 +174,6 @@ if true puts 'Hello, World!' end

- - - - -

@@ -238,11 +222,6 @@ if true puts 'Hello, World!' end

- - - - -

@@ -348,11 +327,6 @@ if true puts 'Hello, World!' end

- - - - -

diff --git a/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html b/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html index 27f2632..008c79f 100644 --- a/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html +++ b/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html @@ -9,9 +9,13 @@ Rust のプリミティブ型はどこからやって来るか | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -55,11 +59,6 @@
- - - - -

@@ -109,11 +108,6 @@

- - - - -

@@ -289,11 +283,6 @@ ident) を現在のレキシカルスコープ内で解決 (resolve) する。

- - - - -

diff --git a/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html b/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html index 94912ed..aafd8ab 100644 --- a/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html +++ b/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html @@ -9,9 +9,13 @@ 【Vim】autocmd events の BufWrite/BufWritePre の違い | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -55,11 +59,6 @@
- - - - -

@@ -72,11 +71,6 @@

- - - - -

@@ -128,11 +122,6 @@ vim と neovim のソースコードを調査した。

- - - - -

@@ -175,11 +164,6 @@ vim と neovim のソースコードを調査した。

- - - - -

@@ -217,11 +201,6 @@ FileEncoding Obsolete. It still works and is equivalent

- - - - -

diff --git a/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html b/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html index 2b66f2e..8e9c3ce 100644 --- a/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html +++ b/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html @@ -9,9 +9,13 @@ Vimで選択した行の順番を入れ替える | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -55,11 +59,6 @@
- - - - -

@@ -80,11 +79,6 @@ version Included patches: 1-148 Huge version without GUI.

- - - - -

@@ -92,12 +86,7 @@ version Included patches: 1-148 Huge version without GUI.

- - - - - -
+

tac / tail @@ -121,11 +110,6 @@ version Included patches: 1-148 Huge version without GUI.

- - - - -

@@ -184,11 +168,6 @@ M行目を処理範囲とするよう拡張できる。手でこれを入力す

- - - - -

@@ -212,11 +191,6 @@ M行目を処理範囲とするよう拡張できる。手でこれを入力す

- - - - -

@@ -292,11 +266,6 @@ highlighting state is saved and restored when executing autocommands

- - - - -

@@ -333,11 +302,6 @@ Exコマンドを「現在の検索パターンを保ったまま」実行する

- - - - -

diff --git a/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html b/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html index afb6eac..7cd2d26 100644 --- a/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html +++ b/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html @@ -9,9 +9,13 @@ PHPerKaigi 2022 トークン問題の解説 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -58,12 +62,7 @@

- - - - - -
+

はじめに @@ -81,11 +80,6 @@

- - - - -

@@ -172,11 +166,6 @@

この問題は、単に適切なバージョンの PHP で動かせばトークンが得られる。

- - - - -

@@ -184,12 +173,7 @@

- - - - - -
+

絵文字 @@ -202,11 +186,6 @@

- - - - -

@@ -291,11 +270,6 @@ Wikipedia の該当ページを読んだ方がよい。

- - - - -

@@ -310,11 +284,6 @@ Wikipedia の該当ページを読んだ方がよい。

- - - - -

@@ -329,11 +298,6 @@ Wikipedia の該当ページを読んだ方がよい。

- - - - -

@@ -355,11 +319,6 @@ Wikipedia の該当ページを読んだ方がよい。

- - - - -

@@ -395,11 +354,6 @@ PHP では、型変換を利用することで任意の整数を作り出すこ

- - - - -

@@ -415,11 +369,6 @@ PHP では、型変換を利用することで任意の整数を作り出すこ

- - - - -

@@ -447,11 +396,6 @@ Z コンビネータとして知られるものを使った ($z)。

- - - - -

@@ -508,11 +452,6 @@ Z コンビネータとして知られるものを使った ($z)。

ここでは、私の想定解を解説する。

- - - - -

@@ -567,11 +506,6 @@ Z コンビネータとして知られるものを使った ($z)。

- - - - -

@@ -607,11 +541,6 @@ Z コンビネータとして知られるものを使った ($z)。

- - - - -

@@ -684,11 +613,6 @@ Z コンビネータとして知られるものを使った ($z)。

- - - - -

@@ -743,11 +667,6 @@ Q;

実際にはもう少しパイプで繋げなければならない。

- - - - -

@@ -755,12 +674,7 @@ Q;

- - - - - -
+

プログラム全体 @@ -778,11 +692,6 @@ Quine

- - - - -

@@ -796,11 +705,6 @@ Quine

- - - - -

@@ -816,11 +720,6 @@ Quine

- - - - -

@@ -842,11 +741,6 @@ Quine

- - - - -

diff --git a/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html b/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html index 628d3f8..64cf418 100644 --- a/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html +++ b/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html @@ -9,9 +9,13 @@ term-banner: ターミナルにバナーを表示するツールを書いた | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -42,12 +46,7 @@

- - - - - -
+

はじめに @@ -74,11 +73,6 @@

- - - - -

@@ -112,11 +106,6 @@

- - - - -

@@ -153,11 +142,6 @@

- - - - -

@@ -195,11 +179,6 @@

- - - - -

diff --git a/public/posts/2022-05-01/phperkaigi-2022/index.html b/public/posts/2022-05-01/phperkaigi-2022/index.html index 4168136..e6f5972 100644 --- a/public/posts/2022-05-01/phperkaigi-2022/index.html +++ b/public/posts/2022-05-01/phperkaigi-2022/index.html @@ -9,9 +9,13 @@ PHPerKaigi 2022 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -54,12 +58,7 @@

- - - - - -
+

はじめに @@ -78,11 +77,6 @@

- - - - -

@@ -90,12 +84,7 @@

- - - - - -
+

厳選おすすめトーク @@ -190,11 +179,6 @@

- - - - -

@@ -208,11 +192,6 @@

- - - - -

@@ -227,11 +206,6 @@

- - - - -

@@ -272,11 +246,6 @@

- - - - -

diff --git a/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html b/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html index 471678a..5158536 100644 --- a/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html +++ b/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html @@ -9,9 +9,13 @@ PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -54,12 +58,7 @@

- - - - - -
+

はじめに @@ -81,11 +80,6 @@

- - - - -

@@ -147,11 +141,6 @@

- - - - -

@@ -159,12 +148,7 @@

- - - - - -
+

指数表記 @@ -178,11 +162,6 @@

- - - - -

@@ -197,11 +176,6 @@

- - - - -

@@ -227,11 +201,6 @@

- - - - -

@@ -248,11 +217,6 @@

- - - - -

diff --git a/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html b/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html index e452599..2d48422 100644 --- a/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html +++ b/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html @@ -9,9 +9,13 @@ 弊社の PHP Foundation への寄付に寄せて | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -38,12 +42,7 @@

- - - - - -
+

はじめに @@ -67,11 +66,6 @@

- - - - -

@@ -113,11 +107,6 @@

- - - - -

diff --git a/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html b/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html index c2dc8ab..a1d8cf9 100644 --- a/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html +++ b/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html @@ -9,9 +9,13 @@ 【PHP】fizzbuzz を書く。1行あたり2文字で。 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -50,12 +54,7 @@

- - - - - -
+

記事の構成について @@ -70,11 +69,6 @@

- - - - -

@@ -132,11 +126,6 @@ off になっている環境が多いようなので、今回は使わないこ

- - - - -

@@ -299,11 +288,6 @@ a'

- - - - -

@@ -311,12 +295,7 @@ a'

- - - - - -
+

普通の (?) fizzbuzz @@ -341,11 +320,6 @@ for ($i = 1; $i < 100; $i++) {

- - - - -

@@ -378,11 +352,6 @@ for ($i = 1; $i < 100; $i++) {

- - - - -

@@ -418,11 +387,6 @@ for ($i = 1; $i < 100; $i++) {

- - - - -

@@ -482,11 +446,6 @@ PHP 7.x までの仕様が利用できる。例えば、 Fizz

- - - - -

@@ -586,11 +545,6 @@ o'

- - - - -

@@ -756,11 +710,6 @@ _!

- - - - -

@@ -778,11 +727,6 @@ _!

- - - - -

diff --git a/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html b/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html index efb7239..fe5b6a5 100644 --- a/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html +++ b/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html @@ -9,9 +9,13 @@ PHPerKaigi 2023: ボツになったトークン問題 その 1 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -50,12 +54,7 @@

- - - - - -
+

はじめに @@ -83,11 +82,6 @@

- - - - -

@@ -126,11 +120,6 @@

- - - - -

@@ -175,11 +164,6 @@

- - - - -

@@ -257,11 +241,6 @@

- - - - -

diff --git a/public/posts/2022-10-28/setup-server-for-this-site/index.html b/public/posts/2022-10-28/setup-server-for-this-site/index.html index c070c03..67587e1 100644 --- a/public/posts/2022-10-28/setup-server-for-this-site/index.html +++ b/public/posts/2022-10-28/setup-server-for-this-site/index.html @@ -9,9 +9,13 @@ 【備忘録】このサイト用の VPS をセットアップしたときのメモ | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -46,12 +50,7 @@

- - - - - -
+

はじめに @@ -68,11 +67,6 @@

- - - - -

@@ -86,11 +80,6 @@

- - - - -

@@ -98,12 +87,7 @@

- - - - - -
+

サーバのホスト名を決める @@ -117,11 +101,6 @@

- - - - -

@@ -144,11 +123,6 @@

- - - - -

@@ -172,11 +146,6 @@

- - - - -

@@ -184,12 +153,7 @@

- - - - - -
+

SSH 接続 @@ -201,11 +165,6 @@

- - - - -

@@ -227,11 +186,6 @@

- - - - -

@@ -246,11 +200,6 @@

- - - - -

@@ -271,11 +220,6 @@

- - - - -

@@ -316,11 +260,6 @@

- - - - -

@@ -340,11 +279,6 @@

- - - - -

@@ -369,11 +303,6 @@

- - - - -

@@ -421,11 +350,6 @@

- - - - -

@@ -446,11 +370,6 @@

- - - - -

@@ -458,12 +377,7 @@

- - - - - -
+

DNS に IP アドレスを登録する @@ -476,11 +390,6 @@

- - - - -

@@ -495,11 +404,6 @@

- - - - -

@@ -514,11 +418,6 @@

- - - - -

@@ -539,11 +438,6 @@

- - - - -

@@ -561,11 +455,6 @@

- - - - -

@@ -581,11 +470,6 @@

- - - - -

@@ -602,11 +486,6 @@

- - - - -

diff --git a/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html b/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html index 8ca3e92..439586b 100644 --- a/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html +++ b/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html @@ -9,9 +9,13 @@ PHPerKaigi 2023: ボツになったトークン問題 その 2 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
@@ -50,12 +54,7 @@

- - - - - -
+

はじめに @@ -80,11 +79,6 @@

- - - - -

@@ -114,11 +108,6 @@

- - - - -

@@ -182,11 +171,6 @@

- - - - -

@@ -247,11 +231,6 @@

- - - - -

diff --git a/public/posts/index.html b/public/posts/index.html index 1207acd..cce86d9 100644 --- a/public/posts/index.html +++ b/public/posts/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ Posts | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/conference/index.html b/public/tags/conference/index.html index 4423eee..757ab24 100644 --- a/public/tags/conference/index.html +++ b/public/tags/conference/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ カンファレンス | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/cpp/index.html b/public/tags/cpp/index.html index 5cc157b..5f831c4 100644 --- a/public/tags/cpp/index.html +++ b/public/tags/cpp/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ C++ | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/cpp17/index.html b/public/tags/cpp17/index.html index 5585a26..77e426a 100644 --- a/public/tags/cpp17/index.html +++ b/public/tags/cpp17/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ C++ 17 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/note-to-self/index.html b/public/tags/note-to-self/index.html index 4cdabd6..d73bf03 100644 --- a/public/tags/note-to-self/index.html +++ b/public/tags/note-to-self/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ 備忘録 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/php/index.html b/public/tags/php/index.html index c20c486..094f012 100644 --- a/public/tags/php/index.html +++ b/public/tags/php/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ PHP | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/phpcon/index.html b/public/tags/phpcon/index.html index 45fe74f..266ae5c 100644 --- a/public/tags/phpcon/index.html +++ b/public/tags/phpcon/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ PHP カンファレンス | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/phperkaigi/index.html b/public/tags/phperkaigi/index.html index 3a536bc..2fed4df 100644 --- a/public/tags/phperkaigi/index.html +++ b/public/tags/phperkaigi/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ PHPerKaigi | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/python/index.html b/public/tags/python/index.html index b15dfb6..f178bae 100644 --- a/public/tags/python/index.html +++ b/public/tags/python/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ Python | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/python3/index.html b/public/tags/python3/index.html index 2824a04..d2401bc 100644 --- a/public/tags/python3/index.html +++ b/public/tags/python3/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ Python 3 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/ruby/index.html b/public/tags/ruby/index.html index 40c7b4f..ebfbfd4 100644 --- a/public/tags/ruby/index.html +++ b/public/tags/ruby/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ Ruby | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/ruby3/index.html b/public/tags/ruby3/index.html index 47a47b7..029cd8a 100644 --- a/public/tags/ruby3/index.html +++ b/public/tags/ruby3/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ Ruby 3 | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/rust/index.html b/public/tags/rust/index.html index da5efee..cdf3ae9 100644 --- a/public/tags/rust/index.html +++ b/public/tags/rust/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ Rust | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/public/tags/vim/index.html b/public/tags/vim/index.html index e76b079..6046bd5 100644 --- a/public/tags/vim/index.html +++ b/public/tags/vim/index.html @@ -1,13 +1,3 @@ - - - - - - - - - - @@ -18,9 +8,13 @@ Vim | REPL: Rest-Eat-Program Loop - - - + + + + + + +
diff --git a/templates/document.html.erb b/templates/document.html.erb deleted file mode 100644 index 9d93696..0000000 --- a/templates/document.html.erb +++ /dev/null @@ -1,69 +0,0 @@ -<% _main_stylesheet = '/style.css' %> -<% _author = attr 'author' %> -<% _description = attr 'description' %> -<% _lang = attr 'lang' %> -<% _site_copyright_year = attr 'site-copyright-year' %> -<% _copyright_year = attr 'copyright-year' %> -<% _revisions = attr 'revision-history' %> -<% _site_name = attr 'site-name' %> -<% _tags = attr 'tags' %> -<% _doctitle = doctitle %> -<% _header_title = header.title %> -<% _content = content %> - - - - - - - - - - - <%= _doctitle %> | <%= _site_name %> - - - - - -
- -
-
-
-
-

<%= _header_title %>

- <% if not _tags.empty? %> - - <% end %> -
-
-
-

更新履歴

-
    - <% for revision in _revisions %> -
  1. - : <%= revision.remark %> -
  2. - <% end %> -
-
- <%= _content %> -
-
-
-
- © <%= _site_copyright_year %> <%= _author %> -
- - diff --git a/templates/document__post.html.erb b/templates/document__post.html.erb new file mode 100644 index 0000000..bc9a842 --- /dev/null +++ b/templates/document__post.html.erb @@ -0,0 +1,69 @@ +<% _stylesheets = attr 'stylesheets' %> +<% _author = attr 'author' %> +<% _description = attr 'description' %> +<% _lang = attr 'lang' %> +<% _site_copyright_year = attr 'site-copyright-year' %> +<% _copyright_year = attr 'copyright-year' %> +<% _revisions = attr 'revision-history' %> +<% _site_name = attr 'site-name' %> +<% _tags = attr 'tags' %> +<% _doctitle = doctitle %> +<% _header_title = header.title %> +<% _content = content %> + + + + + + + + + + + <%= _doctitle %> | <%= _site_name %> + <% for stylesheet in _stylesheets %> + + <% end %> + + +
+ +
+
+
+
+

<%= _header_title %>

+ <% if not _tags.empty? %> + + <% end %> +
+
+
+

更新履歴

+
    + <% for revision in _revisions %> +
  1. + : <%= revision.remark %> +
  2. + <% end %> +
+
+ <%= _content %> +
+
+
+
+ © <%= _site_copyright_year %> <%= _author %> +
+ + diff --git a/templates/posts_list.html.erb b/templates/posts_list.html.erb index 2227241..5367258 100644 --- a/templates/posts_list.html.erb +++ b/templates/posts_list.html.erb @@ -1,4 +1,4 @@ -<% _main_stylesheet = '/style.css' %> +<% _stylesheets = stylesheets %> <% _author = author %> <% _description = description %> <% _lang = lang %> @@ -18,9 +18,9 @@ <%= _doctitle %> | <%= _site_name %> - - - + <% for stylesheet in _stylesheets %> + + <% end %>
diff --git a/templates/tag.html.erb b/templates/tag.html.erb index 7fd23cd..c92c0ca 100644 --- a/templates/tag.html.erb +++ b/templates/tag.html.erb @@ -1,4 +1,4 @@ -<% _main_stylesheet = '/style.css' %> +<% _stylesheets = stylesheets %> <% _author = author %> <% _description = description %> <% _lang = lang %> @@ -18,9 +18,9 @@ <%= _doctitle %> | <%= _site_name %> - - - + <% for stylesheet in _stylesheets %> + + <% end %>
-- cgit v1.2.3-70-g09d2