{ "info": { "author": "Terminal Labs, Joseph Nix", "author_email": "solutions@terminallabs.com", "bugtrack_url": null, "classifiers": [ "Environment :: Plugins", "Environment :: Web Environment", "Framework :: Lektor", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# lektor-jinja-content\n\n[![Build Status](https://api.travis-ci.org/terminal-labs/lektor-jinja-content.svg?branch=master)](https://travis-ci.org//terminal-labs/lektor-jinja-content)\n[![Code Coverage](https://codecov.io/gh/terminal-labs/lektor-jinja-content/branch/master/graph/badge.svg)](https://codecov.io/gh//terminal-labs/lektor-jinja-content)\n[![PyPI version](https://badge.fury.io/py/lektor-jinja-content.svg)](https://pypi.org/project/lektor-jinja-content/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lektor-jinja-content.svg)](https://pypi.org/project/lektor-jinja-content/)\n\"Code\n\nThis is a Lektor plugin that allows you to render Jinja2 inside your content fields that are string-like. For example, this means that inside your content fields that are of type string or Markdown, you can write Jinja logic, and access Lektor's [Template Context](https://www.getlektor.com/docs/templates/#template-context), and has access to all normal Jinja filters, including those provided by [other plugins](https://github.com/terminal-labs/lektor-slugify). In a Markdown field (or other field that is rendered - like [rst](https://github.com/fschulze/lektor-rst)), the **Jinja is processed first**, then the formatting processor.\n\nYou can set and use Jinja variables, but they will only have meaning within their field that is being rendered.\n\nWith this plugin, you'll have to make sure the content that is rendered **is valid Jinja**. Jinja syntax erros will throw an exception. Don't forget about the handy `{% raw %} {% endraw %}` tags if you want content that is not valid Jinja.\n\n**N.B.** Using this plugin is rendering many more items with Jinja, and your build process will slow down as a result. As an early benchmark and anecdote, my small website's build time rose from 4.89s to 5.39s even while I actually had no Jinja-Content that needed rendering. I plan on adding the ability to configure this plugin later so that you don't have to run *everything* through Jinja if you don't want to.\n\n\n## Examples\n\nQuerying context: `{{ site.get('/').title }}` or `{{ this.path }}`\n\nLogic:\n```jinja\n{% set meaning_of_life, meaning_of_universe = this.life, this.universe %}\n{% if meaning_of_life == meaning_of_universe == 42 %}\n {% set meaning_of_it_all = meaning_of_life %}\n{% else %}\n {% set meaning_of_it_all = 'Undefined' %}\n{% endif %}\n{{ meaning_of_it_all }}\n```\n\nJinja in Markdown:\n```jinja\n[link text]({{ this|url }})\n```\n\nJinja in reStructuredText:\n```jinja\n`link text <{{ this|url }}>`_\n```\n\nTry running the [test site](https://github.com/terminal-labs/lektor-jinja-content/blob/master/tests/demo-project/) for more examples.\n\n\n## Possible future of this plugin.\n\nThis Plugin opens the door to some pretty powerful and pretty funky functionality. Here's some food for though:\n\n* Currently every every string-like field in `_data` and `_blocks` is processed, even things like `_slug` and `_template`. Can these other things be used?\n* [Some people want to be able to include markdown in content files / declarations](https://github.com/lektor/lektor/issues/541). This plugin might pave the way toward that with [includes and extends](https://github.com/terminal-labs/lektor-jinja-content/issues/3).\n* Could we Jinjaify static files?\n* [Databags?](https://github.com/terminal-labs/lektor-jinja-content/issues/4)\n* [What about modularity?](https://github.com/terminal-labs/lektor-jinja-content/issues/2)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/terminal-labs/lektor-jinja-content", "keywords": "Lektor plugin static-site jinja jinja2", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "lektor-jinja-content", "package_url": "https://pypi.org/project/lektor-jinja-content/", "platform": "", "project_url": "https://pypi.org/project/lektor-jinja-content/", "project_urls": { "Homepage": "https://github.com/terminal-labs/lektor-jinja-content" }, "release_url": "https://pypi.org/project/lektor-jinja-content/0.4.3/", "requires_dist": [ "Lektor", "flake8 ; extra == 'dev'", "ipdb ; extra == 'dev'", "ipython ; extra == 'dev'", "pytest ; extra == 'dev'", "pytest-cov ; extra == 'dev'", "pytest-mock ; extra == 'dev'", "pytest-click ; extra == 'dev'", "pytest-pylint ; extra == 'dev'", "black ; extra == 'dev'" ], "requires_python": "", "summary": "Render content fields with Jinja2.", "version": "0.4.3" }, "last_serial": 5286613, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ee2c94349640f573a22851796e5abfda", "sha256": "ea30772c0511d9cd03628824a278a179dc4c1e4c7a1d8aa7b546f6dc933692f9" }, "downloads": -1, "filename": "lektor_jinja_content-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ee2c94349640f573a22851796e5abfda", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 3162, "upload_time": "2018-04-13T03:23:56", "url": "https://files.pythonhosted.org/packages/b7/71/97cfcbce61da385d82e9f8a06957ac139299135d2bc8213a548d0f98a53c/lektor_jinja_content-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a383c246d60c96fa64987efd7120e3ae", "sha256": "caeae95ebc105dc893f1621cb763e9f590d8fdcd1c8a562e9aa3c93e24d64264" }, "downloads": -1, "filename": "lektor-jinja-content-0.1.tar.gz", "has_sig": false, "md5_digest": "a383c246d60c96fa64987efd7120e3ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2794, "upload_time": "2018-04-13T03:23:55", "url": "https://files.pythonhosted.org/packages/92/b6/b8d309b16635f651b93d41f01fc083b4bf87ed5f5ecee608473572169ed0/lektor-jinja-content-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "42e0ef8a65c790ec9af36dc87055df70", "sha256": "8ce9a0fcdae84332dbbd505029a1db5b0d2729ef4346118cd4767188b5d46669" }, "downloads": -1, "filename": "lektor_jinja_content-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "42e0ef8a65c790ec9af36dc87055df70", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 3105, "upload_time": "2018-04-16T19:26:52", "url": "https://files.pythonhosted.org/packages/46/e1/85217eabc9cc1a252055f87c419cb86ad6c401c41ae3c556aaa7608b2e64/lektor_jinja_content-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19c0e7875c1d2dcd8f55bb866c1930fd", "sha256": "34715d26fdc1ce75d84e01d6f76504277354fe5507655b52c29bc1236d0d944f" }, "downloads": -1, "filename": "lektor-jinja-content-0.2.tar.gz", "has_sig": false, "md5_digest": "19c0e7875c1d2dcd8f55bb866c1930fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3317, "upload_time": "2018-04-16T19:26:51", "url": "https://files.pythonhosted.org/packages/e6/ee/0fbd31607bd483be63cc7b921866ffacfdb95ef85c277ce4531238a00998/lektor-jinja-content-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "0727263068dcba34bdadc65a17a7e317", "sha256": "50e60fed9cb40a97c1ee6a50a45176efaaa7fc53e23c6d50f64fcbadb70d08ae" }, "downloads": -1, "filename": "lektor_jinja_content-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0727263068dcba34bdadc65a17a7e317", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3189, "upload_time": "2018-05-11T19:48:00", "url": "https://files.pythonhosted.org/packages/4e/fb/5f4ce437204a5e6a0a5345d5d595ad1daad8255c8e5ace1057800a509973/lektor_jinja_content-0.3-py3-none-any.whl" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "90b7ff0f82e0d2c6d27ea7a4c1e29479", "sha256": "82272a8396accf1102da9bec4f39fc85edcdd1e4fff29a574bc9a6651165cb56" }, "downloads": -1, "filename": "lektor_jinja_content-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "90b7ff0f82e0d2c6d27ea7a4c1e29479", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4106, "upload_time": "2018-09-13T16:30:19", "url": "https://files.pythonhosted.org/packages/fc/56/ded4f3e17974885d91f91a45e33e9a280331a715a5e2a0d66da76af99347/lektor_jinja_content-0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ad48f15c077fce9ffb9209db15941c5a", "sha256": "f6cd50882769f74e57e857eec634f231199e22846df1f15a21185d2233970367" }, "downloads": -1, "filename": "lektor-jinja-content-0.4.tar.gz", "has_sig": false, "md5_digest": "ad48f15c077fce9ffb9209db15941c5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5075, "upload_time": "2018-09-13T16:30:21", "url": "https://files.pythonhosted.org/packages/7c/a6/1b9017ef6a152f393189fa79e3b087fff75628f455f2008fd5df813cfc2d/lektor-jinja-content-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "91799eea2ac35d247952a6ee2671e502", "sha256": "bd4e12117f246a95c072f14f4bded2f59ea7e142f523da7d0f5ae87628d54520" }, "downloads": -1, "filename": "lektor_jinja_content-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "91799eea2ac35d247952a6ee2671e502", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4133, "upload_time": "2018-09-13T16:44:02", "url": "https://files.pythonhosted.org/packages/5c/69/48106d7daae18f1a711bc2947ba3fc4c834eb649fee6408ca1c9375c7eb9/lektor_jinja_content-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d5e2d3fad71cee55d868a73ac8821bab", "sha256": "9e3ae3ca35c145f7d81f4833b62f1108acfef8d6a9410e3612708f65321c19a4" }, "downloads": -1, "filename": "lektor-jinja-content-0.4.1.tar.gz", "has_sig": false, "md5_digest": "d5e2d3fad71cee55d868a73ac8821bab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5082, "upload_time": "2018-09-13T16:44:03", "url": "https://files.pythonhosted.org/packages/74/87/084e96cb4c4f5d55fac59a54c45f21ccea402ce7c99bf235c160990dfb42/lektor-jinja-content-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "132fe18aae80d1dcc48e0ecc3b4b241d", "sha256": "fb1e8b0357b11051b3c099923362f5bf2b9c1df35d3755d96e565dfcfdfa537d" }, "downloads": -1, "filename": "lektor_jinja_content-0.4.2-py3-none-any.whl", "has_sig": false, "md5_digest": "132fe18aae80d1dcc48e0ecc3b4b241d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4158, "upload_time": "2018-09-14T22:01:59", "url": "https://files.pythonhosted.org/packages/f3/e9/b3764b4e9dc8c658f142d55c386387e98bad765cd6b443e49c7069b1e791/lektor_jinja_content-0.4.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c920419e0233bc0047fc09f68d861057", "sha256": "b75b0a228d9cef28cfb080ffffd37c41f9755313ffa7eaf820ec6d0c0b2adeca" }, "downloads": -1, "filename": "lektor-jinja-content-0.4.2.tar.gz", "has_sig": false, "md5_digest": "c920419e0233bc0047fc09f68d861057", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5150, "upload_time": "2018-09-14T22:02:00", "url": "https://files.pythonhosted.org/packages/e5/ac/4315f48046f916c4d954153d5a2f6e0112a5df9ecd3fda2ce9234a26e65a/lektor-jinja-content-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "ae1a8b5db37029562ffdf4436c8e7770", "sha256": "0d03f9dd3aa79e30c703494d44e4723d83301d4958fffb8331df3ae797c174db" }, "downloads": -1, "filename": "lektor_jinja_content-0.4.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ae1a8b5db37029562ffdf4436c8e7770", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5181, "upload_time": "2019-05-18T21:02:26", "url": "https://files.pythonhosted.org/packages/d4/47/0d9041dc358c694a1c3f814a6a3883f330c279dd137af59d78cbffde7b13/lektor_jinja_content-0.4.3-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ae1a8b5db37029562ffdf4436c8e7770", "sha256": "0d03f9dd3aa79e30c703494d44e4723d83301d4958fffb8331df3ae797c174db" }, "downloads": -1, "filename": "lektor_jinja_content-0.4.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ae1a8b5db37029562ffdf4436c8e7770", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5181, "upload_time": "2019-05-18T21:02:26", "url": "https://files.pythonhosted.org/packages/d4/47/0d9041dc358c694a1c3f814a6a3883f330c279dd137af59d78cbffde7b13/lektor_jinja_content-0.4.3-py2.py3-none-any.whl" } ] }