FUJILOG

見た、聴いた、触れたこと。 動かしたもの、書いたもの。 ウェブとリアルの備忘録です。

PlaggerとYAMLファイルのディレクトリ

plaggerYAMLのファイル格納先に関する情報が足りない気がしたので備忘録。


◇「config.yamlの中身」 ←C:\Perlに格納

global:
plugin_path:
- C:\Perl\site\lib\Plagger\Plugin (←pluginディレクトリアドレス)
assets_path: C:\Perl\site\lib\Plagger\assets (←assetsディレクトリアドレス)
timezone: Asia/Tokyo
cache:
base: C:\
log:
level: info


◇「hello.yaml」の中身 ←C:\Perl\site\lib\Plagger\Pluginに格納

plugins:
- module: CustomFeed::Debug
config:
title: 'Example Blog'
link: 'http://www.example.com/'
entry:
- title: 'Hello'
link: 'http://www.example.com/hello.html'
body: 'Hello, world!'

- module: Publish::OutlineText
config:
filename: C:\perl\hello.txt (←出力先、ここではテキストファイル形式で)
encoding: Shift_JIS


◇「出力結果」

コマンドプロンプトにてワークディレクトリまで移動して、
plagger -c hello.yaml

で、Plagger[info] plugin ~~ loadedのメッセージが複数出現する。
(ここで"plagger::Plugin::Publish::OutlineText [fatal] /~~~: No such file or dictinary at line 47"のようなエラーがあれば、YAMLファイルの格納先が違っている可能性があります。)

で、無事通過したら、

type C:\perl\hello.txt (←先程指定した出力先のファイルを記述)


.Example Blog
..Hello
Hello, world!

が、表示されるのでした。。

以上、module: CustomFeed::Debugとmodule: Publish::OutlineTextのどの部分が出力対象になるか確認。