lazycms


Namelazycms JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/neurophant/lazycms/
SummaryMinimalistic CMS in Python with Markdown content
upload_time2024-07-11 18:35:01
maintainerNone
docs_urlNone
authorAnton Smolin
requires_pythonNone
licenseMIT
keywords markdown cms minimalistic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Lazy CMS
========

Minimalistic CMS in Python with Markdown content

Features
--------

* No storages, simple file structure
* Markdown content with images
* Static auto-collection
* Simple pagination

Requirements
------------

* Python 3.12
* FastAPI 0.111.0
* Jinja2 3.1.4
* Markdown 3.6
* PyYAML 6.0.1
* python-slugify 8.0.4
* pydantic 2.8.2

Install
-------

.. code-block:: bash

    python3.12 -m venv venv
    source venv/bin/activate
    pip install lazycms

Usage
-----

Example project structure:

* project/
    * static/
        * content/ - empty directory, static content will be collected here
        * theme/ - your theme css/js
    * storage/ - your file storage directory
        * article-1/ - entity (article) directory
            * content.md - your article
            * meta.yml - entity metadata
            * picture.jpeg - picture for your article
            * preview.md - entity article miniature for index page
        * article-2/
            * content.md
            * meta.yml
            * picture.jpeg
            * preview.md
    * templates/ - Jinja2 templates directory
        * index.html - entity index template with **entity** and **paginator** context objects
        * entity.html - entity template with **entity** context object
    * app.py - CMS code
    * app.yml - CMS config

project/storage/article-1/content.md:

.. code-block:: markdown

    # Article 1

    ![Article 1]({{slug_url}}/picture.jpeg "Article 1")

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
    aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

project/storage/article-1/preview.md:

.. code-block:: markdown

    ![Article 1]({{slug_url}}/picture.jpeg "Article 1")

    # Article 1

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
    aliqua. Ut enim ad minim veniam...

project/storage/article-1/meta.yml:

.. code-block:: yaml

    timestamp: !!timestamp 2024-01-01T17:00:00Z
    title: Article 1
    content: content.md
    preview: preview.md
    images:
        - picture.jpeg
    tags:
        - article
        - test

project/templates/index.html:

.. code-block:: html

    {% for entity in entities %}
        <article>
            {{ entity.preview|safe }}
        </article>
    {% endfor %}

    {% if paginator.page > 1 %}
        <a href="/?page={{ paginator.page - 1 }}">Prev</a>
    {% else %}
        Prev
    {% endif %}
    {% if paginator.page < paginator.page_count %}
        <a href="/?page={{ paginator.page + 1 }}">Next</a>
    {% else %}
        Next
    {% endif %}

project/templates/entity.html:

.. code-block:: html

    <article>
        {{ entity.content|safe }}
    </article>

project/app.yml:

.. code-block:: yaml

    # Storage config
    storage_type: FILE
    storage_path: ./storage
    storage_meta: meta.yml
    # Static config
    static_path: ./static
    static_url: /static
    # Static collected content config
    collect_path: ./static/content
    collect_url: /static/content
    # Templates
    templates_path: ./templates
    # Pagination
    paginate: 10

project/app.py:

.. code-block:: python

    from lazycms import LazyCMS


    cms = LazyCMS(config_path='app.yml')

Run:

.. code-block:: bash

    uvicorn app:cms.app --reload

http://localhost:8000 - index page

http://localhost:8000/2024-01-01-article-1 - Article 1 page

http://localhost:8000/2024-01-02-article-2 - Article 2 page

Tests
-----

TBD

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/neurophant/lazycms/",
    "name": "lazycms",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "markdown cms minimalistic",
    "author": "Anton Smolin",
    "author_email": "smolin.anton@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/31/c6/34d63c4044674d561907e72b86c84f139c05d0e2cde76c9fa2fb604117da/lazycms-0.1.0.tar.gz",
    "platform": null,
    "description": "Lazy CMS\n========\n\nMinimalistic CMS in Python with Markdown content\n\nFeatures\n--------\n\n* No storages, simple file structure\n* Markdown content with images\n* Static auto-collection\n* Simple pagination\n\nRequirements\n------------\n\n* Python 3.12\n* FastAPI 0.111.0\n* Jinja2 3.1.4\n* Markdown 3.6\n* PyYAML 6.0.1\n* python-slugify 8.0.4\n* pydantic 2.8.2\n\nInstall\n-------\n\n.. code-block:: bash\n\n    python3.12 -m venv venv\n    source venv/bin/activate\n    pip install lazycms\n\nUsage\n-----\n\nExample project structure:\n\n* project/\n    * static/\n        * content/ - empty directory, static content will be collected here\n        * theme/ - your theme css/js\n    * storage/ - your file storage directory\n        * article-1/ - entity (article) directory\n            * content.md - your article\n            * meta.yml - entity metadata\n            * picture.jpeg - picture for your article\n            * preview.md - entity article miniature for index page\n        * article-2/\n            * content.md\n            * meta.yml\n            * picture.jpeg\n            * preview.md\n    * templates/ - Jinja2 templates directory\n        * index.html - entity index template with **entity** and **paginator** context objects\n        * entity.html - entity template with **entity** context object\n    * app.py - CMS code\n    * app.yml - CMS config\n\nproject/storage/article-1/content.md:\n\n.. code-block:: markdown\n\n    # Article 1\n\n    ![Article 1]({{slug_url}}/picture.jpeg \"Article 1\")\n\n    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\n    aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur\n    sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nproject/storage/article-1/preview.md:\n\n.. code-block:: markdown\n\n    ![Article 1]({{slug_url}}/picture.jpeg \"Article 1\")\n\n    # Article 1\n\n    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\n    aliqua. Ut enim ad minim veniam...\n\nproject/storage/article-1/meta.yml:\n\n.. code-block:: yaml\n\n    timestamp: !!timestamp 2024-01-01T17:00:00Z\n    title: Article 1\n    content: content.md\n    preview: preview.md\n    images:\n        - picture.jpeg\n    tags:\n        - article\n        - test\n\nproject/templates/index.html:\n\n.. code-block:: html\n\n    {% for entity in entities %}\n        <article>\n            {{ entity.preview|safe }}\n        </article>\n    {% endfor %}\n\n    {% if paginator.page > 1 %}\n        <a href=\"/?page={{ paginator.page - 1 }}\">Prev</a>\n    {% else %}\n        Prev\n    {% endif %}\n    {% if paginator.page < paginator.page_count %}\n        <a href=\"/?page={{ paginator.page + 1 }}\">Next</a>\n    {% else %}\n        Next\n    {% endif %}\n\nproject/templates/entity.html:\n\n.. code-block:: html\n\n    <article>\n        {{ entity.content|safe }}\n    </article>\n\nproject/app.yml:\n\n.. code-block:: yaml\n\n    # Storage config\n    storage_type: FILE\n    storage_path: ./storage\n    storage_meta: meta.yml\n    # Static config\n    static_path: ./static\n    static_url: /static\n    # Static collected content config\n    collect_path: ./static/content\n    collect_url: /static/content\n    # Templates\n    templates_path: ./templates\n    # Pagination\n    paginate: 10\n\nproject/app.py:\n\n.. code-block:: python\n\n    from lazycms import LazyCMS\n\n\n    cms = LazyCMS(config_path='app.yml')\n\nRun:\n\n.. code-block:: bash\n\n    uvicorn app:cms.app --reload\n\nhttp://localhost:8000 - index page\n\nhttp://localhost:8000/2024-01-01-article-1 - Article 1 page\n\nhttp://localhost:8000/2024-01-02-article-2 - Article 2 page\n\nTests\n-----\n\nTBD\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Minimalistic CMS in Python with Markdown content",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/neurophant/lazycms/"
    },
    "split_keywords": [
        "markdown",
        "cms",
        "minimalistic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8ad17f05010aaafb1e006cc85109c4df22b7c25c59d1af80d796505d6a10825",
                "md5": "eda295e67b1dc0cbac17dfff1e9be5d3",
                "sha256": "083947b2d50dbda7296bc445ada8fe2060113313fe7ce4db4cbc3c92fcf44e2e"
            },
            "downloads": -1,
            "filename": "lazycms-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eda295e67b1dc0cbac17dfff1e9be5d3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6841,
            "upload_time": "2024-07-11T18:34:58",
            "upload_time_iso_8601": "2024-07-11T18:34:58.892585Z",
            "url": "https://files.pythonhosted.org/packages/b8/ad/17f05010aaafb1e006cc85109c4df22b7c25c59d1af80d796505d6a10825/lazycms-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "31c634d63c4044674d561907e72b86c84f139c05d0e2cde76c9fa2fb604117da",
                "md5": "7239d4942a0c638f35c6086c982709b1",
                "sha256": "788d88a209957e42d131e206c022cdd89f0518e4c95e2439c2bd642ed11d0e6c"
            },
            "downloads": -1,
            "filename": "lazycms-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7239d4942a0c638f35c6086c982709b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6366,
            "upload_time": "2024-07-11T18:35:01",
            "upload_time_iso_8601": "2024-07-11T18:35:01.592544Z",
            "url": "https://files.pythonhosted.org/packages/31/c6/34d63c4044674d561907e72b86c84f139c05d0e2cde76c9fa2fb604117da/lazycms-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-11 18:35:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "neurophant",
    "github_project": "lazycms",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "lazycms"
}
        
Elapsed time: 0.33768s