From 0f302ec5ba2f4ecd254bdccb4d0abd6d9e823cf5 Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Sat, 2 Jan 2021 15:06:56 -0700 Subject: [PATCH] Creating new barebones plugin imgcache. Eventually this will download and cache external images. Starting work on #27. --- www/plugins/jasonwilliams/imgcache/Plugin.php | 32 +++++++++++++++++++ .../jasonwilliams/imgcache/plugin.yaml | 6 ++++ .../imgcache/updates/version.yaml | 1 + .../partials/feed/template.htm | 3 +- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 www/plugins/jasonwilliams/imgcache/Plugin.php create mode 100644 www/plugins/jasonwilliams/imgcache/plugin.yaml create mode 100644 www/plugins/jasonwilliams/imgcache/updates/version.yaml diff --git a/www/plugins/jasonwilliams/imgcache/Plugin.php b/www/plugins/jasonwilliams/imgcache/Plugin.php new file mode 100644 index 0000000..4c44a06 --- /dev/null +++ b/www/plugins/jasonwilliams/imgcache/Plugin.php @@ -0,0 +1,32 @@ + 'Image Cache', + 'description' => 'Saves external images locally and presents them via a twig filter.', + 'author' => 'Jason Williams', + 'icon' => 'oc-icon-cloud' + ]; + } + + public function registerMarkupTags() + { + return [ + 'filters' => [ + 'imgcache' => function($imgurl) { + return $imgurl; + } + ] + ]; + } +} diff --git a/www/plugins/jasonwilliams/imgcache/plugin.yaml b/www/plugins/jasonwilliams/imgcache/plugin.yaml new file mode 100644 index 0000000..52d0ed6 --- /dev/null +++ b/www/plugins/jasonwilliams/imgcache/plugin.yaml @@ -0,0 +1,6 @@ +plugin: + name: 'Image Cache' + description: 'Saves external images locally and presents them via a twig filter.' + author: 'Jason Williams' + icon: oc-icon-cloud + homepage: 'https://ja.son-williams.ca/' diff --git a/www/plugins/jasonwilliams/imgcache/updates/version.yaml b/www/plugins/jasonwilliams/imgcache/updates/version.yaml new file mode 100644 index 0000000..44597c8 --- /dev/null +++ b/www/plugins/jasonwilliams/imgcache/updates/version.yaml @@ -0,0 +1 @@ +0.0.1: Initial version diff --git a/www/themes/jason-williamsca/partials/feed/template.htm b/www/themes/jason-williamsca/partials/feed/template.htm index f49b628..0194921 100644 --- a/www/themes/jason-williamsca/partials/feed/template.htm +++ b/www/themes/jason-williamsca/partials/feed/template.htm @@ -13,7 +13,8 @@
{% if post.extra.img %} - + + {% elseif post.extra.lat %} {% endif %}