https://github.com/nunorc/p6-pekyll
perl6 static website generator
https://github.com/nunorc/p6-pekyll
Last synced: about 1 month ago
JSON representation
perl6 static website generator
- Host: GitHub
- URL: https://github.com/nunorc/p6-pekyll
- Owner: nunorc
- License: artistic-2.0
- Created: 2015-09-12T11:21:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-26T07:31:54.000Z (about 8 years ago)
- Last Synced: 2025-04-09T21:54:46.795Z (about 1 month ago)
- Language: Perl6
- Size: 9.77 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pekyll
A very simple tool to generate static websites from sources in different
formats, inspired by [Hakyll](http://jaspervdj.be/hakyll/), written
in [Perl 6](http://perl6.org/).**Under heavy development, things will change.. you have been warned!**
## Synopsis
The basic idea is to define a *router* and a *compiler* for sets of files.
The *router* is used to define how the final destination of the file is
built from the original file path. And the *compiler* is used to build the final
HTML from the source file. There are some previously defined routers and
compilers available.```
use Pekyll;
use Pekyll::Routers;
use Pekyll::Compilers;my %rules = (
'assets/*' => { router=>&router_id, compiler=>&plain_copy },
'static/*' => { router=>&ext2html, compiler=>&compile_static },
'_end' => &wrap_up,
);my $pekyll = Pekyll.new(:%rules);
$pekyll.build('src', 'dist');sub compile_static($src, $target) { ... }
sub wrap_up($dst) { ... }
```In a nutshell this reads for every file in source directory `assets` use
the `router_id` function to build the final path for the file (the same in
this case), and the `plain_copy` function to build the final file.The special `_end` rule is executed once (in the end), useful for generating
feeds, or special page.## Example
For a more complex example visit this [repository](http://github.com/APPP/perl.pt).