Skip to content

Instantly share code, notes, and snippets.

@hideki-a

hideki-a/config.yaml

Last active Dec 1, 2015
Embed
What would you like to do?
記事の『出力ファイル名』(ベースネーム)でフィルタを書けて記事を出力する
name: EntriesBasenameFilter
tags:
filters:
Entries:
basename_filter:
handler: >
sub {
my ( $ctx, $args, $cond ) = @_;
$ctx->{ terms }->{ basename } = { like => $args->{ basename_filter } };
}
<mt:Ignore>basenameがsampleではじまる</mt:Ignore>
<mt:Entries lastn="5" basename_filter="sample%">
<mt:Ignore>basenameにsampleを含む</mt:Ignore>
<mt:Entries lastn="5" basename_filter="%sample%">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment