Squashed: add image processing shortcode

This commit is contained in:
Robert Kaussow 2019-01-27 15:49:25 +01:00
parent b699d3bd3f
commit be8621c0c0
6 changed files with 94 additions and 15 deletions

View File

@ -1,20 +1,44 @@
pipeline:
build:
---
kind: pipeline
name: default
steps:
- name: build
image: node
commands:
- npm install -g gulp
- npm install
- npm install -g gulp -s
- npm install -s
- gulp
when:
event: push
update:
- name: update
image: appleboy/drone-git-push
branch: master
remote: gitea@gitea.rknet.org:xoxys/theme-geeklab.git
commit: true
commit-message: "[SKIP CI] update artifacts"
force: false
secrets: [git_push_ssh_key]
settings:
branch: master
remote: gitea@gitea.rknet.org:xoxys/theme-geeklab.git
commit: true
commit_message: "[SKIP CI] Update artifacts"
force: false
author_name: DroneShipper
author_email: shipper@rknet.org
environment:
GIT_PUSH_SSH_KEY:
from_secret: git_push_ssh_key
when:
event: push
- name: notify
image: plugins/matrix
settings:
homeserver: https://matrix.rknet.org
roomid: MtidqQXWWAtQcByBhH:rknet.org
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
username:
from_secret: matrix_username
password:
from_secret: matrix_password
when:
status:
- success
- failure

View File

@ -1,2 +1 @@
# theme-geeklab

View File

@ -0,0 +1,25 @@
{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
{{ $command := strings.ToLower (printf "%s" (.Get 1)) }}
{{ $options := .Get 2 }}
{{ if eq $command "fit"}}
{{ .Scratch.Set "image" ($original.Fit $options) }}
{{ else if eq $command "resize"}}
{{ .Scratch.Set "image" ($original.Resize $options) }}
{{ else if eq $command "fill"}}
{{ .Scratch.Set "image" ($original.Fill $options) }}
{{ else }}
{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize. Is: %s" ($command)}}
{{ end }}
{{ $image := .Scratch.Get "image" }}
<figure class="post-figure">
<a href="{{ $original.RelPermalink }}">
<img class="post-figure__img" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
</a>
<figcaption class="post-figure__caption">
<small>
{{ with not .Inner }}
{{ $original.Title }}
{{ end }}
</small>
</figcaption>
</figure>

View File

@ -205,7 +205,6 @@ html{
.post-content blockquote {
font-size: 1.1em;
margin:40px auto;
font-family:Open Sans;
font-style:italic;
color: #555555;
padding:0.2em 30px 0.2em 55px;
@ -250,6 +249,24 @@ html{
margin: 10px auto;
}
.post-figure {
padding: 0.25rem;
margin: 2rem 0;
background-color: #dcdfe3
}
.post-figure__img {
max-width: 100%;
height: auto;
}
.post-figure__caption {
font-size: 1.1em;
padding: 2px 0;
font-style:italic;
color: #555555;
}
/************************
Global Blog Footer
*************************/

View File

@ -194,7 +194,6 @@ html {
.post-content blockquote {
font-size: 1.1em;
margin: 40px auto;
font-family: Open Sans;
font-style: italic;
color: #555;
padding: .2em 30px .2em 55px;
@ -233,6 +232,21 @@ html {
.post-content li {
margin: 10px auto
}
.post-figure {
padding: .25rem;
margin: 2rem 0;
background-color: #dcdfe3
}
.post-figure__img {
max-width: 100%;
height: auto
}
.post-figure__caption {
font-size: 1.1em;
padding: 2px 0;
font-style: italic;
color: #555
}
.site-footer {
width: 100%;
background: #2f333e;

File diff suppressed because one or more lines are too long