Commit graph

197 commits

Author SHA1 Message Date
Jan Krebs
64a3b1d62c Fix symbol-not-found and Nullpointer-Exception 2019-12-11 22:01:08 +01:00
jem
3300dce8ae "Mob Session DONE [ci-skip]" 2019-12-11 18:04:48 +01:00
jem
34f723a55c "Mob Session DONE [ci-skip]" 2019-12-11 17:53:34 +01:00
Jan Krebs
91c6812243 "mob next [ci-skip]" 2019-12-11 17:36:39 +01:00
Jan Krebs
ed46ed1e0e Attemt at tail end recursion 2019-12-06 20:10:56 +01:00
Jan Krebs
1c7720bdbf "mob next [ci-skip]" 2019-12-06 16:59:44 +01:00
jem
e29c246e3b "Mob Session DONE [ci-skip]" 2019-12-06 16:37:24 +01:00
Jan Krebs
6f2a28df22 "mob next [ci-skip]" 2019-12-06 16:00:05 +01:00
jem
8b0ac5e800 "Mob Session DONE [ci-skip]" 2019-12-06 15:34:41 +01:00
Jan Krebs
bbfc535c3b "mob next [ci-skip]" 2019-12-06 15:15:40 +01:00
jem
0204170811 "Mob Session DONE [ci-skip]" 2019-12-06 14:51:06 +01:00
jem
1c9c4f3e60 "Mob Session DONE [ci-skip]" 2019-12-06 10:00:08 +01:00
Jan Krebs
3182421a5e "mob next [ci-skip]" 2019-12-03 18:11:30 +01:00
jem
c1594a035e "Mob Session DONE [ci-skip]" 2019-12-03 17:51:21 +01:00
Jan Krebs
c19498abbb "mob next [ci-skip]" 2019-12-03 17:33:48 +01:00
jem
90935bab43 "Mob Session DONE [ci-skip]" 2019-12-03 17:07:42 +01:00
jem
965ceda614 test now is fine 2019-11-29 16:44:29 +01:00
jem
999b041925 test copy-from-classpath first 2019-11-29 16:29:58 +01:00
jem
843e0eaaec compile works again 2019-11-29 16:29:35 +01:00
805e369bb8 fixed not recognized :page-root-uri configuration 2017-03-22 08:05:36 +01:00
e8d7069598 compile hierarchic pages 2017-03-12 10:33:50 +01:00
6cf7b1a72b renamed config to page-model 2017-03-12 08:59:38 +01:00
593766a603 refactoring: replace navbar-pages & sidebar-pages by pages 2017-03-11 21:32:58 +01:00
da84c946c9 reflect refactoring page-model -> navbar-mode 2017-02-17 08:59:50 +01:00
d772f95990 refactored name of configuration parameter. 2017-02-13 21:18:15 +01:00
a7f5f3a7b1 made sidebar-pages flat again.
There is no way to ensure a sidebar-only hierarchy without tree gaps. So
filtering a flat sequence would work much better.
2017-02-12 22:15:31 +01:00
b781b8b9bb renamed navpage-model to page-model 2017-02-10 14:55:11 +01:00
f758b5744d tested in real live -works now 2017-02-10 14:49:21 +01:00
4f9ac917ae added hierarchic sidbar-pages & refactored namesspace. 2017-02-09 08:52:42 +01:00
d8f86e0414 fixed read-config 2017-02-08 20:27:56 +01:00
439ae6fba8 all things implemented - probably works 2017-02-08 20:09:01 +01:00
e9d1c1e194 refactored navbar-model out of compiler & introduced new :navbar-model
parameter to config
2017-02-08 19:22:15 +01:00
2e6723d2fa readded missing debug? configuration 2017-02-08 09:53:15 +01:00
d36acf2316 Merge branch 'master' into master 2017-02-08 09:13:45 +01:00
Aleksander Madland Stapnes
60c4ec0054 Add nohighlight to klipsified code blocks. 2017-02-02 00:49:51 -03:00
Aleksander Madland Stapnes
70c95b41d8 Look at the content as well as the config to infer clojure eval
Before only the config was looked at to determine whether to include
the js minified of not, now look at the html as well. This makes it
more convenient to set up all klipse stuff once in config.edn without
having to manually specify which js to include.
2017-01-27 02:57:33 -03:00
Aleksander Madland Stapnes
f7f02f7433 Change confusing local names. cfg -> settings 2017-01-20 16:16:01 -03:00
Aleksander Madland Stapnes
c5d995b262 Add some docstrings 2017-01-20 02:57:47 -03:00
Aleksander Madland Stapnes
ac52785b19 Automatic klipse integration 2017-01-20 02:57:38 -03:00
Carmen La
84a933bdcf Fix dest-sass/sass-dest key
Issue #85
2017-01-17 23:46:23 -05:00
Carmen La
f0cc7353c1 Pass both page/post params to the index template 2017-01-17 01:57:19 -05:00
Carmen La
6ba76bc7f5 Fix a regression 2017-01-17 01:41:04 -05:00
Carmen La
9cd5016537 Don't create prev/next links pointing to :home? pages
- Also include more metadata in page.prev and page.next params
- And some general code cleanup
2017-01-16 23:25:05 -05:00
Aleksander Madland Stapnes
1cfb2b17df Remove crouton dep because enlive does the same thing
Almost the same thing; it doesn't insert missing html, head and body
tags, but in this case we only care about the stuff in the body.
2017-01-16 18:16:11 -03:00
Carmen La
dec80185e5 A big ol' cleanup 2017-01-16 02:37:19 -05:00
Aleksander Madland Stapnes
dbd5caaf1f Replace tagsoup dependency with enlive
Tagsoup depends on an old version of clojure.data.xml, which doesn't
compile with clojure 1.9.0-alpha12. Enlive seems more actively
maintained and used.
2017-01-15 05:30:25 -03:00
Aleksander Madland Stapnes
9c7c935d66 Style pedantry: Remove trailing whitespace.
My emacs did it...
2017-01-15 05:17:48 -03:00
1ea38c5b84 respect :page-index order for navmap 2017-01-05 17:10:07 +01:00
3c415f48e0 Added navmap feature.
Navmap will allow nested navigation for pages. To 
* add a page to navmap, you've to add `{:navmap? true}` to pages meta.
* define navigation hierarchy you can use directory-structure (first
level will be in /pages/nav1.md, second level will be in
/pages/nav1/nav11.md)
* use navmap, you can 
  * access navmap-pages (sequence of pages) in your template, same as
you've used navbar-pages and
  * access navigation childs as :navmap-children in specific pages (eg.
nav1 will contain a sequence of one page representing nav11).
2017-01-04 09:36:50 +01:00
78e4a6d067 fixed navbar-pages bug 2017-01-04 09:36:37 +01:00
Scot Brown
6d28af459f Fix symbol not found exception in compile-assets function 2017-01-03 16:38:57 -05:00
773ee269b9 add some more debug options 2016-12-31 15:48:52 +01:00
e796a5adc5 added debug switch & improved home vs. preview handling 2016-12-31 11:20:09 +01:00
60b395e047 added ability to select one page as home-page (add :home? true as meta)
instead of newest post.
2016-12-30 23:43:13 +01:00
Carmen La
e3d2d3f433 Fix npe 2016-12-18 19:22:29 -05:00
Carmen La
fb0dc9e1d4 Merge pull request #77 from SVMBrown/master
conditionally drop any posts with dates set in the future
2016-12-18 14:24:20 -05:00
Torsten Uhlmann
998fc077e8 Provided fixes make cryogen work on Windows.
The path is converted to forward slash before further processed
The executables for sass and compass are configurable, that's because
on a Windows installation they are named sass.bat and compass.bat
The default is still the Unix version.
2016-12-17 11:29:16 +01:00
Scot Brown
1a75abb0e4 conditionally drop any posts with dates set in the future 2016-12-13 15:59:09 -05:00
Ben Swift
c9828f6cc3 nicer pretty-printing of "compiling sass" 2016-12-04 16:48:41 +11:00
Ben Swift
a66f8df5e4 in compile-sass-file!, sh doesn't like nil arg when no compass 2016-12-02 14:30:11 +11:00
Ben Swift
fc1d1d725c bugfix for compass-installed?
catch the (previously uncaught) exception when there isn't a `compass`
binary on the `$PATH`, return `false` instead
2016-12-02 11:55:47 +11:00
Shigeaki Matsumura
9858723403 fix toc entry for title which has a link 2016-10-23 12:07:50 +09:00
Shigeaki Matsumura
510c33c23d support sub directories in pages and posts 2016-10-19 00:43:09 +09:00
Carmen La
52457c7b64 Add :today key to params for compiling posts 2016-09-03 15:33:37 -04:00
Arsene Rei
f383661e5e Fallback to resources/templates/{pages,posts}
By default, when using markdown files, Cryogen will look for
`resources/templates/md/pages/*.md`. This commits allows Cryogen to fall back to
`resources/templates/pages/*.md` in the case that it can't find any files in the
former directory. It works similarly for posts and Asciidoc files.

Since we're looking specifically for `*.md` for Markdown files and `*.asc` for
Ascii files, this is an opportunity to eliminate redundancy.
2016-05-27 11:52:41 -04:00
Carmen La
3e7d43b212 update dependencies/version 2016-04-18 22:44:09 -04:00
Jan Stępień
0d1149a9c2 Use Hawk in cryogen-core.watcher
This is a follow-up to PR #46. It replaces the 300ms loop with a file
watcher. Hawk is a wrapper around java.nio.file.WatchService coming with
proper OS X support.

Now rebuilds should be instantaneous.
2016-03-13 16:43:14 +01:00
Dan Hable
683bcad292 Make archive grouping configurable
The blog that I'm moving to cryogen currently groups the posts by year instead of by year/month. This change makes the grouping configurable while defaulting to the current behavior of year/month grouping on posts.
2016-03-08 20:22:20 -06:00
Tom L
0c4156f43f Add servlet context to tags, archives rendering. 2016-02-15 20:31:40 -06:00
Tom L
c18c3d60f2 Implement clean URLs feature (Issue #89)
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
2016-02-11 20:04:56 -06:00
Tomasz Biernacki
c84b550f92 Add multiple authors filtering support 2016-02-10 03:13:06 +01:00
Tomasz Biernacki
e5395a362a Add author and (short) description for RSS 2016-02-09 03:01:10 +01:00
Sean
852b431d71 Add home to index params when previews are enabled 2016-02-04 04:07:17 -08:00
ponkore
556fe84ef8 content-with-more-marker returns with correct tags
`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>
------------------------------
2016-01-11 21:30:21 +09:00
ponkore
792833facb rewrite-hrefs bug fix (when :blog-prefix is blank)
When :blog-prefix in `config.edn` is set nil or "",
rewrite-hrefs should return `text` itself.
2016-01-10 23:40:19 +09:00
Carmen La
839ed5c469 Remove unnecesasry tag-root key 2016-01-08 20:44:07 -05:00
Carmen La
1abc4c6137 Fix bug with rewrite-href function 2016-01-08 18:51:40 -05:00
Sergiy BONDARYEV
eea999e1d7 add Blog/Page/Post/Tag uri customisation
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
2016-01-08 22:59:10 +01:00
Yogthos
5b13b3b761 added :draft? key to allow creation of draft posts that won't be published 2015-12-17 14:36:09 -05:00
Jeff Rabinowitz
e34ea8c989 Fixed a regression under which the old style of using :toc true would throw an exception because the tag was not properly cast to a :ul or :ol tag. Added unit testing for all cases. 2015-11-08 20:35:04 -05:00
Jeff Rabinowitz
365df0e680 Reimplemented TOC logic using zippers to ensure state is always internally valid. Also added unit testing to provide a regression testing suite. This should fix issue #19. 2015-11-01 19:34:06 -05:00
Carmen La
1063704f4f Swap order of _list-types and list-type in toc.clj 2015-10-31 14:50:51 -04:00
Carmen La
30b3503abc add '.html' ending to prev/next links in preview pages 2015-10-31 14:50:03 -04:00
Carmen La
21e3c0e75f Add ".html" ending to preview pages.
cryogen-project/cryogen#92
2015-10-31 13:54:37 -04:00
Jeff Rabinowitz
61e93a3480 fixed bug with threading macro in wrong order. fixed bug with where space not present between tag and class for top level ul/ol.. 2015-10-27 22:58:22 -04:00
Jeff Rabinowitz
482700a311 Submitting a feature request for the :toc to support both ordered and unordered lists by expanding the vocabulary of the existing :toc directive to include :ul and :ol 2015-10-25 19:14:43 -04:00
Jan Stępień
2a95e477de Parallelize read-posts with pmap
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.
2015-09-23 21:46:11 +02:00
Jan Stępień
aa7ac4d98c require pandect.algo.md5 instead of pandect.core
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.*
2015-09-21 15:23:13 +02:00
Jan Stępień
c557fa8478 Simplify load-plugins with enumeration-seq 2015-09-20 22:52:51 +02:00
Jan Stępień
1a7c48731a Simplify create-previews with map 2015-09-18 22:22:40 +02:00
Jan Stępień
f6a7d17213 Don't invoke select-keys on post in create-preview
This allows preview templates to access all of post's metadata.
2015-09-18 22:22:13 +02:00
Jan Stępień
1b4306c3a3 create-preview: simplify the more marker lookup
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.
2015-09-17 17:13:45 +02:00
Marko Kocic
8e5b3a9fee Fix type hint cast 2015-09-15 18:24:51 +02:00
Marko Kocic
f4888b26d9 Clear reflection warnings 2015-09-14 12:06:35 +02:00
Randall Mason
03cfabcbb9 Add enclosure tag to facilitate Podcasting with Cryogen
Add an enclosure tag to a post's metadata to let a podcast client
to deliver your audio content.  It should look like this:

:enclosure [{:url "<full-url>"}]

Without the brackets, you end up with NullPointerExceptions, so
make sure you have that.

The URL should be the full location of where the audio file is
hosted (not relative), so for example:

:enclosure [{:url "http://www.example.com/01_episode_IV.mp3"}]

I created a bunch of markdown files with just the enclosure and
info about the audiobook with the following bash snippet:

find -L books -type f -iname "*mp3" | sort | while read mp3; do name=$(basename $mp3 .mp3); book=$(basename "$(dirname $mp3)"); echo "{:title \"$name\"\n:layout :post\n:tags [\"audiobooks\" \"$book\"]\n:enclosure [{:url \"http://clashthebunny.mason.ch/blog/$mp3\"}]}\n $book - $name\n==================" > md/posts/"$(date "+%Y-$name").md"; done

Each book was in it's own subdirectory of books:
books/Dracula/1-01-Chapter1_part01.mp3
books/Dracula/1-02-Chapter1_part02.mp3
books/Dracula/2-01-Chapter2_part01.mp3

Note that the above script requires the prefix of the episode to
be "date-like".  It should be fairly easy to work out a way to get
your podcast up and running.

Add the book names to your rss-filters array, e.g.:
["Dracula" "Pride & Prejudice"]

Most podcasting clients support authentication, so just password
protect those directories and you should be good to go, even
if you are hosting copyrighted content.
2015-09-03 11:27:55 -05:00
Chris
8eb0e9ff29 Add active-page key to config map
For certain pages a key with a boolean value is added to the config map which can then be used in templates to determine if it is the page being rendered. Not all pages have this key and boolean value. Instead of adding additional keys for every page a new generic key, 'active-page', has been added and its value is the page name, ex: 'home', 'archives', 'tags', etc. The default value is 'home'. This key can then be used in any template to check the page which is currently being rendered.
2015-08-17 07:30:23 -07:00
Carmen La
837f855726 Merge branch 'post-date' of https://github.com/powernoodle/cryogen-core into powernoodle-post-date 2015-08-06 13:37:50 -04:00
Kirill Kondratenko
71bb80cf49 Use the default locale for the instance of the JVM
instead of the hardcoded "en" locale
2015-08-06 00:27:54 +03:00
Brendon Walsh
e710f08679 Optional :date key can be provided in metadata 2015-07-29 11:50:00 -04:00
Carmen La
64a9830f6d Only make the "prev" link in the second page when the second page actually exists 2015-07-08 16:55:31 -04:00