11x-wagtail-blog


Name11x-wagtail-blog JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summary11x Wagtail Blog
upload_time2023-07-13 23:33:29
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords wagtail blog
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            11x Wagtail Blog
================

|PyPI| |Build| |Supported Python versions| |Documentation| |Downloads| 


11x Wagtail Blog
================

``11x-wagtail-blog`` is a wagtail app implementing basic blog features for a wagtail site. This project started as an
implementation of the blogging features of ``11x.engineering``, but since it is intended to be used as the first series
of articles, it has been open sourced and published here. It is intended to demonstrate how to develop a fully featured
package published to PyPI.


Quick Start
===========

To install::

    pip install 11x-wagtail-blog

Add ``x11x_wagtail_blog`` to your ``INSTALLED_APPS``::

    INSTALLED_APPS = [
        ...,
        'x11x_wagtail_blog',
        ...,
    ]

Since this package only gives you the common features of every blogging application, you will need to define your own page
models and derive them from `ExtensibleArticlePage`::

>>> from x11x_wagtail_blog.models import ExtensibleArticlePage
>>> from wagtail.admin.panels import FieldPanel
>>> from wagtail.blocks import TextBlock
>>> from wagtail.fields import StreamField

>>> class MyArticlePage(ExtensibleArticlePage):
...     body = StreamField([
...         ("text", TextBlock()),
...     ], use_json_field=True)
...
...     content_panels = ExtensibleArticlePage.with_body_panels([
...         FieldPanel("body"),
...     ])

This can be done in any valid Wagtail app.

Next, generate your migrations as usual::

    python manage.py makemigrations
    python manage.py migrate

You will have to define a template. The default template used is ``x11x_wagtail_blog/article_page.html``, but you should
override the ``get_template()`` method to return your own template.

.. code-block:: html

    <!DOCTYPE html>
    <html>
      <head>...</head>
      <body>
        <h1>{{ self.title }}</h1>

        {% include_block self.body %}

        <h2>About the authors</h2>
        {% for author in self.authors %}
        {% include "myblog/about_the_author_section.html" with author=author.value %}
        {% endfor %}

        <h2>Related Articles</h2>
        <ul>
        {% for article in self.related_articles %}
        <li><a href="{% pageurl article %}">{{ article.title }}</a></li>
        {% endfor %}
        </ul>
      </body>
    </html>


.. |PyPI| image:: https://img.shields.io/pypi/v/11x-wagtail-blog
   :target: https://pypi.org/project/11x-wagtail-blog/
.. |Build| image:: https://github.com/11x-engineering/11x-wagtail-blog/actions/workflows/package.yml/badge.svg
   :target: https://github.com/11x-engineering/11x-wagtail-blog/actions/workflows/package.yml
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/11x-wagtail-blog.svg
   :target: https://pypi.org/project/11x-wagtail-blog/
.. |Documentation| image:: https://readthedocs.org/projects/11x-wagtail-blog/badge/?version=latest
   :target: https://11x-wagtail-blog.readthedocs.io/en/latest/?badge=latest
.. |Downloads| image:: https://pepy.tech/badge/11x-wagtail-blog/month
   :target: https://pepy.tech/project/11x-wagtail-blog/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "11x-wagtail-blog",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "wagtail,blog",
    "author": null,
    "author_email": "The Magnificant Nick <it@11x.engineering>",
    "download_url": "https://files.pythonhosted.org/packages/93/61/3f635a4e866ed1724cb68c92038bc2f82b954c738fca3de1af4975a1df00/11x_wagtail_blog-0.2.0.tar.gz",
    "platform": null,
    "description": "11x Wagtail Blog\n================\n\n|PyPI| |Build| |Supported Python versions| |Documentation| |Downloads| \n\n\n11x Wagtail Blog\n================\n\n``11x-wagtail-blog`` is a wagtail app implementing basic blog features for a wagtail site. This project started as an\nimplementation of the blogging features of ``11x.engineering``, but since it is intended to be used as the first series\nof articles, it has been open sourced and published here. It is intended to demonstrate how to develop a fully featured\npackage published to PyPI.\n\n\nQuick Start\n===========\n\nTo install::\n\n    pip install 11x-wagtail-blog\n\nAdd ``x11x_wagtail_blog`` to your ``INSTALLED_APPS``::\n\n    INSTALLED_APPS = [\n        ...,\n        'x11x_wagtail_blog',\n        ...,\n    ]\n\nSince this package only gives you the common features of every blogging application, you will need to define your own page\nmodels and derive them from `ExtensibleArticlePage`::\n\n>>> from x11x_wagtail_blog.models import ExtensibleArticlePage\n>>> from wagtail.admin.panels import FieldPanel\n>>> from wagtail.blocks import TextBlock\n>>> from wagtail.fields import StreamField\n\n>>> class MyArticlePage(ExtensibleArticlePage):\n...     body = StreamField([\n...         (\"text\", TextBlock()),\n...     ], use_json_field=True)\n...\n...     content_panels = ExtensibleArticlePage.with_body_panels([\n...         FieldPanel(\"body\"),\n...     ])\n\nThis can be done in any valid Wagtail app.\n\nNext, generate your migrations as usual::\n\n    python manage.py makemigrations\n    python manage.py migrate\n\nYou will have to define a template. The default template used is ``x11x_wagtail_blog/article_page.html``, but you should\noverride the ``get_template()`` method to return your own template.\n\n.. code-block:: html\n\n    <!DOCTYPE html>\n    <html>\n      <head>...</head>\n      <body>\n        <h1>{{ self.title }}</h1>\n\n        {% include_block self.body %}\n\n        <h2>About the authors</h2>\n        {% for author in self.authors %}\n        {% include \"myblog/about_the_author_section.html\" with author=author.value %}\n        {% endfor %}\n\n        <h2>Related Articles</h2>\n        <ul>\n        {% for article in self.related_articles %}\n        <li><a href=\"{% pageurl article %}\">{{ article.title }}</a></li>\n        {% endfor %}\n        </ul>\n      </body>\n    </html>\n\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/11x-wagtail-blog\n   :target: https://pypi.org/project/11x-wagtail-blog/\n.. |Build| image:: https://github.com/11x-engineering/11x-wagtail-blog/actions/workflows/package.yml/badge.svg\n   :target: https://github.com/11x-engineering/11x-wagtail-blog/actions/workflows/package.yml\n.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/11x-wagtail-blog.svg\n   :target: https://pypi.org/project/11x-wagtail-blog/\n.. |Documentation| image:: https://readthedocs.org/projects/11x-wagtail-blog/badge/?version=latest\n   :target: https://11x-wagtail-blog.readthedocs.io/en/latest/?badge=latest\n.. |Downloads| image:: https://pepy.tech/badge/11x-wagtail-blog/month\n   :target: https://pepy.tech/project/11x-wagtail-blog/\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "11x Wagtail Blog",
    "version": "0.2.0",
    "project_urls": {
        "Documentation": "https://11x-wagtail-blog.readthedocs.io/en/latest/",
        "Home": "https://github.com/11x-engineering/11x-wagtail-blog",
        "Source": "https://github.com/11x-engineering/11x-wagtail-blog"
    },
    "split_keywords": [
        "wagtail",
        "blog"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "11ca78c839edb023acdef2d0a55cb30889c1a4a9457ede26e88b7f8906793552",
                "md5": "f4772bbab0cab06c3852d81f659d455e",
                "sha256": "0cf6e1a81f6dd333a915bf19729e483dc150aabc0fd292ce6dde4332ce34b3eb"
            },
            "downloads": -1,
            "filename": "11x_wagtail_blog-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f4772bbab0cab06c3852d81f659d455e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15944,
            "upload_time": "2023-07-13T23:33:27",
            "upload_time_iso_8601": "2023-07-13T23:33:27.994136Z",
            "url": "https://files.pythonhosted.org/packages/11/ca/78c839edb023acdef2d0a55cb30889c1a4a9457ede26e88b7f8906793552/11x_wagtail_blog-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "93613f635a4e866ed1724cb68c92038bc2f82b954c738fca3de1af4975a1df00",
                "md5": "97252b9473346cc00fe22ae06ee39a46",
                "sha256": "df04f74d20cb37b1e3e27206a8d294821bdefb0af13af4c0fc2875c4f57b5ce9"
            },
            "downloads": -1,
            "filename": "11x_wagtail_blog-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "97252b9473346cc00fe22ae06ee39a46",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14394,
            "upload_time": "2023-07-13T23:33:29",
            "upload_time_iso_8601": "2023-07-13T23:33:29.827867Z",
            "url": "https://files.pythonhosted.org/packages/93/61/3f635a4e866ed1724cb68c92038bc2f82b954c738fca3de1af4975a1df00/11x_wagtail_blog-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-13 23:33:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "11x-engineering",
    "github_project": "11x-wagtail-blog",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "11x-wagtail-blog"
}
        
Elapsed time: 0.09569s