So you want to have persian date
in your jekyll blog/site ? This plugin provide pdate
filter for Liquid
.
Special thanks to @hzamani for Parsi Date gem.
Add this line to your application's Gemfile:
gem 'jekyll_pdate_plugin'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jekyll_pdate_plugin
pdate
filter instead of date
filter:Example: /path/to/_layouts/post.html
---
layout: default
---
<h2>{{ page.title }}</h2>
<p class="meta">{{ page.date | pdate }}</p>
<div class="post">
{{ content }}
</div>
---
layout: default
---
<h2>{{ page.title }}</h2>
<p class="meta">{{ page.date | pdate: "%Y %A %d %B" }}</p>
<div class="post">
{{ content }}
</div>
Default filter output format is %A %d %B %Y
. To change this format add following configuration to your _config.yml
...
pdate_filter: "FORMAT"
NOTE: This configuration has a higher priority than calling pdate filter with an argument.
Simply just use this filter wherever you want to convert english numbers to persian numbers.
Example: /path/to/_layouts/post.html
---
layout: default
---
<h2>{{ page.title | pnumber }}</h2>
<p class="meta">{{ page.date | pdate_to_string | pnumber }}</p>
<div class="post">
{{ content }}
</div>
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)