[SAVE] Zwischencommit
This commit is contained in:
parent
03ebd97cd0
commit
bc3a113254
@ -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,
|
header,
|
||||||
|
|||||||
@ -7,12 +7,12 @@
|
|||||||
{% for image in images %}
|
{% for image in images %}
|
||||||
<a href="{{ image.url }}"
|
<a href="{{ image.url }}"
|
||||||
class="carousel-item">
|
class="carousel-item">
|
||||||
{{ macros.variants(image) }}
|
{{ macros.variants(image.url, image.preview, image.alt, 200, 50 ) }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ macros.variants(images.0, "materialboxed" ) }}
|
{{ macros.variants(images.0.url, images.0.preview, images.0.alt, 200, 50, "materialboxed" ) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
{% macro variants(image,class="") %}
|
{% macro variants(fullImage,preview,alt="",height,width,class="") %}
|
||||||
<div data-href="{{image.url}}"
|
|
||||||
|
{% set preview = preview!="" ? preview : fullImage %}
|
||||||
|
<div data-href="{{ fullImage }}"
|
||||||
class="progressive replace {{class}}">
|
class="progressive replace {{class}}">
|
||||||
<img src="{{ image.mypath }}/thumbs/{{ image.basename }}"
|
<img class="preview"
|
||||||
alt="{{ image.alt}}"
|
src="{{ preview }}"
|
||||||
class="preview">
|
alt="{{ alt}}"
|
||||||
|
height="{{ height }}"
|
||||||
|
width="{{ width }}">
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{% extends "templates/layout/base.twig" %}
|
{% extends "templates/layout/base.twig" %}
|
||||||
|
{% import "partials/macros.twig" as macros %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{parent()}}
|
{{parent()}}
|
||||||
|
|
||||||
@ -9,10 +9,7 @@
|
|||||||
<div class="col s12 m3">
|
<div class="col s12 m3">
|
||||||
<div class="card hoverable">
|
<div class="card hoverable">
|
||||||
<div class="card-image">
|
<div class="card-image">
|
||||||
<img data-src="{{ images.0.url }}"
|
{{ macros.variants(images.0.url, images.0.url, images.0.alt, 200, 50 ) }}
|
||||||
alt="{{ images.0.alt }}"
|
|
||||||
loading="lazy"
|
|
||||||
class="lazy">
|
|
||||||
<a href="{{ page.url }}"
|
<a href="{{ page.url }}"
|
||||||
class="btn-floating halfway-fab waves-effect waves-light deep-orange"><i
|
class="btn-floating halfway-fab waves-effect waves-light deep-orange"><i
|
||||||
class="material-icons">chevron_right</i></a>
|
class="material-icons">chevron_right</i></a>
|
||||||
|
|||||||
@ -4,10 +4,8 @@
|
|||||||
<a id="logo-container"
|
<a id="logo-container"
|
||||||
href="{{ "index"|link }}"
|
href="{{ "index"|link }}"
|
||||||
class="brand-logo">
|
class="brand-logo">
|
||||||
<img class="lazy"
|
<img src="{{ assets_url }}/logo.svg "
|
||||||
loading="lazy"
|
alt="Logo"
|
||||||
data-src="{{ assets_url }}/logo.svg "
|
|
||||||
alt=""
|
|
||||||
height="64"
|
height="64"
|
||||||
width="64" />
|
width="64" />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
35
content/blog/2020/20200507.synology-docker-gitea-drone.md
Normal file
35
content/blog/2020/20200507.synology-docker-gitea-drone.md
Normal file
@ -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:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><label><input type="checkbox" checked><span>Gitea </span></label></li>
|
||||||
|
<li><label><input type="checkbox" checked><span>Drone-Server </span></label></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<label><input type="checkbox" checked><span>Drone-Server </span></label>
|
||||||
|
|
||||||
|
<label><input type="checkbox" checked><span>Drone-Runner </span></label>
|
||||||
|
|
||||||
|
<label><input type="checkbox" checked><span>Oauth2 </span></label>
|
||||||
|
|
||||||
|
- [ ] Drone-Server
|
||||||
|
- [ ] Drone-Runner
|
||||||
|
- [ ] Oauth
|
||||||
|
- [ ] Webhook
|
||||||
|
- [ ] Admin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BIN
images/blog/2020/20200121.hallo-welt/thumbs/ich.png
Normal file
BIN
images/blog/2020/20200121.hallo-welt/thumbs/ich.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
15
plugins/ChroseyImageVariants/ChroseyImageVariants.php
Normal file
15
plugins/ChroseyImageVariants/ChroseyImageVariants.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class ChroseyImageVariants extends AbstractPicoPlugin
|
||||||
|
{
|
||||||
|
public function onPageRendering(&$templateName, array &$twigVariables)
|
||||||
|
{
|
||||||
|
// Create images array
|
||||||
|
$twigVariables['variants'] = $this->getImageVariants();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getImageVariants()
|
||||||
|
{
|
||||||
|
// code...
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,12 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Get the images of the current page with {{ images }} in Pico CMS.
|
* Get the images of the current page with {{ images }} in Pico CMS.
|
||||||
* Edited September 2018 by Brian Goncalves
|
* Edited September 2018 by Brian Goncalves.
|
||||||
*
|
*
|
||||||
* @author Nicolas Liautaud <contact@nliautaud.fr>
|
* @author Nicolas Liautaud <contact@nliautaud.fr>
|
||||||
* @license http://opensource.org/licenses/MIT The MIT License
|
* @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
|
class PicoPagesImages extends AbstractPicoPlugin
|
||||||
{
|
{
|
||||||
@ -16,7 +17,7 @@ class PicoPagesImages extends AbstractPicoPlugin
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Register path relative to content without index and extension
|
* 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
|
* Triggered after Pico has discovered the content file to serve
|
||||||
*
|
*
|
||||||
@ -36,29 +37,33 @@ class PicoPagesImages extends AbstractPicoPlugin
|
|||||||
}
|
}
|
||||||
$contentExt = $this->getConfig('content_ext');
|
$contentExt = $this->getConfig('content_ext');
|
||||||
$this->path = substr($file, $contentDirLength);
|
$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);
|
$this->path = rtrim($this->path, $contentExt);
|
||||||
if ($this->path) {
|
if ($this->path) {
|
||||||
$this->path .= '/';
|
$this->path .= '/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered after Pico has read its configuration
|
* Triggered after Pico has read its configuration.
|
||||||
*
|
*
|
||||||
* @see Pico::getConfig()
|
* @see Pico::getConfig()
|
||||||
|
*
|
||||||
* @param array &$config array of config variables
|
* @param array &$config array of config variables
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function onConfigLoaded(array &$config)
|
public function onConfigLoaded(array &$config)
|
||||||
{
|
{
|
||||||
if (!empty($config['images_path'])) {
|
if (!empty($config['images_path'])) {
|
||||||
$this->root = rtrim($config['images_path'], '/') . '/';
|
$this->root = rtrim($config['images_path'], '/').'/';
|
||||||
} else {
|
} else {
|
||||||
$this->root = 'images/';
|
$this->root = 'images/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered before Pico renders the page
|
* Triggered before Pico renders the page.
|
||||||
*
|
*
|
||||||
* @see DummyPlugin::onPageRendered()
|
* @see DummyPlugin::onPageRendered()
|
||||||
*
|
*
|
||||||
@ -72,6 +77,7 @@ class PicoPagesImages extends AbstractPicoPlugin
|
|||||||
// Create images array
|
// Create images array
|
||||||
$twigVariables['images'] = $this->getImages();
|
$twigVariables['images'] = $this->getImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the list and infos of images in the current directory.
|
* Return the list and infos of images in the current directory.
|
||||||
*
|
*
|
||||||
@ -79,46 +85,47 @@ class PicoPagesImages extends AbstractPicoPlugin
|
|||||||
*/
|
*/
|
||||||
private function getImages()
|
private function getImages()
|
||||||
{
|
{
|
||||||
$images_path = $this->root . $this->path;
|
$images_path = $this->root.$this->path;
|
||||||
// Filter images path for extra slashes
|
// 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]}';
|
$pattern = '*.{[jJ][pP][gG],[jJ][pP][eE][gG],[pP][nN][gG],[gG][iI][fF]}';
|
||||||
$images = glob($images_path . $pattern, GLOB_BRACE);
|
$images = glob($images_path.$pattern, GLOB_BRACE);
|
||||||
$meta = array();
|
$meta = [];
|
||||||
|
|
||||||
if (!is_array($images)) {
|
if (!is_array($images)) {
|
||||||
return array();
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($images as $path) {
|
foreach ($images as $path) {
|
||||||
$imagesize = getimagesize($path);
|
$imagesize = getimagesize($path);
|
||||||
if (!is_array($imagesize)) {
|
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
|
// Find meta files for images if they exist
|
||||||
$metapath = $path . '.meta.yml';
|
$metapath = $path.'.meta.yml';
|
||||||
if (is_file($metapath)) {
|
if (is_file($metapath)) {
|
||||||
$yamlparser = $this->getPico()->getYamlParser();
|
$yamlparser = $this->getPico()->getYamlParser();
|
||||||
$meta = $yamlparser->parse(file_get_contents($metapath));
|
$meta = $yamlparser->parse(file_get_contents($metapath));
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[] = array (
|
$data[] = [
|
||||||
'url' => $this->getBaseUrl() . $images_path . pathinfo($path, PATHINFO_BASENAME),
|
'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,
|
'path' => $images_path,
|
||||||
'name' => pathinfo($path, PATHINFO_FILENAME),
|
'name' => pathinfo($path, PATHINFO_FILENAME),
|
||||||
'ext' => pathinfo($path, PATHINFO_EXTENSION),
|
'ext' => pathinfo($path, PATHINFO_EXTENSION),
|
||||||
'width' => $width,
|
'width' => $width,
|
||||||
'height' => $height,
|
'height' => $height,
|
||||||
'size' => $size,
|
'size' => $size,
|
||||||
'meta' => $meta
|
'meta' => $meta,
|
||||||
);
|
];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user