@pcdevil/eleventy-plugin-intl-utils 0.3.0 → 1.0.0

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.
package/README.md CHANGED
@@ -8,13 +8,6 @@ However it only gives solution for static data and dynamic data still needs trea
8
8
 
9
9
  The implementations of the filters are mostly wrappers around the [ECMAScript Internationalization API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) with a little _bit of sugar_.
10
10
 
11
- ## Current state
12
- The package uses [Semantic Versioning](https://semver.org/) to signal changes between releases.
13
-
14
- Currently is at _major version zero_ and as [the specification states](https://semver.org/#spec-item-4) the current API is not at stable state.
15
-
16
- Please always compare versions between updates!
17
-
18
11
  ## Usage
19
12
  This guide corresponds to [Eleventy documentation](https://www.11ty.dev/docs/plugins/#add-the-plugin-to-eleventy-in-your-config-file):
20
13
 
@@ -60,9 +53,10 @@ Transforms a country code into a country name. Useful to display author's locati
60
53
  ```
61
54
  {% assign country = "FR" %}
62
55
  {{ country | country_name }}
63
- {% comment %} renders "France" when the `intlUtilConfig.locale` is `en` {% endcomment %}
64
56
  ```
65
57
 
58
+ This renders "France" when the `intlUtilConfig.locale` is `en`.
59
+
66
60
  ### `language_name`
67
61
  Transforms a language code to a renderable text. Useful for language selectors or when the current language is displayed.
68
62
 
@@ -73,9 +67,10 @@ Transforms a language code to a renderable text. Useful for language selectors o
73
67
  ```
74
68
  {% assign language = "en-GB" %}
75
69
  {{ language | language_name }}
76
- {% comment %} renders "British English" when the `intlUtilConfig.locale` is `en` {% endcomment %}
77
70
  ```
78
71
 
72
+ This renders "British English" when the `intlUtilConfig.locale` is `en`.
73
+
79
74
  ### `short_datetime_format`
80
75
  Transforms a date string to a short date time text. Useful for blog post dates.
81
76
 
@@ -86,9 +81,10 @@ Transforms a date string to a short date time text. Useful for blog post dates.
86
81
  ```
87
82
  {% assign postDate = "2021-12-12 17:36 +0100" %}
88
83
  {{ postDate | short_datetime_format }}
89
- {% comment %} renders "12/12/21, 5:36 PM" when the `intlUtilConfig.locale` is `en` {% endcomment %}
90
84
  ```
91
85
 
86
+ This renders "12/12/21, 5:36 PM" when the `intlUtilConfig.locale` is `en`.
87
+
92
88
  ## Shortcodes
93
89
 
94
90
  ### `year_interval`
@@ -104,9 +100,10 @@ The input should be an array with two date string and the first one should prece
104
100
  {% assign startDate = "2011-05-16 11:00 +0200" %}
105
101
  {% assign endDate = "2020-03-01 00:00 +0100" %}
106
102
  {% year_interval startDate, endDate %}
107
- {% comment %} renders "2011 – 2020" (with en dash in the middle) when the `intlUtilConfig.locale` is `en` {% endcomment %}
108
103
  ```
109
104
 
105
+ This renders "2011 – 2020" (with en dash in the middle) when the `intlUtilConfig.locale` is `en`.
106
+
110
107
  #### Fallback value
111
108
  The second `endDate` argument can be omitted and it has the current date as default value.
112
109
 
@@ -115,8 +112,9 @@ This behaviour helps when an open-ended / ongoing interval needs be displayed:
115
112
  ```
116
113
  {% assign startDate = "2011-05-16 11:00 +0200" %}
117
114
  {% year_interval startDate %}
118
- {% comment %} renders "2011 – 2021" (with en dash in the middle) when the `intlUtilConfig.locale` is `en` and the current year is 2021 {% endcomment %}
119
115
  ```
120
116
 
117
+ This renders "2011 – 2021" (with en dash in the middle) when the `intlUtilConfig.locale` is `en` and the current year is 2021.
118
+
121
119
  ## License
122
120
  Available under the [MIT license](LICENSE.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pcdevil/eleventy-plugin-intl-utils",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/.eslintrc.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "extends": [
3
- "eslint:recommended",
4
- "standard"
5
- ],
6
-
7
- "ignorePatterns": [
8
- "!.eleventy.js"
9
- ],
10
-
11
- "parserOptions": {
12
- "sourceType": "script"
13
- },
14
-
15
- "root": true,
16
-
17
- "rules": {
18
- "curly": ["error", "all"],
19
- "array-element-newline": ["error", "consistent"],
20
- "arrow-parens": ["error", "always"],
21
- "comma-dangle": ["error", {
22
- "arrays": "always-multiline",
23
- "exports": "always-multiline",
24
- "functions": "never",
25
- "imports": "always-multiline",
26
- "objects": "always-multiline"
27
- }],
28
- "indent": ["error", "tab"],
29
- "no-tabs": "off",
30
- "object-property-newline": ["error", {
31
- "allowAllPropertiesOnSameLine": false
32
- }],
33
- "semi": ["error", "always"],
34
- "valid-jsdoc": "off"
35
- }
36
- }
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v16.13.1