mehdisadeghi / jekyll-jalali

Jalali date plugin for Jekyll
MIT License
32 stars 1 forks source link

English numbers #3

Closed perpi closed 6 years ago

perpi commented 6 years ago

I used the code {{ page.date | jdate: "%A %d %b %Y"}}, but it generates english numbers like this:

‫شنبه 12 فروردین 1396

While I was expected for:

‫شنبه ۱۲ فروردین ۱۳۹۶

What should I do to turn numbers to Farsi?

mehdisadeghi commented 6 years ago

For mapping European style numbers to Arabic style numbers I use another filter. Perhaps it makes more sense to merge that filter into this repository.

perpi commented 6 years ago

Ah, thanks for the hint. Now it works well.

Anyway, 'merging' would be a nice idea.

mehdisadeghi commented 6 years ago

I'll consider displaying numbers based on the language set in the context in #4

perpi commented 6 years ago

Hi. Has the plugin taken any change? I'm getting this error:

Liquid Exception: Liquid error (line 16): invalid arguments or invalid Jalali date in /_layouts/post.html

Line 16:     <span>{{ page.date | jdate: "%A %d %b %Y" | habify }}</span>
mehdisadeghi commented 6 years ago

@perpi which Ruby version are you using? I released a new jalalidate gem version which uses Integer instead of Bignum. That's the only change that I could think of.

perpi commented 6 years ago

$ ruby --version ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]

jekyll version: 3.6.2

screenshot from 2017-11-23 02-51-51

But the GitLab deployment process is failed too, while it probably uses the latest version.

perpi commented 6 years ago

Hmmm, no idea?

mehdisadeghi commented 6 years ago

@perpi you have to use either ruby 2.4 or use an older version of jalalidate such as v0.3.3.

mehdisadeghi commented 6 years ago

I also released a new version of jekyll-jalali that solves your problem by forcing v0.3.3 of jalalidate for the time being.

perpi commented 6 years ago

Yoohoo, Now it's working again. Thanks bro.

‌ ‌ ‌ ‌

you have to use either ruby 2.4

Yeah, but it's not available in the Ubuntu repo yet. I'm afraid of installing stuff out of official repositories.

mehdisadeghi commented 6 years ago

@perpi

After that release I am getting complains from other users to upgrade jekyll-jalali so that they don't get FixNum is deprecated warnings.

However, you can still pinpoint the older jekyll-jalali release in your Gemfile. It is actually very easy. You need to slightly change your Gemfile:

group :jekyll_plugins do
   gem "jekyll-jalali", "= 0.1.1"
   gem "jekyll-hinduarabic"
end

If you had any problems, please open a new issue.

alihardan commented 5 years ago
اگر کسی نمی‌خواد برای این کار از یک فیلترِ جدید استفاده کنه، این کارِش رو راه میندازه:
{{ post.date | jdate: "%d %b %Y" | replace: "0", "۰" | replace: "1", "۱" | replace: "2", "۲" | replace: "3", "۳" | replace: "4", "۴" | replace: "5", "۵" | replace: "6", "۶" | replace: "7", "۷" | replace: "8", "۸" | replace: "9", "۹" }}