Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jekyll-date-localization

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jekyll-date-localization

  • 0.0.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Jekyll Date Localization

Gem Version

Jekyll plugin for for custom locale date formatting

Jekyll Date Localization is a liquid filter plugin for formatting a date with a custom locale. The idea is based on jekyll-i18n-date however this package provides a gem-based plugin with a couple of locales already included for ease of use.

This is a simple plugin only for localizing dates, for larger scale translation capabilities check this list of plugins.

Installation

This plugin is available as a RubyGem.

There are a few ways to install the plugin (docs), e.g. by adding this line to your application's Gemfile:

gem 'jekyll-date-localization', group: :jekyll_plugins

And then execute the bundle command to install the gem.

Configuration

You can configure the default locale in your config.yml file:

date_locale: cs

Usage

In your markup, simply use the localize liquid filter made available through this plugin:

{{ page.date | localize: '%d. %B %Y' }}

By default the value of date_locale is used to select the language. Alternatively you can also directly specify the language:

{{ page.date | localize: '%d. %B %Y', 'fr' }}

For details about the formatting string, see strftime documentation. The localized entries are %b %B %a %A.

Additional languages

There are a couple of built-in languages in this repository in the 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.

Contribute

Feel free to send PRs with additional languages or improvements.

Copyright (c) 2022 Tomas Krupka

License: MIT

FAQs

Package last updated on 25 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc