Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created March 8, 2017 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/f36dce071438fe305de2c330c13d80b6 to your computer and use it in GitHub Desktop.
Save zoffixznet/f36dce071438fe305de2c330c13d80b6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
my %p = (:date-gmt("XXX"), :id("XXX"), :slug("XXX"), :tags($["Galaxy", "Galaxy fan render", "planet"]), :type("photo"), :url("http://XXX"), :url-with-slug("http://XXX"));
my %post = (
'_post' => %p,
'_type' => %p{'type'},
'post_id' => %p{'id'},
'post_slug' => %p{'slug'} || %p{'type'},
'post_url' => %p{'url-with-slug'} || %p{'url'},
'post_date' => %p{'date-gmt'},
'post_tags' => '',
'post_body' => '',
);
if %p<tags> {
%post<post_tags> = tags => [];
%post<post_tags><tags>.push: 'tag' => $_ for %p<tags>
}
say %p.perl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment