{ "info": { "author": "Amin Mesbah", "author_email": "dev@aminmesbah.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Plugins", "Framework :: Lektor", "License :: OSI Approved :: MIT License" ], "description": "# Lektor WebDAV Plugin\n\n[![PyPI version shields.io](https://img.shields.io/pypi/v/lektor-webdav.svg)](https://pypi.python.org/pypi/lektor-webdav/)\n\nGet a list of files hosted on a WebDAV server for use in your\n[Lektor](https://www.getlektor.com/) templates.\n\n\n## Installation\n\n```\nmkdir packages\ncd packages\ngit clone https://github.com/mesbahamin/lektor-webdav\n```\n\nI'll try to set this up soon so it can be installed properly with `lektor\nplugins add`.\n\n\n## Configuration\n\nFor each WebDAV server you want to use, add a section in `configs/webdav.ini`:\n\n```\n[photos]\nurl = https://my.webdav.domain/photography/\nusername = my_user@example.com\npasscmd = pass my_webdav_server\n```\n\nReplace 'photos' with whatever label you want for this particular webdav server.\n\n\n### Options\n\n|Option | Description\n|---------|-------------------------------------------------------------------------\n|url | URL of your WebDAV folder\n|username | Username with which to authenticate with the WebDAV server\n|passcmd | A command that will return your WebDAV password as a UTF-8 string\n\n\n## Use In Templates\n\nThis plugin exposes the following for use in Jinja2 templates:\n\n\n### Functions\n\n- `webdav_ls_files`\n - Return a list of all files (not folders) in a WebDAV directory. The files\n are returned in the form of a list of `WebdavFile` instances.\n - Parameters:\n - `webdav_id`. This is the name you chose as the section title in\n `webdav.ini` ('photos' in the above snippet).\n - `path` (optional). If you want to look in a subfolder of your WebDAV\n folder, pass its name in here.\n- `webdav_ls_file_names`\n - Same as `webdav_ls_files`, but only return the names.\n- `webdav_ls_file_paths`\n - Same as `webdav_ls_files`, but only return the paths.\n\n\n### Tuples\n\n- `WebdavFile`: A named tuple that holds information about a file.\n - `path`\n - The full path of the file with the WebDAV server's URL as its root.\n - Example: `'/photographs/my_photograph_of_a_wall.jpg'`\n - `name`\n - Just the name of the file itself.\n - Example: `'my_photograph_of_a_wall.jpg'`\n - `content_type`\n - Filetype metadata supplied by the WebDAV server.\n - Example: `'images/jpeg'`\n\n\n### Filters\n\n- `webdav_zip`\n - Jinja2 doesn't have a `zip` filter, so I included one here since I needed\n to pair up my photos with generated thumbnails (see example below).\n - Usage: `{{ zipped_iterator_ab = iterator_a|zip(iterator_b) }}`\n\n\n## Example\n\nI made this because I wanted to make a photo gallery on my blog. I already had\na webDAV server through my Fastmail account, and I wanted to host the images\nthere.\n\nMy full site configuration can be found\n[here](https://github.com/mesbahamin/amin.space), but here are the main bits:\n\n\n### Config\n\nMy `webdav.ini` looks like this:\n\n```\n[photography]\nurl = https://myfiles.fastmail.com/photography/\nusername = me@mydomain.com\npasscmd = pass sync/fastmail_webdav\n```\n\nI using [pass](https://www.passwordstore.org/) to manage my passwords, so\nI invoke it in `passcmd`.\n\n\n### Template\n\nThe template for my photography page looks like this:\n\n```\n{% extends \"layout.html\" %}\n{% block body %}\n

Photography

\n
\n
\n{% set photo_host_url = bag('photo_list', 'host_url') %}\n{% set thumb_dimension = bag('photo_list', 'thumb_dimension') %}\n{%\n for photo_file_name, thumbnail_file_name\n in (\n webdav_ls_file_names('photography')\n |webdav_zip(webdav_ls_file_names('photography', 'thumbnails')\n )\n |sort(reverse=True))\n%}\n {% set photo_url = photo_host_url + photo_file_name %}\n {% set thumb_url = photo_host_url + 'thumbnails/' + thumbnail_file_name %}\n
\n \n \n \n
\n{% endfor %}\n
\n
\n{% endblock %}\n```\n\nI get a list of my WebDAV hosted photos and a list of pre-generated thumbnails.\nThen I zip them together with `webdav_zip` and iterate through them\nsimultaneously.\n\n\n### Result\n\nMy gallery page looks like [this](https://www.amin.space/photography/).\n\nWhen I want to add more photos, I simply upload them to my WebDAV server, then\nrun `lektor build`.\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/mesbahamin/lektor-webdav", "keywords": "lektor webdav blog website files plugin", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "lektor-webdav", "package_url": "https://pypi.org/project/lektor-webdav/", "platform": "", "project_url": "https://pypi.org/project/lektor-webdav/", "project_urls": { "Homepage": "https://github.com/mesbahamin/lektor-webdav", "Source": "https://github.com/mesbahamin/lektor-webdav", "Tracker": "https://github.com/mesbahamin/lektor-webdav/issues" }, "release_url": "https://pypi.org/project/lektor-webdav/0.1.1.post5/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Lektor plugin to get a list of files from a WebDAV server", "version": "0.1.1.post5" }, "last_serial": 3879666, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6f6b6f7e8973dd190729b1a4b5d1831d", "sha256": "2822fc45a6fd08065f5213f36446dfc3c0ea1ba5abead0c35b9ec172c8e86d36" }, "downloads": -1, "filename": "lektor-webdav-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6f6b6f7e8973dd190729b1a4b5d1831d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3560, "upload_time": "2018-04-30T06:55:11", "url": "https://files.pythonhosted.org/packages/7d/47/1b04cd3fcb33a60a6309adc319436fd0222ad058d954aff7b58901864bd3/lektor-webdav-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ca2e12ac46ca57525192e2877dd094f1", "sha256": "6d273dd40f71f7f30005b1e4dfbe4805454692b4c1ad45413b9e517c2c9c7a30" }, "downloads": -1, "filename": "lektor-webdav-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ca2e12ac46ca57525192e2877dd094f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3535, "upload_time": "2018-04-30T06:58:54", "url": "https://files.pythonhosted.org/packages/a2/3e/e49d1f74096a2fc57570f4b8386eec7a64b4d422497d609395400c495ec4/lektor-webdav-0.1.1.tar.gz" } ], "0.1.1.post1": [ { "comment_text": "", "digests": { "md5": "4d45691f4052fa1d7e7c8fc5b65b1e04", "sha256": "145833e9923de1555f1de5d02b9f67cde1a30c5ff6364ad9db49132ff8dd1949" }, "downloads": -1, "filename": "lektor_webdav-0.1.1.post1-py3-none-any.whl", "has_sig": false, "md5_digest": "4d45691f4052fa1d7e7c8fc5b65b1e04", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4526, "upload_time": "2018-05-01T02:34:21", "url": "https://files.pythonhosted.org/packages/dc/c5/20198345f9a184e3decfbfe5206652afa376113fd40245f6c79b43e2c0f2/lektor_webdav-0.1.1.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f9d668301abe0db5b0a551965ca22e5", "sha256": "0c53dd838ebfd5396bcb78ff2de834e3a56a51376d1c6d068e5c8ab7bbeab6b6" }, "downloads": -1, "filename": "lektor-webdav-0.1.1.post1.tar.gz", "has_sig": false, "md5_digest": "5f9d668301abe0db5b0a551965ca22e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4437, "upload_time": "2018-05-01T02:34:22", "url": "https://files.pythonhosted.org/packages/60/b4/c043f40ecf85fa4f3c3666fcba7e65939eb43f76e0ded8dd2ff94f5661f7/lektor-webdav-0.1.1.post1.tar.gz" } ], "0.1.1.post2": [ { "comment_text": "", "digests": { "md5": "e5bf793f060b931234a66a5026472928", "sha256": "0d23cda9a7263ab7cc509839cdff47c918662f90d3b669f174f5178942b1299b" }, "downloads": -1, "filename": "lektor_webdav-0.1.1.post2-py3-none-any.whl", "has_sig": false, "md5_digest": "e5bf793f060b931234a66a5026472928", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4588, "upload_time": "2018-05-01T02:45:47", "url": "https://files.pythonhosted.org/packages/66/8d/4150ff0e45d3353e7611ec6fae6991f55e4dfa4a13dcc1a08fe3a0ad1c83/lektor_webdav-0.1.1.post2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a1a29e9a349b3db871449c59bbbd8a52", "sha256": "06670c622d613d56ad81aa01b4ea723b2dca9d1b4e1f9a8841fcd2631f8a5e8c" }, "downloads": -1, "filename": "lektor-webdav-0.1.1.post2.tar.gz", "has_sig": false, "md5_digest": "a1a29e9a349b3db871449c59bbbd8a52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4498, "upload_time": "2018-05-01T02:45:48", "url": "https://files.pythonhosted.org/packages/a6/51/b693115efcfe0cd0e76aa1740623c449ebeb5fbc613fcbd001df7f5e2ed8/lektor-webdav-0.1.1.post2.tar.gz" } ], "0.1.1.post3": [ { "comment_text": "", "digests": { "md5": "6a859df59f3588b307e2236e40934546", "sha256": "01e328b9419e9248b2a481abcea2f34f1246bdc1dc6b2d9a010b1584037d95cf" }, "downloads": -1, "filename": "lektor_webdav-0.1.1.post3-py3-none-any.whl", "has_sig": false, "md5_digest": "6a859df59f3588b307e2236e40934546", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4579, "upload_time": "2018-05-01T02:49:25", "url": "https://files.pythonhosted.org/packages/91/fb/37b045a4d5162fd837c36ff647b2ab4a5a48655858fd828457a8896bfeb2/lektor_webdav-0.1.1.post3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6644c22a729b371430ac4010e54910b1", "sha256": "cd47f78777332ed14931aa21826c870c7cc2cb3b7dbb2c34c212661a4117eac3" }, "downloads": -1, "filename": "lektor-webdav-0.1.1.post3.tar.gz", "has_sig": false, "md5_digest": "6644c22a729b371430ac4010e54910b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4490, "upload_time": "2018-05-01T02:49:26", "url": "https://files.pythonhosted.org/packages/c9/3e/6cdd9c21a1fd11dcecc38f289ad6d5c342a5a75ba01f30fff3c1c806d6ef/lektor-webdav-0.1.1.post3.tar.gz" } ], "0.1.1.post4": [ { "comment_text": "", "digests": { "md5": "ef5986725776188a6298a1739eb0e1c2", "sha256": "760dcc787618b423ec062af7053a0f969ba58eb061fd459af498ed9ab88097a4" }, "downloads": -1, "filename": "lektor_webdav-0.1.1.post4-py3-none-any.whl", "has_sig": false, "md5_digest": "ef5986725776188a6298a1739eb0e1c2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4583, "upload_time": "2018-05-06T21:51:39", "url": "https://files.pythonhosted.org/packages/d6/c2/bc94a1a0c6812d6d4dee47629b261bc23c978109a2df47a614cecd9a2a31/lektor_webdav-0.1.1.post4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8e6718cef821c3f91839e2ffb3acfa8", "sha256": "51261967222cc41aa58ec92829628fe471ff5a6b15c10b302f012f91c12d364b" }, "downloads": -1, "filename": "lektor-webdav-0.1.1.post4.tar.gz", "has_sig": false, "md5_digest": "b8e6718cef821c3f91839e2ffb3acfa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4497, "upload_time": "2018-05-06T21:51:41", "url": "https://files.pythonhosted.org/packages/3b/d6/e49b9948a22bf7a9f3babb5b07fe491d1b5f63afa1bf9d3c7d3e0c3d4560/lektor-webdav-0.1.1.post4.tar.gz" } ], "0.1.1.post5": [ { "comment_text": "", "digests": { "md5": "fd4a359a11e6477cbf61044bdc07c659", "sha256": "f55d9bdf1a8616c749f2aa1a701e6600dcf10ffef543ffcd34b82265765349bf" }, "downloads": -1, "filename": "lektor_webdav-0.1.1.post5-py3-none-any.whl", "has_sig": false, "md5_digest": "fd4a359a11e6477cbf61044bdc07c659", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4586, "upload_time": "2018-05-19T19:14:19", "url": "https://files.pythonhosted.org/packages/8f/a1/034b3dfd29aeb9fa1a355b47718604941e6e50f8e8c4a820f192dbcf3cfb/lektor_webdav-0.1.1.post5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1b2f61e70c40f59a98eec5987ca41ed", "sha256": "a59601e02d39dfb12fd51f5167ac1cb570ab9c7e80fbd805cceba8c4b36cad04" }, "downloads": -1, "filename": "lektor-webdav-0.1.1.post5.tar.gz", "has_sig": false, "md5_digest": "c1b2f61e70c40f59a98eec5987ca41ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4499, "upload_time": "2018-05-19T19:14:22", "url": "https://files.pythonhosted.org/packages/6d/d1/3a3928bde9f88433f4b0940d3a670b3c9885e4ebd0582220ff8bd53c5740/lektor-webdav-0.1.1.post5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fd4a359a11e6477cbf61044bdc07c659", "sha256": "f55d9bdf1a8616c749f2aa1a701e6600dcf10ffef543ffcd34b82265765349bf" }, "downloads": -1, "filename": "lektor_webdav-0.1.1.post5-py3-none-any.whl", "has_sig": false, "md5_digest": "fd4a359a11e6477cbf61044bdc07c659", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4586, "upload_time": "2018-05-19T19:14:19", "url": "https://files.pythonhosted.org/packages/8f/a1/034b3dfd29aeb9fa1a355b47718604941e6e50f8e8c4a820f192dbcf3cfb/lektor_webdav-0.1.1.post5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1b2f61e70c40f59a98eec5987ca41ed", "sha256": "a59601e02d39dfb12fd51f5167ac1cb570ab9c7e80fbd805cceba8c4b36cad04" }, "downloads": -1, "filename": "lektor-webdav-0.1.1.post5.tar.gz", "has_sig": false, "md5_digest": "c1b2f61e70c40f59a98eec5987ca41ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4499, "upload_time": "2018-05-19T19:14:22", "url": "https://files.pythonhosted.org/packages/6d/d1/3a3928bde9f88433f4b0940d3a670b3c9885e4ebd0582220ff8bd53c5740/lektor-webdav-0.1.1.post5.tar.gz" } ] }