Date Manipulation #712

bhardin opened this Issue Dec 28, 2012 · 4 comments

3 participants


Is there a way to manipulate the site.time?

I'm looking to do something like below for the sitemap.xml...

{% if < site.time - 1.month %}
 {% else %}

Does anyone know if this is possible?

Jekyll member

If I understand correct, you want to check if post is older than one month.

AFAIK liquid do not allows to run arbitrary Ruby code. So I think you'll need either "extend" post data with plugin to provide, let's say freq field so your code will look like:

<changefreq>{{ post.freq }}</changefreq>

Or, add an additional liquid tag, and use it like this:

<changefreq>{% changefreq %}</changefreq>

Second option is little bit easier to achieve.

Jekyll member

I also host my blog on GH-pages, but generating my blog locally and then pushing compiled site only :D This allows me to use any crazy plugin I want :D

Jekyll member

If you want to use plugins which are deemed "unsafe" by GH Pages, you just generate the site locally and push the compiled site to your gh-pages branch.

@parkr parkr closed this Dec 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment