diff --git a/README.md b/README.md index f4a0928..d9774a4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ A minimalist [Pelican](http://blog.getpelican.com/) theme. - SEO Best Practices - Open Graph - Rich Snippets (JSON-LD) +- Related Posts (via [plugin](https://github.com/getpelican/pelican-plugins/tree/master/related_posts)) +- Minute read like [Medium](https://medium.com/) (via [plugin](https://github.com/getpelican/pelican-plugins/tree/master/post_stats)) (coming in 2.0) - [Multiple Code Highlight Styles](https://github.com/alexandrevicenzi/Flex/wiki/Code-Highlight) - [Translation Support](https://github.com/alexandrevicenzi/Flex/wiki/Multi-language-support) (draft/coming in 2.0) @@ -29,10 +31,6 @@ The recommend way to install is over [pelican-themes](https://github.com/getpeli The `master` branch is the development branch. If you're happy with fresh new things and maybe sometimes (~most of time~) broken things you can clone the `master`, but I would recommend to you to clone a tag branch. -## Migrate from 1.x to 2.x - -Release 2.0 will include [Translation Support](https://github.com/alexandrevicenzi/Flex/wiki/Multi-language-support). In order to use Flex you need to configure your `pelicanconf.py` to support i18n. See [Multi language support](https://github.com/alexandrevicenzi/Flex/wiki/Multi-language-support) for examples. - ## Docs [Go to Wiki](https://github.com/alexandrevicenzi/Flex/wiki) @@ -54,9 +52,11 @@ I'm using Flex in my [personal blog](http://blog.alexandrevicenzi.com/). ## Donate -Did you liked? Buy me a coffee. +Did you liked this theme? Buy me a beer and support new features. -[![Gratipay](https://img.shields.io/gratipay/JSFiddle.svg?style=flat-square)](https://gratipay.com/~alexandrevicenzi/) +[![Gratipay](https://img.shields.io/gratipay/user/alexandrevicenzi.svg?maxAge=2592000)](https://gratipay.com/~alexandrevicenzi/) + +[![PayPal](https://img.shields.io/badge/paypal-donate-yellow.svg?maxAge=2592000)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KZCMH3N74KKFN&lc=BR&item_name=Alexandre%20Vicenzi&item_number=flex¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted) ## License diff --git a/ext/__init__.py b/ext/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/ext/i18n_bypass.py b/ext/i18n_bypass.py deleted file mode 100644 index bf05282..0000000 --- a/ext/i18n_bypass.py +++ /dev/null @@ -1,10 +0,0 @@ -import jinja2.ext - -class ByPassTrans(jinja2.ext.InternationalizationExtension): - - def __init__(self, environment): - super(ByPassTrans, self).__init__(environment) - self._install_null() - - -i18n = ByPassTrans diff --git a/templates/article.html b/templates/article.html index 1f1439a..f453e84 100644 --- a/templates/article.html +++ b/templates/article.html @@ -14,9 +14,9 @@

{{ article.title }}

- {% with category_url='%s' % (SITEURL, article.category.url, article.category) %} - {{ _('Posted on %(when)s in %(category)s', when=article.locale_date, category=category_url|safe) }} - {% endwith %} + {{ _('Posted on %(when)s in %(category)s', + when=article.locale_date, + category='%s'|format(SITEURL, article.category.url, article.category)|safe) }} {% if 'post_stats' in PLUGINS %} • {{ article.stats['read_mins'] }} min read diff --git a/templates/base.html b/templates/base.html index 18ffd31..214ba04 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,3 +1,9 @@ +{% if 'jinja2.ext.i18n' not in JINJA_EXTENSIONS %} + {% macro _(msg) %} + {{ msg % kwargs }} + {% endmacro %} +{% endif %} + diff --git a/templates/index.html b/templates/index.html index 3866a28..3560a1e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,9 +6,9 @@

{{ article.title }}

- {% with category_url='%s' % (SITEURL, article.category.url, article.category) %} - {{ _('Posted on %(when)s in %(category)s', when=article.locale_date, category=category_url|safe) }} - {% endwith %} + {{ _('Posted on %(when)s in %(category)s', + when=article.locale_date, + category='%s'|format(SITEURL, article.category.url, article.category)|safe) }} {% if 'post_stats' in PLUGINS %} • {{ article.stats['read_mins'] }} min read