When `clean-urls?` is set in config, emit pages as subdirectories
`prefix/root/page-name/index.html` instead of
`prefix/root/page-name.html`. Links in emitted HTML then point to
`prefix/root/page-name/`. When `clean-urls?` not set, behaves as
before.
Refactor most URI generation into a new `page-uri` function.
`page-uri` replaces most calls* to `path`, all calls to `post-uri`
and all calls to the old `page-uri`.
Introduce function `create-file-recursive`. Function creates
file parent if not exists.
Introduce function `write-html`. When `clean-urls?` is set, spits
emitted HTML into subdirectories as described above; otherwise
behaves like `create-file`. Replaces most* calls to `create-file`
Calls `create-file` or `create-file-recursive`.
* Exceptions made for sitemap XML and RSS feed XML pages
`content-with-more-marker` returns a HTML string when the `content`
conteins more marker ("<!--more-->").
In many case, HTML tags in `content` is balanced.
ex.
------------------------------
<div id='post'>
<div class='post-content'>
this post has more marker
<!--more-->
and more content.
</div>
</div>
------------------------------
But original code breaks the balance.
------------------------------
<div id='post'>
<div class='post-content'>
this post has more marker
------------------------------
Afer this patch applied, `tagsoup` read above text and `hiccup`
re-render to HTML text with correct balanced tags.
------------------------------
<div id='post'>
<div class='post-content'>
this post has more marker
</div></div>
------------------------------
add :tag-root-uri :page-root-uri :post-root-uri parsing
replace {entity}-root with {entity}-root-uri parameters to set uri
fix root-path call
fix root-path function params order
(worked erlier because of keyword<->map transposition)
fix keyword :{entity}-root-uri to :{entity}-root transformation
misprint: congig -> config
add function to compose file path
add create-file function
add function to compose a path
handle empty blog-path using path function
fix filename for preview
This makes each markup implementation process posts in parallel.
In case of a simple test blog with 4 markdown pages mean compilation
time was reduced from 395 to 330ms. In the experiment I used OpenJDK 8
running `lein ring server` on a 4 core CPU.
This makes compilation of cryogen-core.watcher faster by reducing the
number of its dependencies. Now it depends just on pandect.algo.md5
instead of all pandect.algo.*
This commit replaces a regular expression lookup with a simple
String/indexOf substring search.
It addresses pathological cases in which re-find took several
seconds to process contents of a blog post. An example of such
a case was a post with 16kB of nested HTML tags in a single line.