jekyll-date-localization 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -0
  3. metadata +11 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b1e97dbc5c5066e197bd44b8e92c759b3071b9e3faa544dd11d8c457b01ee31
4
- data.tar.gz: 4608a85a4a3546965b5623aad0edf7a29ded98f907c03fcf953e42be8bcd1db4
3
+ metadata.gz: 0aa5fadb004e118e4f612c80969b7e4b3ff5c71afe3a79ca20bc400e2871a890
4
+ data.tar.gz: 81c086a6121fc223bc9cbe866613de2d2bed4f836d9c3c66461e792267229763
5
5
  SHA512:
6
- metadata.gz: c8569448bd12eed1363f62592517d671290bcdfa031526de819a616e78e52925ee4ef7210e92794c8936db571f931095030a8fef6cc0b2e0e361eb50dc5cc7b5
7
- data.tar.gz: 8b78c5653c0d2d0b9a5f5d1d7e0e9354814598ca1cd1abeb7b02a5843ff16f8dda811f6fa41596a007c49daca370983c3a065c3bb835a5a387a0c096fd4bbc1a
6
+ metadata.gz: d701570d04a4589a144786284f37fb6359bed6b1d4d69144c175d63f113749a83cbbda779232041a24ae5051c327fb0d32c9224534842e56c8bc118aab9c8b69
7
+ data.tar.gz: 88534130a3f1b0cc62a0b2abeaf20ce9c9ef9c9ca9f01c3b3eaeef22f99445037987664ad95e2bf85ee60dcb20cb9fecc2129c5791f2f2be8eea6fc60895869d
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Jekyll Date Localization
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/jekyll-date-localization.svg)](https://badge.fury.io/rb/jekyll-date-localization)
4
+
5
+ > Jekyll plugin for for custom locale date formatting
6
+
7
+ Jekyll Date Localization is a liquid filter plugin for formatting a date with a custom locale. The idea is based on [jekyll-i18n-date](https://github.com/uwolf/jekyll-i18n-date) however this package provides a gem-based plugin with a couple of locales already included for ease of use.
8
+
9
+ This is a simple plugin only for localizing dates, for larger scale translation capabilities check this [list of plugins](https://github.com/planetjekyll/awesome-jekyll-plugins#multi-language--multi-lingual).
10
+
11
+ ## Installation
12
+
13
+ This plugin is available as a [RubyGem](https://rubygems.org/gems/jekyll-date-localization).
14
+
15
+ There are a few ways to install the plugin ([docs](https://jekyllrb.com/docs/plugins/installation/)), e.g. by adding this line to your application's `Gemfile`:
16
+
17
+ ```
18
+ gem 'jekyll-date-localization', group: :jekyll_plugins
19
+ ```
20
+
21
+ And then execute the `bundle` command to install the gem.
22
+
23
+ ## Configuration
24
+
25
+ You can configure the default locale in your `config.yml` file:
26
+
27
+ ```
28
+ date_locale: cs
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ In your markup, simply use the `localize` liquid filter made available through this plugin:
34
+
35
+ ```
36
+ {{ page.date | localize '%d. %B %Y' }}
37
+ ```
38
+
39
+ By default the value of `date_locale` is used to select the language. Alternatively you can also directly specify the language:
40
+
41
+ ```
42
+ {{ page.date | localize '%d. %B %Y', 'fr' }}
43
+ ```
44
+
45
+ For details about the formatting string, see [strftime](https://ruby-doc.org/stdlib-2.6.1/libdoc/date/rdoc/DateTime.html#method-i-strftime) documentation. The localized entries are `%b %B %a %A`.
46
+
47
+ ## Additional languages
48
+
49
+ There are a couple of built-in languages in this repository in the [lib/locales](https://github.com/krupkat/jekyll-date-localization/tree/main/lib/locales) directory. If you want to add your own language file or override one of the included languages, create a new `*.yml` language definition file and put it in the `_locales` directory of your project.
50
+
51
+ # Contribute
52
+
53
+ Feel free to send PRs with additional languages or improvements.
54
+
55
+ # Copyright
56
+
57
+ Copyright (c) 2022 Tomas Krupka
58
+
59
+ License: MIT
metadata CHANGED
@@ -1,35 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-date-localization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - Tomas Krupka
7
+ - krupkat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-02 00:00:00.000000000 Z
11
+ date: 2022-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.0'
27
27
  description:
28
28
  email:
29
29
  executables: []
30
30
  extensions: []
31
- extra_rdoc_files: []
31
+ extra_rdoc_files:
32
+ - README.md
32
33
  files:
34
+ - README.md
33
35
  - lib/jekyll-date-localization.rb
34
36
  - lib/locales/cs.yml
35
37
  - lib/locales/de.yml
@@ -49,7 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
51
  requirements:
50
52
  - - ">="
51
53
  - !ruby/object:Gem::Version
52
- version: '0'
54
+ version: 2.0.0
53
55
  required_rubygems_version: !ruby/object:Gem::Requirement
54
56
  requirements:
55
57
  - - ">="