From bc3a1132544e33375371d95e5a60f3f17ebc95a1 Mon Sep 17 00:00:00 2001 From: TLRZ Seyfferth Date: Thu, 7 May 2020 19:38:38 +0200 Subject: [PATCH] [SAVE] Zwischencommit --- Packages/chrosey_materialize/css/style.css | 15 ----- .../chrosey_materialize/partials/images.twig | 4 +- .../chrosey_materialize/partials/macros.twig | 14 +++-- .../chrosey_materialize/templates/blog.twig | 7 +-- .../templates/layout/navigationBar.twig | 6 +- .../20200507.synology-docker-gitea-drone.md | 35 +++++++++++ .../2020/20200121.hallo-welt/thumbs/ich.png | Bin 0 -> 3110 bytes .../ChroseyImageVariants.php | 15 +++++ plugins/PicoPagesImages.php | 55 ++++++++++-------- 9 files changed, 96 insertions(+), 55 deletions(-) create mode 100644 content/blog/2020/20200507.synology-docker-gitea-drone.md create mode 100644 images/blog/2020/20200121.hallo-welt/thumbs/ich.png create mode 100644 plugins/ChroseyImageVariants/ChroseyImageVariants.php diff --git a/Packages/chrosey_materialize/css/style.css b/Packages/chrosey_materialize/css/style.css index a59ca03..65e4e26 100644 --- a/Packages/chrosey_materialize/css/style.css +++ b/Packages/chrosey_materialize/css/style.css @@ -59,21 +59,6 @@ main { } } -picture { - width: 100%; - /* stretch to fit its containing element */ - overflow: hidden; -} - -picture img { - width: 100%; - /* stretch to fill the picture element */ - transition: filter .5s; -} - -picture.lazy img { - filter: blur(20px); -} /* header, diff --git a/Packages/chrosey_materialize/partials/images.twig b/Packages/chrosey_materialize/partials/images.twig index 6eea01e..17350d8 100644 --- a/Packages/chrosey_materialize/partials/images.twig +++ b/Packages/chrosey_materialize/partials/images.twig @@ -7,12 +7,12 @@ {% for image in images %} - {{ macros.variants(image) }} + {{ macros.variants(image.url, image.preview, image.alt, 200, 50 ) }} {% endfor %} {% else %} - {{ macros.variants(images.0, "materialboxed" ) }} + {{ macros.variants(images.0.url, images.0.preview, images.0.alt, 200, 50, "materialboxed" ) }} {% endif %} diff --git a/Packages/chrosey_materialize/partials/macros.twig b/Packages/chrosey_materialize/partials/macros.twig index 19f9719..d45aad0 100644 --- a/Packages/chrosey_materialize/partials/macros.twig +++ b/Packages/chrosey_materialize/partials/macros.twig @@ -1,8 +1,12 @@ -{% macro variants(image,class="") %} -
- {{ image.alt}} + {{ alt}}
{% endmacro %} diff --git a/Packages/chrosey_materialize/templates/blog.twig b/Packages/chrosey_materialize/templates/blog.twig index 44ef36c..41d6a19 100644 --- a/Packages/chrosey_materialize/templates/blog.twig +++ b/Packages/chrosey_materialize/templates/blog.twig @@ -1,5 +1,5 @@ {% extends "templates/layout/base.twig" %} - +{% import "partials/macros.twig" as macros %} {% block content %} {{parent()}} @@ -9,10 +9,7 @@
- {{ images.0.alt }} + {{ macros.variants(images.0.url, images.0.url, images.0.alt, 200, 50 ) }} chevron_right diff --git a/Packages/chrosey_materialize/templates/layout/navigationBar.twig b/Packages/chrosey_materialize/templates/layout/navigationBar.twig index 3e4b617..f2bcbfd 100644 --- a/Packages/chrosey_materialize/templates/layout/navigationBar.twig +++ b/Packages/chrosey_materialize/templates/layout/navigationBar.twig @@ -4,10 +4,8 @@ diff --git a/content/blog/2020/20200507.synology-docker-gitea-drone.md b/content/blog/2020/20200507.synology-docker-gitea-drone.md new file mode 100644 index 0000000..954e8fe --- /dev/null +++ b/content/blog/2020/20200507.synology-docker-gitea-drone.md @@ -0,0 +1,35 @@ +--- +Title: Gitea und Drone +Description: Einrichtung einer CI/CD-Lösung auf der Diskstation +Author: Christian Seyfferth +Date: 2020-05-07 01:00 + +Template: templates/blogitem +--- + +# CI/CD mit der Diskstation + +Einige haben ja, wie ich, zu Hause eine Diskstation von Synology stehen. Da ich selbst auch einige kleine Sachen programmiere, +wollte ich mir auch den Komfort wie auf Arbeit gönnen und automatisiert Pipelines starten. + +Zunächst habe ich mir hier ein Gitea aufgesetzt: + +
    +
  • +
  • +
+ + + + + + + +- [ ] Drone-Server +- [ ] Drone-Runner +- [ ] Oauth +- [ ] Webhook +- [ ] Admin + + + diff --git a/images/blog/2020/20200121.hallo-welt/thumbs/ich.png b/images/blog/2020/20200121.hallo-welt/thumbs/ich.png new file mode 100644 index 0000000000000000000000000000000000000000..d2a99e5c5e1a30cf2557b12410508a49e5cdef23 GIT binary patch literal 3110 zcmZuz3se(l7XFhEf(pn>M6?*SRD3csBr&9}6%rm%5+fj@-ByM$dDM`EBq%;wIFz~| zD^IcNilShvVy(Dx6zgNPQo!osD%M3;U63lp2R(IbV@2INNhF~%=lr?f-22_f-2eVF zDN@Meyha9(LtDsg-}E3r~#4<_grOsq70$6?;w;{ zfY9%t%Iifa8$+ls4I$B1gvJ_ooLD>;3?q#3%ghLk@}(CeH)BOPDBaT+#z{cJ^-TOt zE(nfADvROtFeU_Y#vb|nB?&4YB`IG8$y8{+`jd;o(A9f9S?VA=SzcQAu(!zTfcci{7Y!yFtYU>tnC zL0*JK01g0o1C~G29*54Y{foVZ$ACi%?f59|440YAG-vD8C`mReE|QPMA`}l=+UvEn zsZ&#z5aPrb2_i6DD8d9H9OL3V5f&lh^U)ZzJ>OpG&)`_?z*fMM3++|V$)-AR7+_S! zL2e*0g1}g1_Noz(+#EOnFuTGYGYl}N!Wn0T1JhwfIye|`)>m*)I_QLeQH>)$j$w=% zXD667&fQ=+FufbhIy;As$#TJL2ObA{cNaakj)`d9b~+babib^yV3ZI&ufug|INfuY z*98ehQ0|m>WkAZtPhaSeub`kJP=My<3jp;SYAwk&geH>EI zbekT}P)kgzC4;n3BBhA}0UaZ-Sr|Tx5GE722p5P5YzBslFl<%LyH!IRG7TA8)tWyz zU~@!7gxw)%*{lWN;7ezqao$UBDZI{k-mx z8pzY%AWO7rtwp<*${5Zo>+dT`@S669*CG?R=}FyiPMR?GZgBD+bc%t>7pYWc%7Tap z;faA+Q@}iNh&hEanY9Kz;t6MR`Ivq2gaKD0^?!(DG?=qZl+2JpA*`(NMjV&}T_V}d z3X?%?A~O-ua;fA#Fvh;Yu(b&fCwM}Sx!v^sdJa-zb);E?u+{j}E1;h;RIkwHxR%O` zoXMq2<_Y^dIV*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oPagesImages.php b/plugins/PicoPagesImages.php index 67651e0..758ba1f 100644 --- a/plugins/PicoPagesImages.php +++ b/plugins/PicoPagesImages.php @@ -1,12 +1,13 @@ * @license http://opensource.org/licenses/MIT The MIT License - * @link http://nliautaud.fr - * @link http://picocms.org + * + * @see http://nliautaud.fr + * @see http://picocms.org */ class PicoPagesImages extends AbstractPicoPlugin { @@ -16,7 +17,7 @@ class PicoPagesImages extends AbstractPicoPlugin /** * Register path relative to content without index and extension - * var/html/content/foo/bar.md => foo/bar/ + * var/html/content/foo/bar.md => foo/bar/. * * Triggered after Pico has discovered the content file to serve * @@ -36,29 +37,33 @@ class PicoPagesImages extends AbstractPicoPlugin } $contentExt = $this->getConfig('content_ext'); $this->path = substr($file, $contentDirLength); - $this->path = rtrim($this->path, "index$contentExt"); + $this->path = rtrim($this->path, "index{$contentExt}"); $this->path = rtrim($this->path, $contentExt); if ($this->path) { $this->path .= '/'; } } + /** - * Triggered after Pico has read its configuration + * Triggered after Pico has read its configuration. * * @see Pico::getConfig() - * @param array &$config array of config variables + * + * @param array &$config array of config variables + * * @return void */ public function onConfigLoaded(array &$config) { if (!empty($config['images_path'])) { - $this->root = rtrim($config['images_path'], '/') . '/'; + $this->root = rtrim($config['images_path'], '/').'/'; } else { $this->root = 'images/'; } } + /** - * Triggered before Pico renders the page + * Triggered before Pico renders the page. * * @see DummyPlugin::onPageRendered() * @@ -72,6 +77,7 @@ class PicoPagesImages extends AbstractPicoPlugin // Create images array $twigVariables['images'] = $this->getImages(); } + /** * Return the list and infos of images in the current directory. * @@ -79,46 +85,47 @@ class PicoPagesImages extends AbstractPicoPlugin */ private function getImages() { - $images_path = $this->root . $this->path; + $images_path = $this->root.$this->path; // Filter images path for extra slashes - $images_path = preg_replace('/(\/+)/','/',$images_path); + $images_path = preg_replace('/(\/+)/', '/', $images_path); - $data = array(); + $data = []; $pattern = '*.{[jJ][pP][gG],[jJ][pP][eE][gG],[pP][nN][gG],[gG][iI][fF]}'; - $images = glob($images_path . $pattern, GLOB_BRACE); - $meta = array(); + $images = glob($images_path.$pattern, GLOB_BRACE); + $meta = []; if (!is_array($images)) { - return array(); + return []; } foreach ($images as $path) { $imagesize = getimagesize($path); if (!is_array($imagesize)) { - $imagesize = array(); + $imagesize = []; } - list($width, $height,, $size) = array_pad($imagesize, 4, ''); + list($width, $height, , $size) = array_pad($imagesize, 4, ''); // Find meta files for images if they exist - $metapath = $path . '.meta.yml'; + $metapath = $path.'.meta.yml'; if (is_file($metapath)) { $yamlparser = $this->getPico()->getYamlParser(); $meta = $yamlparser->parse(file_get_contents($metapath)); } - $data[] = array ( - 'url' => $this->getBaseUrl() . $images_path . pathinfo($path, PATHINFO_BASENAME), + $data[] = [ + 'url' => $this->getBaseUrl().$images_path.pathinfo($path, PATHINFO_BASENAME), + 'preview' => $this->getBaseUrl().pathinfo($path, PATHINFO_DIRNAME).'/thumbs/'.pathinfo($path, PATHINFO_BASENAME), + 'basename' => pathinfo($path, PATHINFO_BASENAME), 'path' => $images_path, 'name' => pathinfo($path, PATHINFO_FILENAME), 'ext' => pathinfo($path, PATHINFO_EXTENSION), 'width' => $width, 'height' => $height, 'size' => $size, - 'meta' => $meta - ); - - + 'meta' => $meta, + ]; } + return $data; } }