{
"info": {
"author": "Alexandre Fonseca",
"author_email": "alexandrejorgefonseca@gmail.com",
"bugtrack_url": null,
"classifiers": [],
"description": "################\npelican-entities\n################\n\nA new generator for `Pelican\n`_ that\nreplaces the default Page and Article generators, allowing the definition of\narbitrary content types, aka, entity types (e.g: projects, events) and\nassociated indices/direct templates.\n\nSimilar to nodes in Drupal.\n\nInstall\n=======\n\nTo install the library, you can use\n`pip\n`_\n\n.. code-block:: bash\n\n $ pip install pelican-entities\n\n\nUsage\n=====\n\n1. Update ``pelicanconf.py``:\n\n 1. Add ``entities`` to ``PLUGINS``.\n .. code-block:: python\n \n PLUGINS = ['entities', ...]\n\n 2. Disable default page and article generators:\n\n .. code-block:: python\n \n PAGE_PATHS = []\n ARTICLE_PATHS = []\n DIRECT_TEMPLATES = []\n PAGINATED_DIRECT_TEMPLATES = []\n\n 3. Specify entity types to use in your site and their settings:\n\n .. code-block:: python\n\n ENTITY_TYPES = {\n : {\n PATHS: [, , ...],\n EXCLUDES: [...],\n _URL: \"...\",\n _SAVE_AS: \"...\",\n ...\n },\n : {\n ...\n }\n }\n\n2. Update theme to use new variables.\n3. Watch out for incompatible plugins (those that rely on the pages and \n article generator signals or on the existence of variables defined by\n them).\n\n\nSettings\n========\n\nSettings defined at the ENTITY_TYPES level take precedence over global\nones.\n\nChanges from default\n--------------------\n\n- Settings for each entity type are defined as the value of the corresponding\n key in the ``ENTITY_TYPES`` dictionary.\n- ``PAGE_PATHS`` and ``ARTICLE_PATHS`` are replaced by ``PATHS``.\n- ``PAGE_EXCLUDES`` and ``ARTICLE_EXCLUDES`` are replaced by ``EXCLUDES``.\n- ``PAGE_URL``, ``ARTICLE_URL``, ``PAGE_SAVE_AS`` and ``ARTICLE_SAVE_AS`` replaced by\n generic ``_URL`` and ``_SAVE_AS``.\n- ``ARTICLE_ORDER_BY`` and ``PAGE_ORDER_BY`` are removed in favour of ``SORTER``.\n\nNew settings\n------------\n- ``DEFAULT_TEMPLATE``: Template to use by default when generating pages for\n that entity type.\n- ``MANDATORY_PROPERTIES``: List of properties that has to be defined for an\n entity to be considered valid (by default, just title).\n- ``SORTER``: Function taking list of entities as argument and which is responsible\n for sorting it as desired. Default value is the result of a call to\n ``entities.attribute_list_sorter([\"date\"], reverse=True)``\n- ``ARCHIVE_TEMPLATE``: Template used for archive pages.\n- ``CATEGORY_TEMPLATE``: Template used for category pages.\n- ``TAG_TEMPLATE``: Template used for tag pages.\n- ``AUTHOR_TEMPLATE``: Template used for author pages.\n- ``SUBGENERATOR_CLASS``: Optionally define a custom subgenerator class. This should\n either be a callable matching the ``entities.EntityGenerator.EntitySubGenerator``\n interface or an import path to such a callable which will be imported dynamically.\n\nContext/Themes\n==============\n\nNew available variables\n-----------------------\n\n- Global:\n\n - ``url``: The url of the current page.\n - ``entity_type``: Type of the entity associated with this page.\n - ``entity_types``: Dict having all declared entity types as keys and their\n generators as values.\n - ````: For each declared entity type, an object is added to \n the context containing:\n\n - ``entities``: All entities of that entity type.\n - ``translations``: All translations of that entity type.\n - ``tags``: All tags of that entity type.\n - ``categories``: All categories of that entity type.\n - ``authors``: All authors of that entity type.\n - ``drafts``: All drafts of that entity type.\n - ``drafts_translations``: All draft translations of that entity type.\n\n- Entity page:\n\n - ``entity``: Contains the object describing an entity (replaces ``article``\n or ``page``).\n\n- Direct templates:\n\n - ``direct``: Variable always equal to True when rendering a direct template.\n\n- Tag, category, author pages:\n\n - ``entities``: Replaces ``articles``.\n - ``all_entitites``: Replaces ``all_articles``.\n\n- Draft pages:\n\n - ``entity``: Replaces ``article``.\n - ``all_entities``: Replaces ``all_articles``.\n\n- Paginated pages (direct templates or tag, category, author pages):\n\n - ``entities_paginator``: Replaces ``articles_paginator``.\n - ``entities_page``: Replaces ``articles_page``.\n - ``entities_previous_page``: Replaces ``articles_previous_page``.\n - ``entities_next_page``: Replaces ``articles_next_page``.\n\nDeleted variables\n-----------------\n- Entity page:\n\n - ``category``: Access through ``entity.category``.\n\n- Direct templates:\n\n - ``dates``: If you want to iterate in the opposite order do it explicitly.\n\nExample configuration\n---------------------\nThis is the configuration I'm using on my site:\n\n.. code-block:: python\n\n ENTITY_TYPES = {\n \"Page\": {\n \"PATHS\": [\"\"],\n \"EXCLUDES\": [\"blog\", \"projects\"],\n \"PAGE_URL\": \"{slug}\",\n \"PAGE_SAVE_AS\": \"{slug}/index.html\",\n \"PATH_METADATA\": r\"(?P[^/]+)/.*\",\n \"DIRECT_TEMPLATES\": [\"search\"],\n \"SEARCH_SAVE_AS\": \"search/index.html\"\n },\n \"Article\": {\n \"PATHS\": [\"blog\"],\n \"ARTICLE_URL\": \"blog/{category}/{slug}/\",\n \"ARTICLE_SAVE_AS\": \"blog/{category}/{slug}/index.html\",\n \"PATH_METADATA\": r\".*/(?P[^/]+)/(?P\\d{4}/\\d{2}/\\d{2})/(?P[^/]+)/.*\",\n \"DIRECT_TEMPLATES\": [\"blog\"],\n \"PAGINATED_DIRECT_TEMPLATES\": [\"blog\"],\n \"BLOG_SAVE_AS\": \"blog/index.html\",\n \"CATEGORY_TEMPLATE\": \"blog_category\",\n \"CATEGORY_URL\": \"blog/{slug}/\",\n \"CATEGORY_SAVE_AS\": os.path.join(\"blog\", \"{slug}\", \"index.html\"),\n \"FEED_ATOM\": os.path.join(\"blog\", \"feeds\", \"atom.xml\"),\n \"CATEGORY_FEED_ATOM\": os.path.join(\"blog\", \"feeds\", \"%s.atom.xml\")\n },\n \"Project\": {\n \"PATHS\": [\"projects\"],\n \"SORTER\": entities.attribute_list_sorter([\"date\", \"project_start\"], reverse=True),\n \"PROJECT_URL\": \"projects/{category}/{slug}/\",\n \"PROJECT_SAVE_AS\": \"projects/{category}/{slug}/index.html\",\n \"PATH_METADATA\": r\".*/(?P[^/]+)/(?P[^/]+)/.*\",\n \"DIRECT_TEMPLATES\": [\"projects\"],\n \"PAGINATED_DIRECT_TEMPLATES\": [\"projects\"],\n \"PROJECTS_SAVE_AS\": \"projects/index.html\",\n \"CATEGORY_TEMPLATE\": \"project_category\",\n \"CATEGORY_URL\": 'projects/{slug}/',\n \"CATEGORY_SAVE_AS\": os.path.join('projects', '{slug}', 'index.html'),\n \"FEED_ATOM\": os.path.join(\"projects\", \"feeds\", \"atom.xml\"),\n \"CATEGORY_FEED_ATOM\": os.path.join(\"projects\", \"feeds\", \"%s.atom.xml\")\n }\n }\n\nFor a working example check `my site\n`_ and `my site's source code\n`_.\n\nExtending\n=========\n\nAvailable signals\n-----------------\n\n- ``entity_generator_init``: Initialization of the parent generator. This\n generator is responsible for creating the generators for each entity type.\n- ``entity_generator_finalized``: End of context generation by the parent\n generator.\n- ``entity_writer_finalized``: End of output generation by the parent generator.\n\n- ``entity_subgenerator_*``: Signals for the generator of a particular entity\n type. These are the same signals used by the article generator.\n",
"description_content_type": null,
"docs_url": null,
"download_url": "https://github.com/AlexJF/pelican-entities/archive/v0.3.0.zip",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/AlexJF/pelican-entities",
"keywords": "pelican blog static generic entities",
"license": "Apache",
"maintainer": "",
"maintainer_email": "",
"name": "pelican-entities",
"package_url": "https://pypi.org/project/pelican-entities/",
"platform": "",
"project_url": "https://pypi.org/project/pelican-entities/",
"project_urls": {
"Download": "https://github.com/AlexJF/pelican-entities/archive/v0.3.0.zip",
"Homepage": "https://github.com/AlexJF/pelican-entities"
},
"release_url": "https://pypi.org/project/pelican-entities/0.3.0/",
"requires_dist": null,
"requires_python": "",
"summary": "A generator for Pelican, allowing the use of generic entities in place of the default page and article ones",
"version": "0.3.0"
},
"last_serial": 2857064,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "70e6941a4c411016e374ac984f22a782",
"sha256": "f6e04b8508aaee4b596e136f7e3ec5094541f5c18ed307df09738385faea621b"
},
"downloads": -1,
"filename": "pelican-entities-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "70e6941a4c411016e374ac984f22a782",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11808,
"upload_time": "2014-08-26T19:49:46",
"url": "https://files.pythonhosted.org/packages/3a/fa/b371a7d2f1abe0b8acdd61b7238cc9ab6201f0e0af6c2a4da0f1caa5bdc0/pelican-entities-0.1.0.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "24e0d8d29bda3be11fe0d0312170c669",
"sha256": "bea3a5b1906ed82ffa37c590e40cbdc0acc8933d3e830f90c96fe8b46eda47a9"
},
"downloads": -1,
"filename": "pelican-entities-0.2.0.zip",
"has_sig": false,
"md5_digest": "24e0d8d29bda3be11fe0d0312170c669",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20016,
"upload_time": "2016-07-29T11:28:40",
"url": "https://files.pythonhosted.org/packages/a3/eb/c98ea42617e599d36c5e71f83bbe54c3674b3deec2f5f46c1d0adaab0403/pelican-entities-0.2.0.zip"
}
],
"0.3.0": [
{
"comment_text": "",
"digests": {
"md5": "606469f1053962bf6373a6a94ee07958",
"sha256": "185cb8d43da092c0000d5975dafb414d9b4f0b2ae53cf4caef6bfd59650c473e"
},
"downloads": -1,
"filename": "pelican-entities-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "606469f1053962bf6373a6a94ee07958",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15315,
"upload_time": "2017-05-07T13:03:55",
"url": "https://files.pythonhosted.org/packages/a2/f8/541cec7a9057763065570c29e3d33d4b023692332bbdfb73cd1d1494482b/pelican-entities-0.3.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "606469f1053962bf6373a6a94ee07958",
"sha256": "185cb8d43da092c0000d5975dafb414d9b4f0b2ae53cf4caef6bfd59650c473e"
},
"downloads": -1,
"filename": "pelican-entities-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "606469f1053962bf6373a6a94ee07958",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15315,
"upload_time": "2017-05-07T13:03:55",
"url": "https://files.pythonhosted.org/packages/a2/f8/541cec7a9057763065570c29e3d33d4b023692332bbdfb73cd1d1494482b/pelican-entities-0.3.0.tar.gz"
}
]
}