Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.86 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.86 KB

Pelican Persian date plugin

This is a Pelican (Static Site Generator) plugin.

This plugin converts article.locale_date attribute from Gregorian calendar into Solar Hijri calendar (AKA Jalali calendar, Persian calendar, Iranian calendar) which is the official calendar of Iran and Afghanistan.

Screenshot

  • Output HTML result with Pelican's notmyidea theme

Persian date screenshot

Persian date screenshot

Installation

  1. Get the plugin in any way which is convenient for you. for example:
    • Clone the repository into plugins directory
    git clone https://github.com/ziaa/pelican_persian_date.git
    
    • Or add the repository as a submodule in plugins directory
    git submodule add -b master https://github.com/ziaa/pelican_persian_date.git plugins/pelican_persian_date
    
  2. Activate the plugin in your pelicanconf.py setting file (more information on using pelican plugins + +)
# Plugins
PLUGIN_PATHS = ['path/to/plugins']
PLUGINS = ["pelican_persian_date"]
  1. Define date format in pelicanconf.py (more information on format codes)
DATE_FORMATS = {
    'fa': '%A %d %B %Y'
}

Requirement & testing environment

I'm using this plugin on Windows with Python v3.4.3 & Pelican v3.6.0 installed. Perhaps it will work on other platforms & versions.