{ "info": { "author": "Tim Heap", "author_email": "tim@takeflight.com.au", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "==================\nwagtail-schema.org\n==================\n\nAdd Schema.org JSON-LD to your website\n\nInstalling\n==========\n\nwagtail-schema.org supports Wagtail 2.0 upwards.\n\nInstall using pip:\n\n.. code-block:: console\n\n $ pip install wagtail-schema.org\n\nAdd it to your ``INSTALLED_APPS`` to use the Django template tags:\n\n.. code-block:: python\n\n INSTALLED_APPS = [\n ...\n 'wagtailschemaorg',\n ]\n\nUsing\n=====\n\n``wagtail-schema.org`` supports two types of schema entities:\nsite-wide entities and page-specific entities.\nSite-wide entities might be the organisation that the site as a whole is about,\nwhile page-specific entities might be a single person that the page in question is about.\nBoth sets of entities are optional, and\nsites can implement only those that make sense.\n\nSite-wide entities\n------------------\n\nA site-wide entity is printed on every page\nusing the ``{% ld_for_site %}`` template tag.\nThey should be entities that are relevant to the whole site,\nsuch as the Organisation or Person that the site is about.\nMultiple (or zero) site-wide entities can exist for a site.\n\n.. code-block:: python\n\n from django.db import models\n from wagtail.contrib.settings.models import register_setting\n\n from wagtailschemaorg.models import BaseLDSetting\n from wagtailschemaorg.registry import register_site_thing\n from wagtailschemaorg.utils import extend\n\n\n @register_setting\n @register_site_thing\n class TestOrganisation(BaseLDSetting):\n \"\"\"Details about this organisation\"\"\"\n name = models.CharField(max_length=100)\n phone_number = models.CharField(max_length=20)\n email = models.EmailField()\n twitter_handle = models.CharField(max_length=15)\n facebook_url = models.URLField()\n\n def ld_entity(self):\n return extend(super().ld_entity(), {\n '@type': 'Organization',\n 'name': self.name,\n 'email': self.email,\n 'telephone': self.phone_number,\n 'sameAs': [\n self.twitter_url,\n self.facebook_url,\n ],\n })\n\n @property\n def twitter_url(self):\n return 'https://twitter.com/' + self.twitter_handle\n\n.. note:: Every site-wide Thing should have a different ``@id``.\n By default, the ``@id`` is the Thing's ``url``.\n You can change a Thing's ``@id`` by overriding\n ``ld_get_id`` or ``ld_get_url`` as required.\n\nPage-specific entities\n----------------------\n\nEach page can specify a list of relevant entities.\nUse ``{% ld_for_object page %}`` to print these.\n\n.. code-block:: python\n\n from django.db import models\n from wagtail.admin.edit_handlers import FieldPanel\n from wagtail.core.models import Page\n from wagtail.images.edit_handlers import ImageChooserPanel\n\n from testapp.models import TestOrganisation\n from wagtailschemaorg.models import PageLDMixin\n from wagtailschemaorg.utils import extend, image_ld\n\n\n class PersonPage(PageLDMixin, Page):\n bio = models.TextField()\n date_of_birth = models.DateField()\n photo = models.ForeignKey('wagtailimages.Image', on_delete=models.PROTECT)\n\n content_panels = Page.content_panels + [\n FieldPanel('bio'),\n FieldPanel('date_of_birth'),\n ImageChooserPanel('photo'),\n ]\n\n def ld_entity(self):\n site = self.get_site()\n return extend(super().ld_entity(), {\n '@type': 'Person',\n 'birthDate': self.date_of_birth.isoformat(),\n 'image': image_ld(self.photo, base_url=site.root_url),\n 'organisation': TestOrganisation.for_site(site),\n })\n\nIn templates\n============\n\n``wagtail-schema.org`` provides two template tags:\none for printing out the site-wide entities and\none for page-specific entities.\n\nDjango templates\n----------------\n\nMake sure that ``wagtailschemaorg`` is in your ``INSTALLED_APPS``,\nand add ``{% load wagtailschemaorg_tags %}`` to the top of your template.\n\n``{% ld_for_site [site] %}``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPrint all the site-wide entities for a site.\nTakes an optional ``site`` argument,\nwhich defaults to ``request.site`` from the current template context.\nSee ``register_site_thing`` for more information on site-wide entities.\n\n``{% ld_for_object [obj] %}``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPrint all the entities for ``obj``.\n``obj`` is optional, and defaults to ``page`` in the current template context.\n``obj`` should implement the ``ThingLD`` interface.\nCalls ``obj.ld_to_data_list``, and prints all the entities returned.\n\n``{% ld_print_entity entity %}``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPrint an entity directly. ``entity`` should be a ``dict`` with JSON-LD data.\n\nJinja2 templates\n~~~~~~~~~~~~~~~~\n\nAdd ``wagtailschemaorg.jinja2tags.WagtailSchemaOrgExtension`` to your Jinja2 extensions.\n\n``{{ ld.for_site([site]) %}``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPrint all the site-wide entities for a site.\nTakes an optional ``site`` argument,\nwhich defaults to ``request.site`` from the current template context.\nSee ``register_site_thing`` for more information on site-wide entities.\n\n``{% ld.for_object([obj]) %}``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPrint all the entities for ``obj``.\n``obj`` is optional, and defaults to ``page`` in the current template context.\n``obj`` should implement the ``ThingLD`` interface.\nCalls ``obj.ld_to_data_list``, and prints all the entities returned.\n\n``{% ld.print_entity(entity) %}``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPrint an entity directly. ``entity`` should be a ``dict`` with JSON-LD data.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/takeflight/wagtail-schema.org", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "wagtail-schema.org", "package_url": "https://pypi.org/project/wagtail-schema.org/", "platform": "", "project_url": "https://pypi.org/project/wagtail-schema.org/", "project_urls": { "Homepage": "https://github.com/takeflight/wagtail-schema.org" }, "release_url": "https://pypi.org/project/wagtail-schema.org/2.0.0/", "requires_dist": null, "requires_python": "", "summary": "Add Schema.org JSON-LD to your website", "version": "2.0.0" }, "last_serial": 4357560, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2eb12e338e7bd85f6ee99e12c6b530f4", "sha256": "963e3a03e556bbacc9216b99487f5f514da92799b2125b85d499e7c363e9369e" }, "downloads": -1, "filename": "wagtail_schema.org-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2eb12e338e7bd85f6ee99e12c6b530f4", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 11256, "upload_time": "2016-12-22T00:06:45", "url": "https://files.pythonhosted.org/packages/66/0c/4b4bb6c3d918e04d92938b56dbfdda9363753ffac0b350c2e637257d67ae/wagtail_schema.org-0.1.0-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "40d62555fc80f2adb88ca41022a08f96", "sha256": "595ac7b381ed0afbea295ebd89d1f59863edfbcb526979962203cc4acdb6e015" }, "downloads": -1, "filename": "wagtail_schema.org-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "40d62555fc80f2adb88ca41022a08f96", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 16608, "upload_time": "2016-12-22T04:32:33", "url": "https://files.pythonhosted.org/packages/1d/14/cbfb7a3e61f7d58ace92833a6b0b325b3da210fe3d9bfcaa3cbd4fac3a8a/wagtail_schema.org-0.2.0-py2.py3-none-any.whl" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d7ae33064ed7ba947757694d2c6d1322", "sha256": "7481c0d3eabdff32c1c00844426824f95b0d21967d9a1981ad85192bdfb1225e" }, "downloads": -1, "filename": "wagtail_schema.org-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d7ae33064ed7ba947757694d2c6d1322", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 16686, "upload_time": "2017-01-12T02:27:52", "url": "https://files.pythonhosted.org/packages/73/d8/b4d0f4f782541805bacf0804217e898c5ccc47652d0d6aa3f6844763e5e0/wagtail_schema.org-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "084444a11785f86784cd1535b0ab99b0", "sha256": "4272f49dcd121aa91dec34b98449f7e85ffe40e2a5c33e5be98f44151603d269" }, "downloads": -1, "filename": "wagtail-schema.org-0.3.0.tar.gz", "has_sig": false, "md5_digest": "084444a11785f86784cd1535b0ab99b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10916, "upload_time": "2017-01-12T02:27:43", "url": "https://files.pythonhosted.org/packages/d6/21/5c3219665a7b9b79de52f2db7981de15b970275b55dbf69f960a9fd89528/wagtail-schema.org-0.3.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "bd7acdf3ae5dd4ca8cd2b678254efb1f", "sha256": "647748e27886748f6f35c15b3e6fd545ccddfbb47eadce7cc4d15ad3028304e4" }, "downloads": -1, "filename": "wagtail_schema.org-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bd7acdf3ae5dd4ca8cd2b678254efb1f", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 14836, "upload_time": "2018-10-09T21:20:02", "url": "https://files.pythonhosted.org/packages/80/7f/4dfaff6df865ccac492603390cc682dd91ab963041ca90b921513affe69a/wagtail_schema.org-2.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f01ed93d1469be9b788199a8482d1232", "sha256": "6b7aa9dd4dadc6d751b1ea3ae065803b9f106f145203991fea1b676da4c7bc92" }, "downloads": -1, "filename": "wagtail-schema.org-2.0.0.tar.gz", "has_sig": false, "md5_digest": "f01ed93d1469be9b788199a8482d1232", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10596, "upload_time": "2018-10-09T21:20:00", "url": "https://files.pythonhosted.org/packages/24/83/bccdaec389e07881ef3289a35fed5f2ed7c3c273c0d17117057f8a7d07ae/wagtail-schema.org-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bd7acdf3ae5dd4ca8cd2b678254efb1f", "sha256": "647748e27886748f6f35c15b3e6fd545ccddfbb47eadce7cc4d15ad3028304e4" }, "downloads": -1, "filename": "wagtail_schema.org-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bd7acdf3ae5dd4ca8cd2b678254efb1f", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 14836, "upload_time": "2018-10-09T21:20:02", "url": "https://files.pythonhosted.org/packages/80/7f/4dfaff6df865ccac492603390cc682dd91ab963041ca90b921513affe69a/wagtail_schema.org-2.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f01ed93d1469be9b788199a8482d1232", "sha256": "6b7aa9dd4dadc6d751b1ea3ae065803b9f106f145203991fea1b676da4c7bc92" }, "downloads": -1, "filename": "wagtail-schema.org-2.0.0.tar.gz", "has_sig": false, "md5_digest": "f01ed93d1469be9b788199a8482d1232", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10596, "upload_time": "2018-10-09T21:20:00", "url": "https://files.pythonhosted.org/packages/24/83/bccdaec389e07881ef3289a35fed5f2ed7c3c273c0d17117057f8a7d07ae/wagtail-schema.org-2.0.0.tar.gz" } ] }