Format atom feed
This commit is contained in:
parent
68530c58d9
commit
b1ec578902
2 changed files with 12 additions and 1 deletions
|
@ -6,6 +6,7 @@ unit module DB;
|
||||||
use Pandoc;
|
use Pandoc;
|
||||||
use JSON::Class:auth<zef:vrurg>;
|
use JSON::Class:auth<zef:vrurg>;
|
||||||
use XML;
|
use XML;
|
||||||
|
use XQ;
|
||||||
|
|
||||||
use DB::Post;
|
use DB::Post;
|
||||||
use DB::BlogMeta;
|
use DB::BlogMeta;
|
||||||
|
@ -101,7 +102,7 @@ class PostDB {
|
||||||
# Render the rss/atom feed
|
# Render the rss/atom feed
|
||||||
my $atom-path = $out-dir.add('atom.xml');
|
my $atom-path = $out-dir.add('atom.xml');
|
||||||
my $atom = posts-to-atom self;
|
my $atom = posts-to-atom self;
|
||||||
$atom-path.spurt: ~$atom;
|
$atom-path.spurt: format-xml(~$atom);
|
||||||
}
|
}
|
||||||
|
|
||||||
#| Get a list of posts sorted by date
|
#| Get a list of posts sorted by date
|
||||||
|
|
10
lib/XQ.rakumod
Normal file
10
lib/XQ.rakumod
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#| Interaction with xq
|
||||||
|
unit module XQ;
|
||||||
|
|
||||||
|
#| Format an xml string
|
||||||
|
sub format-xml(Str:D $input --> Str:D) is export {
|
||||||
|
my $xq = run <xq>, :out, :in;
|
||||||
|
# Inject the xml
|
||||||
|
$xq.in.spurt: $input, :close;
|
||||||
|
$xq.out.slurp: :close
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue