Giter Site home page Giter Site logo

cryogen-project / cryogen Goto Github PK

View Code? Open in Web Editor NEW
1.1K 29.0 99.0 970 KB

A simple static site generator written in Clojure

Home Page: http://cryogenweb.org/

License: Eclipse Public License 1.0

Clojure 10.91% CSS 19.24% HTML 59.07% SCSS 10.78%
clojure cryogen static-site-generator html static-site

cryogen's People

Contributors

ampersanda avatar bombaywalla avatar chadhs avatar daemianmack avatar dl1ely avatar euvitudo avatar himmallright avatar holyjak avatar jayp avatar jethrokuan avatar jumarko avatar kingmob avatar lacarmen avatar ljpengelen avatar madstap avatar matthewsiemens avatar mcurence avatar michel-slm avatar mingp avatar nbardy avatar oubiwann avatar rspacjer avatar seancorfield avatar simon-brooke avatar tankanow avatar transducer avatar turbopape avatar uhnuser avatar viperscape avatar yogthos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryogen's Issues

Support multiple authors

Cryogen doesn't support authored-by for each post, page, etc. Organizations with multiple blog authors may need this. This should be supported to increase uptake.

Post metadata

Very new Clojure programmer and have been actively looking at the source code of Cryogen and planning on making some pull requests in the future. I was thinking I'd start with this feature as something I have started on my own and see what your thoughts were.

I'm looking for a feature that will allow :slug in the post metadata which will override the default slug for the post. In time, this could also expand to adding :date which would free up the filename restrictions of posts. This would be particularly useful for people migrating from another CMS or static site generator to Cryogen.

Is this something planned for Cryogen or something you'd be willing to accept as a possible pull request in the future?

Sub-folders in pages?

I created a sub-folder of pages:

resources/templates/pages/asc/pages/auth/auth.asc

However, the output was:

resources/public/pages/auth.html

It is somewhat important to me to keep the folder structure. Is this behavior a bug, or intentional?

Similar or "You might be interested" posts

This is a nice feature of the blog engine to provide set of articles in the end of the post linking to similar/"you might also like" posts.

One way to implement this might be to add 2 extra metadata into post header, in addition to :title, :layout and others:

  1. :id - an id/alias of the current post, like :id :clojure-intro (so, easily memorizable for the blog owner, and used only internally instead of relying on the post file name or title, which might be changed separately from the :id)
  2. :similar-posts <vector of id-s>, like :similar-posts [:clojure-intro :value-simplicity], etc. So, the author decides himself what other articles related to this one, and which might be interested for the reader as well.

And then update the page template to iterate over :similar-posts if it is not empty, to put set of links on the bottom or somewhere else recommending further reading.

Feature request: Tag-specific RSS feeds

I'd like to add my blog to several topic-specific planets, but they require curated RSS feeds (e.g. the Clojure planet requires only Clojure-related posts). Could Cryogen support this?

Need faster/smarter compilation

It appears that the whole world gets rebuilt every time any file is changed instead of just the single file. I'm sure you're aware of this problem. When I had only a couple pages/posts, I was compiling in ~1 second. But now with ~15, it’s taking 4+s, and sometimes 9s.

This doesn’t feel like a showstopper yet, but I expect it to get pretty painful for those who write a lot and like to frequently look at a browser view of their posts.

Note that these are Asciidoc files, and I don’t know if that’s just slower than compiling Markdown.

I haven’t tried profiling the compilation yet, but it seems that the watcher should only recompile a single .asc/.md file. Hopefully that’s where most of the time is going. It looks like the majority of time is spent in the stage “compiling assets...”.

I also just noticed that lein is growing to use ~3 GB of memory!! after a lot of compilations. That’s not what’s causing the slow compiles, though.

(Sorry for the flurry of issues. I just want to make sure the findings are being documented as I hit them.)

Where to place static top-level files?

There are a handful of files that I'd like to live at the top level of the blog (or they could be in some dir): favicon.png, my-gpg-key.asc, robots.txt, etc. Where should these be placed? It seems that placing them in resources/public/ does not work since they are destroyed on compile. I also tried placing them in the theme, but that felt odd and did not work either.

It seems the fix is to just copy files sitting at the top level into public/, in the same manner that is done with 404.html.

Add option for Stylus support

Would an option to use Stylus instead of sass scss. it just avoids the requirement of installing ruby just to get sass.

Support for content tags in RSS feed

I noticed that Cryogen, when export posts to RSS, does not export tags. RSS spec support this (it is called category) and here is the relevant part.

For example, Blogger is using this form for putting tags:

<category scheme="http://www.blogger.com/atom/ns#" term="TAG1"/>
<category scheme="http://www.blogger.com/atom/ns#" term="TAG2"/>
...

and WordPress more standarized form like:

<category>TAG1</category>
<category>TAG2</category>

I'm using tags extensively to generate news on my other site; the script would scrape daily blog feeds searching for the new posts with specific tag and when found, would fetch the title and body, generating news.

Also, RSS readers will benefit from this too since they can order content based on category data, especially if there is significant number of feeds.

What do you think about this option?

site prefix in edn and running ring server's directory watcher

Not a big deal, but I noticed that if the site prefix in edn was changed, for it to update on the page I had to shut down and restart ring-- took me a min to realize that.
Also I was able to build on leiningen 2.4.2 even though you state 2.5.0, so thats good :)
And while we're at it, I wanted to mention that you can suggest (in addition to suggesting nginx/apache) that it's easy to upload a static site to github for free hosting, simply sync what's inside the public folder to a github.io repo (and add a CNAME file with dns entry). Thanks!

empty img folder will be discarded from git commit

When cloning into another folder there is no resources\templates\img folder available which leads to an error during assets generation.

I guess a simple .keep file in img folder is enough. Or maybe create the img folder if it is non-existent during asset generation.
Or maybe just don't load anything from the img folder if it does not exist.

Date is not parsed correctly

I've set :post-date-format "yyyy-MM-dd" and have post names like 2013-02-10-backbone-object-creation.md but it is rendered as 4. August 0015 ..

Markdown support for links-at-bottom?

Is it a good idea to have a selection of markdown engine? Or is there an option to markdown-clj to enable this?

Go [here] to do such-and-such.

[here]: http://example.com/

MathJax

I am new to Clojure and webpages for that matter but I was wondering if there is any support for using MathJax or something similar with Cryogen.

Thanks!

Posts are sorted randomly after date formatting update

After the update of this evening - where selmer got updated and new date formatting got introduced - posts in my archive page are randomly sorted, like so:

2013 October

October 31, 2013 - Hello World! This is Clojure Tunisia!

2014 May

May 20, 2014 - Reading Clojure for Machine Learning
May 14, 2014 - core.async and the STM to the rescue
May 8, 2014 - Back to emacs

2014 June

June 14, 2014 - Reading Storm Blueprints - Patterns for Distributed Realtime Computation

2013 November

November 7, 2013 - Clojure Presentation @ Faculté des Sciences de Tunis

2014 October

October 26, 2014 - Released our First Lib as part of Automagic Tools : Milestones !!

2014 April

April 11, 2014 - Yet Another Post

2014 September

September 30, 2014 - Our Entry in the Clojure Cup 2014 - Intelligent Scheduling with Milestones !!

2014 March

March 10, 2014 - A Post

2014 November

November 17, 2014 - We are on Cryogen !
November 13, 2014 - Using Cryogen

Unchanged template does not generate files

Adding a feature, testing with a blank new cryogen blog with default config.edn, i noticed „lein ring server“ or „lein run“ will not generate any files, only will copy over the resources. I suspected a side effect of my new feature, but stashing the stuff and testing with current HEAD shows the same issue.

Steps to reproduce:

  • lein new cryogen test-blog
  • cd test-blog
  • lein ring server

index.html in browser will not be found. test-blog\resources\blog\public only contains css and js subdirs, no generated html files.

Actually i have no idea what is going on there.

EOF while reading string, : \

My apologies if this isn't your issue but this is my first cryogen blog. I cannot see any errors that I have made but keep receiving the below error.

I notice that in the error its compiling User as C:\Users: \sayth\ is it this incorrect path separate with : \ that's the issue if so how can I fix?

java.lang.RuntimeExceptionException in thread "main" java.lang.RuntimeException: EOF while reading string, compiling:(C:\Users: \sayth\AppData\Local\Temp\form-init627878547038619336.clj:1:106)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)

nullpointer on latest build

Making sure it wasn't me, I recloned your repo and ran lein ring server from the sub cryogen folder. As a note, I had trouble using io.clj with my own code, it was always complaining about not finding the resources so instead I used something like:

(slurp (io/resource (str "../resources/templates/html/layouts/" t)))

Error below:

Exception: java.lang.NullPointerException: null
                                          io.clj:8 cryogen.io/get-resource
                                  compiler.clj:168 cryogen.compiler/read-config
                                     server.clj:13 cryogen.server/fn
                                      core.clj:104 compojure.core/make-route[fn]
                                       core.clj:94 compojure.core/wrap-route-middleware[fn]
                                       core.clj:41 compojure.core/if-route[fn]
                                       core.clj:27 compojure.core/if-method[fn]
                                      core.clj:118 compojure.core/routing[fn]
                                     core.clj:2515 clojure.core/some
                                      core.clj:118 compojure.core/routing
                                   RestFn.java:139 clojure.lang.RestFn.applyTo
                                      core.clj:626 clojure.core/apply
                                      core.clj:123 compojure.core/routes[fn]
                                      Var.java:379 clojure.lang.Var.invoke
                                     reload.clj:18 ring.middleware.reload/wrap-reload[fn]
                                 stacktrace.clj:15 ring.middleware.stacktrace/wrap-stacktrace-log[fn]
                                 stacktrace.clj:79 ring.middleware.stacktrace/wrap-stacktrace-web[fn]
                                      jetty.clj:18 ring.adapter.jetty/proxy-handler[fn]
                                  (Unknown Source) ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle
                           HandlerWrapper.java:116 org.eclipse.jetty.server.handler.HandlerWrapper.handle
                                   Server.java:363 org.eclipse.jetty.server.Server.handle
                   AbstractHttpConnection.java:483 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest
                   AbstractHttpConnection.java:920 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete
                   AbstractHttpConnection.java:982 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete
                               HttpParser.java:635 org.eclipse.jetty.http.HttpParser.parseNext
                               HttpParser.java:235 org.eclipse.jetty.http.HttpParser.parseAvailable
                       AsyncHttpConnection.java:82 org.eclipse.jetty.server.AsyncHttpConnection.handle
                    SelectChannelEndPoint.java:628 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle
                     SelectChannelEndPoint.java:52 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run
                         QueuedThreadPool.java:608 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob
                         QueuedThreadPool.java:543 org.eclipse.jetty.util.thread.QueuedThreadPool$3.run
                                   Thread.java:745 java.lang.Thread.run

documentation fix

Hi,

I want to suggest a documentation change. Currently your github project page states that "The site configuration file is found at resources/config.edn". I just ran the lein new cryogen task, and found the generated configuration file is actually at resources/templates/config.edn. Small matter, but worth fixing.

Thanks for sharing,
drc

[bug] toc

### Hiccup
### Enlive
### Selmer
## Conclusion

produce

<ol class="contents">
<li><a href="#hiccup">Hiccup</a></li>
<li><a href="#enlive">Enlive</a></li>
<li><a href="#selmer">Selmer</a></li>
</ol>

<li><a href="#conclusion">Conclusion</a></li>

Please notice <li><a href="#conclusion">Conclusion</a></li> is outside any ol or ul tag.

Why somebody want start with h3 and later has h2? The answer is simple. The title of post is h2 and this is not included in toc (this is good). But to consequence i want have on site:
h2 - post title
h3 - some points
h2 - some things like conclusion

deploying to gh-pages

Hi

I'm having trouble deploying a cryogen site to gh-pages. The issue is that the generated links don't work, for example if my page is at https://jonase.github.io/my-page/the links will point to e.g., https://jonase.github.io/archive.htmland not https://jonase.github.io/my-page/archive.html. Note that adding /my-page as :blog-prefix doesn't help either. Is there a way to fix this?

sitemap not updating/old & deleted posts not being removed

I noticed that after removing tags from one post, and removing a page and a another post altogether, that the sitemap.xml is not regnerated properly (contains original info). I think this is because the older generated files in public were never removed even though in templates they were. Does the sitemap get generated from the public folder's contents?
It may be better to wipe and rewrite the contents of public each time, maybe. If that's the case just keep in mind that some files may be added manually (for me it's a .git folder since I sync to git, .gitignore, and CNAME). So it may be a good idea to have an ignore file that doesn't touch files in public, if you go the route of wiping and rewriting each time. Alternatively you could have a custom/static folder in templates that simply copies to public each time, though that doesn't solve the .git folder, which would need to reside inside public. Just something to think about! I'll manage it manually I think unless you think of some ideas.

Changing theme of the blog

Hi @yogthos and @lacarmen!
It's really nice project ") I've tried several static site generators (in clojure) and this is the first one that was really user-friendly from the beginning.
I'm new to all this stuff, so sorry for stupid questions.. You say in the features list:

Theming support with Twitter Bootstrap

And of course, the first thing I want tot do with a new blog is to customise it. But as I say I'm new to this and I'm kind of lost with all the templates and styles.. Is there a simple way to take a Bootstrap theme/templates and apply it to the blog?
Also you use your own Selmer templating engine, so I guess that existing templates in Liquid (from Jakyll) or whatever else won't fit, right?

Add "Read More" snippet/elision support

A "Read More/Continue Reading" cutoff (example) saves the landing page from simply becoming your most recent (sometimes long) post. An alternative is to make the archive page your landing (example). But I believe it's most desirable to have the top matter (abstracts) from ~5 posts comprise the landing page. Then the bottom of the page could have a link to the archive instead of the next article (example).

This seems to be often done with a simple <!-- more --> comment marker right in each post. This is trivial in Markdown, and in Asciidoc one just needs to insert 3 lines:

++++
<!-- more -->
++++

This should be a simple matter for the blogger to just place a "snippet" for-loop in base.html. So the real change here is to have the engine cut and store snippets in the generated index.html for each compile.

A bit of care might be taken to not include Asciidoc TOCs in the snippet. Maybe the blogger should just not use TOCs. But hopefully it's easy enough to detect/remove the <ol class="contents"> section. Even better would be to have TOCs come after the more marker. This gives the feel of each post having an "Abstract" at the top, which is also the snippet.

Summary: support post snippets, and place N (default ~5) snippets on the home page.

Read cryogen selmer layouts?

Hi,

I am sorry, but i can't find any ready layouts to download from the Internet and i believe more people like me are looking layouts for cryogen, so mayby my question will be helpful also for others.

So my question is: Where can i find ready layouts to use with cryogen? Or they just don't exist? :) If they exist somewhere deep in the Internet maybe it is worth to mention about that in doc.

Build task in lein

The assets are generated to the resources directory when I start up the ring server. I could not find a task which just generates the assets. It would be useful as often that's the only thing I need to get. Something like lein build

Post order still wrong?

I have two posts, one 27-08-2013-abc.md, another one 08-10-2013-xyz.md. Dates of both posts get parsed correctly as August 27, 2013 and October 8, 2013, but still the August 27 post comes first, before the October 8 one. I expect the October 8 one to be before August 27.

If it matters, my locale is "de".

I can look into that issue myself later.

Copy of images from markdown folder fails

If config.edn defaults are not containing "img", the copy of images from markdown folders fails.

Default is:
:resources ["css" "js" "404.html"]

fix:
:resources ["css" "js" "img" "404.html"]

Feature request: Custom Selmer filters

I'd like to be able to add custom filters for Selmer. If it's currently possible to do that, I'd like it to be documented in the README.md.

Thanks for a great tool.

How to re-format post.date?

Instead of "November 13, 2014", I'd like to get "Nov 13, 2014".

I've found {{post.date|date:longDate}}, but I don't know this format
and how to customize it.

"Tags" renders when there are no tags

This bit of code:

{% if post.tags %}
<div id="post-tags">
  <b>Tags: </b>
  {% for tag in post.tags %}
  <a href="{{tag.uri}}">{{tag.name}}</a>
  {% endfor %}
</div>
{% endif %}

which is in resources/templates/html/layouts/post-content.html, results in the <b>Tags: </b> being rendered regardless of whether there are any :tags in the entry metadata.

Could you switch to iso8601 / rfc3339 dates for the blog entries?

a) this is the only unambiguous date notation. No need to for meta information.
There is no yyyy-dd-MM notation...
b) it sorts much nicer in the file system
c) dd-MM-yyyy is not very common. It's allmost only used in continental europe. And even there it's old-school since 1992, when iso8601 was included in EN 28601. Since then numerical dates should follow the yyyy-MM-dd form, only alphanumerical dates shall use the old form (e.g. 1. Mai 1992 in Germany).

TOC Example wrong for asc-files

10-10-2014-adoc-post.asc has :toc true in the front matter and a toc::[] in the asciidoc source. toc::[] is ignored, and the cryogen-rendered TOC is displayed. To have the (freely positionable) asciidoc TOC, front matter must be :toc false to disable creation of TOC by cryogen, and inside the asciidoc document you need :toc: macro at the top and a toc::[] where the TOC is supposed to be displayed. See http://asciidoctor.org/docs/user-manual/#manual-placement

TOC displays UTF-8 characters wrong

I use a „long hyphen“ — in one of my markdown headings. In the TOC, it gets corrupted somehow and the browser displays it as the dreaded white question mark on black diamond. I will investigate further, time is tight right now. This is supposed to serve as a TODO for me 😄

How to update blog with new version?

Is there a recommended way to get new stuff from the cryogen template into the blog created by "lein new cryogen my-blog"? Pulling master updates the template code, but certainly not the code copied to "my-blog" from the template before pulling.

Any advice?
Thanks.

In default theme, on small screen widths, title overflows container [bug]

I just created a new Cryogen project with lein new cryogen foobar and then ran the development server with lein ring server inside the project directory. (I believe this gets me the latest versions of the relevant dependencies.) Attached are screenshots from Mac OSX Yosemite + Chrome latest.

image

image

The large screen width (desktop-ish) appears to render as expected. The small screen width (mobile phone-ish) appears to have a styling bug where the title text is overflowing the menu bar container in the case of drop-down letters like y and g.

I think the simplest fix would just be to increase the mobile nav height, possibly to the same as the desktop one.

What do others think? If desired, I can put together a pull request with this change.

Thanks!

home.html pointing to a specific page

I'm getting started with cryogen, please excuse if this is a stupid question or the wrong channel to ask...

I'm trying to make the home.html page point to a specific markdown page in the /pages directory.
In the example config it shows the latest blog post, how would I make it render the contents of, say, the about.md page?

Thanks!

[rfe] Support Jade markup

Asciidoc is already a really compelling feature of cryogen, but having Jade (clj-jade) would be even better for pages needing richer design. Seems this could be cleanly added as another module.

add title tag for the home page

Currently we don't set a title for the home page, should probably default to the latest post and it should be possible to customize a custom one in the config.

Language mismatch in date on archives page

The groups on the archive page are created by using SimpleDateFormat. "yyyy MMMM", while in archives.html, the post dates are displayed by {{post.date|date:longDate}}.

On locale german, "yyyy MMMM" creates "2014 März" (for march), while the post date is March 10, 2014. I want an english language blog, so SimpleDateFormat must be fixed.

Image resources rely to full qualified path

If a relative image resource is used (img/pic01.png), the image is only found when the /blog start page is called. There are no rewrites if the same content is opened in /blog/pages or /blog/posts. So it results in an article without pictures (404).

Full qualified names might break during the deployment (where for example "/blog" changes).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.