summaryrefslogtreecommitdiff
path: root/webgenp-blog
diff options
context:
space:
mode:
authorPhilipp Schafft <lion@lion.leolix.org>2017-05-01 12:44:26 +0000
committerPhilipp Schafft <lion@lion.leolix.org>2017-05-01 16:15:00 +0000
commit2f64e3906da2361489ddf902c140e71119647869 (patch)
tree25d79b4c0c0d6cae420a43c6141d76c2e3830c62 /webgenp-blog
parentaa73621d291423eca3b764b2ad98a5397efc33cc (diff)
Feature: Support defining short-paw ^tags (non-auto-mode)plugin-blog
Diffstat (limited to 'webgenp-blog')
-rwxr-xr-xwebgenp-blog9
1 files changed, 8 insertions, 1 deletions
diff --git a/webgenp-blog b/webgenp-blog
index c603b5b..397ff9b 100755
--- a/webgenp-blog
+++ b/webgenp-blog
@@ -170,6 +170,9 @@ sub read_file_tags {
} elsif ($line =~ /\!language\s+(\S+)$/) {
$language = $1;
$meta{'languages'}->{$language} = 1;
+ } elsif ($line =~ /^(\^\S+)\s+('\S+)$/) {
+ $tags->{$2} ||= {};
+ $tags->{$1} = $2;
} elsif ($line =~ /^('\S+)\s+(\S+)$/) {
$tags->{$1} ||= {};
$tags->{$1}->{$language} = $2;
@@ -300,6 +303,10 @@ sub tags_resolve {
foreach my $tag (split(/\s*,\s*/, $str)) {
my $len;
+ if (substr($tag, 0, 1) eq '^' && defined($meta{'tags'}->{$tag}) ) {
+ $tag = $meta{'tags'}->{$tag};
+ }
+
if (substr($tag, 0, 1) eq '\'') {
$meta{'tags'}->{$tag} ||= {};
push(@res, $tag);
@@ -317,7 +324,7 @@ sub tags_resolve {
}
}
- die sprintf('No match for tag "^%s"', $tag);;
+ die sprintf('No match for tag "^%s"', $tag);
}
return \@res;