first version
This commit is contained in:
37
site/blueprints/files/image.yml
Normal file
37
site/blueprints/files/image.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
title: Image
|
||||
|
||||
columns:
|
||||
- width: 1/2
|
||||
sections:
|
||||
content:
|
||||
type: fields
|
||||
fields:
|
||||
caption:
|
||||
label: Caption
|
||||
type: textarea
|
||||
size: medium
|
||||
- width: 1/2
|
||||
sections:
|
||||
meta:
|
||||
type: fields
|
||||
fields:
|
||||
alt:
|
||||
label: Alternative Text
|
||||
type: text
|
||||
photographer:
|
||||
label: Photogapher
|
||||
type: text
|
||||
width: 2/3
|
||||
license:
|
||||
label: License
|
||||
type: select
|
||||
width: 1/3
|
||||
options:
|
||||
- Unsplash
|
||||
- CC BY 4.0
|
||||
- CC BY-SA 4.0
|
||||
- CC BY-NC 4.0
|
||||
- CC BY-ND 4.0
|
||||
link:
|
||||
label: Link
|
||||
type: url
|
43
site/blueprints/pages/about.yml
Normal file
43
site/blueprints/pages/about.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
title: About us
|
||||
|
||||
icon: ☎️
|
||||
|
||||
status:
|
||||
draft: true
|
||||
listed: true
|
||||
|
||||
options:
|
||||
url: false
|
||||
delete: false
|
||||
|
||||
columns:
|
||||
- width: 1/2
|
||||
fields:
|
||||
text:
|
||||
label: Text
|
||||
type: textarea
|
||||
size: huge
|
||||
|
||||
- width: 1/2
|
||||
fields:
|
||||
address:
|
||||
label: Address
|
||||
type: textarea
|
||||
email:
|
||||
label: Email
|
||||
type: email
|
||||
phone:
|
||||
label: Phone
|
||||
type: tel
|
||||
social:
|
||||
label: On the web
|
||||
type: structure
|
||||
fields:
|
||||
platform:
|
||||
label: Platform
|
||||
type: text
|
||||
width: 1/2
|
||||
url:
|
||||
label: URL
|
||||
type: url
|
||||
width: 1/2
|
32
site/blueprints/pages/album.yml
Normal file
32
site/blueprints/pages/album.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
title: Album
|
||||
|
||||
icon: 🖼
|
||||
|
||||
status:
|
||||
draft: true
|
||||
listed: true
|
||||
|
||||
columns:
|
||||
- width: 2/3
|
||||
sections:
|
||||
images:
|
||||
type: files
|
||||
layout: cards
|
||||
template: image
|
||||
info: "{{ file.dimensions }}"
|
||||
image:
|
||||
ratio: 5/4
|
||||
cover: true
|
||||
min: 1
|
||||
size: small
|
||||
|
||||
- width: 1/3
|
||||
fields:
|
||||
cover:
|
||||
type: files
|
||||
multiple: false
|
||||
headline:
|
||||
type: text
|
||||
description:
|
||||
type: textarea
|
||||
tags: true
|
21
site/blueprints/pages/default.yml
Normal file
21
site/blueprints/pages/default.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
title: Simple Page
|
||||
preset: page
|
||||
|
||||
icon: 📝
|
||||
|
||||
status:
|
||||
draft: true
|
||||
unlisted:
|
||||
label: Hidden Page
|
||||
text: The page is not listed in the main menu
|
||||
listed:
|
||||
label: Menu Page
|
||||
text: The page is listed in the main menu
|
||||
|
||||
pages:
|
||||
template: default
|
||||
|
||||
fields:
|
||||
text:
|
||||
type: textarea
|
||||
size: huge
|
4
site/blueprints/pages/error.yml
Normal file
4
site/blueprints/pages/error.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
title: Error
|
||||
|
||||
options:
|
||||
read: false
|
19
site/blueprints/pages/home.yml
Normal file
19
site/blueprints/pages/home.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
title: Home
|
||||
|
||||
icon: 🏠
|
||||
|
||||
options:
|
||||
status: false
|
||||
|
||||
sections:
|
||||
info:
|
||||
headline: Info
|
||||
type: info
|
||||
text: All content for the homepage is being pulled from the photography page.
|
||||
|
||||
photography:
|
||||
headline: Photography
|
||||
extends: sections/albums
|
||||
status: listed
|
||||
|
||||
|
43
site/blueprints/pages/note.yml
Executable file
43
site/blueprints/pages/note.yml
Executable file
@@ -0,0 +1,43 @@
|
||||
title: Note
|
||||
num: date
|
||||
icon: 📖
|
||||
|
||||
status:
|
||||
draft:
|
||||
label: Draft
|
||||
text: The note is still in draft mode. It can only be seen by editors with panel access.
|
||||
unlisted:
|
||||
label: In Review
|
||||
text: The note is online and can be visited with the direct URL. The team must still give the final go to publish it.
|
||||
listed:
|
||||
label: Published
|
||||
text: The note is online and listed in the blog
|
||||
|
||||
columns:
|
||||
- width: 2/3
|
||||
fields:
|
||||
text:
|
||||
type: textarea
|
||||
size: large
|
||||
|
||||
- width: 1/3
|
||||
sections:
|
||||
meta:
|
||||
type: fields
|
||||
fields:
|
||||
date:
|
||||
type: date
|
||||
time: true
|
||||
default: now
|
||||
author:
|
||||
type: users
|
||||
tags: true
|
||||
gallery:
|
||||
type: pages
|
||||
query: site.find("photography").children
|
||||
multiple: false
|
||||
info: "{{ page.images.count }} image(s)"
|
||||
empty: "No gallery selected"
|
||||
image:
|
||||
cover: true
|
||||
help: Place the {{ gallery }} tag anywhere in your text to add the selected gallery
|
21
site/blueprints/pages/notes.yml
Normal file
21
site/blueprints/pages/notes.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
title: Photos
|
||||
|
||||
columns:
|
||||
- width: 1/2
|
||||
sections:
|
||||
drafts:
|
||||
extends: sections/notes
|
||||
headline: Drafts
|
||||
status: draft
|
||||
|
||||
unlisted:
|
||||
extends: sections/notes
|
||||
headline: In Review
|
||||
status: unlisted
|
||||
|
||||
- width: 1/2
|
||||
sections:
|
||||
listed:
|
||||
extends: sections/notes
|
||||
headline: Published
|
||||
status: listed
|
12
site/blueprints/pages/photography.yml
Normal file
12
site/blueprints/pages/photography.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
title: Photos
|
||||
|
||||
sections:
|
||||
drafts:
|
||||
extends: sections/albums
|
||||
headline: Drafts
|
||||
status: draft
|
||||
|
||||
listed:
|
||||
extends: sections/albums
|
||||
headline: Published Albums
|
||||
status: listed
|
21
site/blueprints/pages/sandbox.yml
Normal file
21
site/blueprints/pages/sandbox.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
title: Sandbox
|
||||
preset: page
|
||||
|
||||
|
||||
num: zero
|
||||
|
||||
pages:
|
||||
template: sandbox
|
||||
|
||||
fields:
|
||||
headline:
|
||||
type: text
|
||||
test:
|
||||
type: structure
|
||||
translate: false
|
||||
fields:
|
||||
itemimage:
|
||||
label: Image
|
||||
type: files
|
||||
max: 1
|
||||
parent: site.find('photography').children.first
|
12
site/blueprints/sections/albums.yml
Normal file
12
site/blueprints/sections/albums.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
type: pages
|
||||
headline: Photography
|
||||
parent: site.find("photography")
|
||||
size: tiny
|
||||
info: "{{ page.images.count }} image(s)"
|
||||
layout: cards
|
||||
template: album
|
||||
empty: No albums yet
|
||||
image:
|
||||
query: page.cover
|
||||
cover: true
|
||||
ratio: 5/4
|
7
site/blueprints/sections/notes.yml
Normal file
7
site/blueprints/sections/notes.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
type: pages
|
||||
headline: Notes
|
||||
parent: site.find("notes")
|
||||
info: "{{ page.date.toDate('d.m.Y') }}"
|
||||
template: note
|
||||
empty: No notes yet
|
||||
sortBy: date desc
|
16
site/blueprints/site.yml
Normal file
16
site/blueprints/site.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
title: Site
|
||||
|
||||
columns:
|
||||
- width: 1/2
|
||||
sections:
|
||||
albums: sections/albums
|
||||
- width: 1/2
|
||||
sections:
|
||||
notes: sections/notes
|
||||
pages:
|
||||
type: pages
|
||||
create: default
|
||||
template:
|
||||
- about
|
||||
- home
|
||||
- default
|
35
site/blueprints/users/default.yml
Normal file
35
site/blueprints/users/default.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
title: User
|
||||
|
||||
columns:
|
||||
- width: 1/2
|
||||
fields:
|
||||
street:
|
||||
label: Street
|
||||
type: text
|
||||
zip:
|
||||
label: ZIP
|
||||
type: text
|
||||
width: 1/4
|
||||
city:
|
||||
label: City
|
||||
type: text
|
||||
width: 3/4
|
||||
country:
|
||||
label: Country
|
||||
type: text
|
||||
|
||||
- width: 1/2
|
||||
fields:
|
||||
website:
|
||||
label: Website
|
||||
type: url
|
||||
twitter:
|
||||
label: Twitter
|
||||
type: text
|
||||
icon: twitter
|
||||
placeholder: @username
|
||||
instagram:
|
||||
label: Instagram
|
||||
type: text
|
||||
icon: instagram
|
||||
placeholder: username
|
0
site/cache/index.html
vendored
Normal file
0
site/cache/index.html
vendored
Normal file
5
site/config/config.php
Executable file
5
site/config/config.php
Executable file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'debug' => true,
|
||||
];
|
11
site/controllers/album.php
Executable file
11
site/controllers/album.php
Executable file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return function ($page) {
|
||||
|
||||
$gallery = $page->images()->sortBy("sort");
|
||||
|
||||
return [
|
||||
'gallery' => $gallery
|
||||
];
|
||||
|
||||
};
|
9
site/models/album.php
Executable file
9
site/models/album.php
Executable file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
class AlbumPage extends Page
|
||||
{
|
||||
public function cover()
|
||||
{
|
||||
return $this->content()->get('cover')->toFile() ?? $this->image();
|
||||
}
|
||||
}
|
16
site/plugins/gallery/index.php
Executable file
16
site/plugins/gallery/index.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
Kirby::plugin('starterkit/gallery', [
|
||||
'hooks' => [
|
||||
'kirbytags:after' => function ($text, $data, $options) {
|
||||
|
||||
if ($page = $data['parent']->gallery()->toPage()) {
|
||||
$gallery = snippet('gallery', ['gallery' => $page], true);
|
||||
} else {
|
||||
$gallery = '';
|
||||
}
|
||||
|
||||
return str_replace('{{ gallery }}', $gallery, $text);
|
||||
}
|
||||
]
|
||||
]);
|
0
site/sessions/index.html
Normal file
0
site/sessions/index.html
Normal file
16
site/snippets/footer.php
Executable file
16
site/snippets/footer.php
Executable file
@@ -0,0 +1,16 @@
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<a href="<?= url() ?>">© <?= date('Y') ?> / <?= $site->title() ?></a>
|
||||
|
||||
<?php if ($about = page('about')): ?>
|
||||
<nav class="social">
|
||||
<?php foreach ($about->social()->toStructure() as $social): ?>
|
||||
<a href="<?= $social->url() ?>"><?= $social->platform() ?></a>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
9
site/snippets/gallery.php
Executable file
9
site/snippets/gallery.php
Executable file
@@ -0,0 +1,9 @@
|
||||
<section class="gallery">
|
||||
<?php foreach ($gallery->images() as $image): ?>
|
||||
<figure>
|
||||
<a href="<?= $image->link()->or($image->url()) ?>">
|
||||
<?= $image->crop(600, 800) ?>
|
||||
</a>
|
||||
</figure>
|
||||
<?php endforeach ?>
|
||||
</section>
|
25
site/snippets/header.php
Executable file
25
site/snippets/header.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
|
||||
<title><?= $site->title() ?> | <?= $page->title() ?></title>
|
||||
|
||||
<?= css(['assets/css/index.css', '@auto']) ?>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page">
|
||||
<header class="header">
|
||||
<a class="logo" href="<?= $site->url() ?>"><?= $site->title() ?></a>
|
||||
|
||||
<nav id="menu" class="menu">
|
||||
<?php foreach ($site->children()->listed() as $item): ?>
|
||||
<?= $item->title()->link() ?>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
</header>
|
||||
|
3
site/snippets/intro.php
Executable file
3
site/snippets/intro.php
Executable file
@@ -0,0 +1,3 @@
|
||||
<header class="intro">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
</header>
|
51
site/templates/about.php
Executable file
51
site/templates/about.php
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<main>
|
||||
<header class="intro">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
</header>
|
||||
|
||||
<div class="layout">
|
||||
|
||||
<aside>
|
||||
<section>
|
||||
<h2>Address</h2>
|
||||
<div class="text">
|
||||
<?= $page->address()->kt() ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Email</h2>
|
||||
<div class="text">
|
||||
<?= html::email($page->email()) ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Phone</h2>
|
||||
<div class="text">
|
||||
<?= html::tel($page->phone()) ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>On the web</h2>
|
||||
<div class="text">
|
||||
<ul>
|
||||
<?php foreach ($page->social()->toStructure() as $social): ?>
|
||||
<li><?= html::a($social->url(), $social->platform()) ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</aside>
|
||||
|
||||
<div class="text">
|
||||
<?= $page->text()->kt() ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
39
site/templates/album.php
Executable file
39
site/templates/album.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<main class="album">
|
||||
<article>
|
||||
|
||||
<header>
|
||||
<?php if ($cover = $page->cover()): ?>
|
||||
<figure class="album-cover">
|
||||
<?= $cover->crop(1024, 768) ?>
|
||||
<figcaption>
|
||||
<h1><?= $page->headline()->or($page->title()) ?></h1>
|
||||
</figcaption>
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
</header>
|
||||
|
||||
<div class="album-text text">
|
||||
<?= $page->description()->kt() ?>
|
||||
|
||||
<?php if ($page->tags()->isNotEmpty()): ?>
|
||||
<p class="album-tags tags"><?= $page->tags() ?></p>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<ul class="album-gallery"<?= attr(['data-even' => $gallery->isEven(), 'data-count' => $gallery->count()], ' ') ?>>
|
||||
<?php foreach ($gallery as $image): ?>
|
||||
<li>
|
||||
<figure>
|
||||
<a href="<?= $image->link()->or($image->url()) ?>">
|
||||
<?= $image->crop(800, 1000) ?>
|
||||
</a>
|
||||
</figure>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
12
site/templates/default.php
Executable file
12
site/templates/default.php
Executable file
@@ -0,0 +1,12 @@
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<main>
|
||||
<header class="intro">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
</header>
|
||||
<div class="text">
|
||||
<?= $page->text()->kt() ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
29
site/templates/home.php
Executable file
29
site/templates/home.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<main>
|
||||
<header class="intro">
|
||||
<h1><?= $site->title() ?></h1>
|
||||
</header>
|
||||
|
||||
<ul class="grid">
|
||||
<?php foreach (page('photography')->children()->listed() as $album): ?>
|
||||
<li>
|
||||
<a href="<?= $album->url() ?>">
|
||||
<figure>
|
||||
<?php if ($cover = $album->cover()): ?>
|
||||
<?= $cover->resize(1024, 1024) ?>
|
||||
<?php endif ?>
|
||||
<figcaption>
|
||||
<span>
|
||||
<span class="example-name"><?= $album->title() ?></span>
|
||||
</span>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
19
site/templates/note.php
Executable file
19
site/templates/note.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<main>
|
||||
<article class="note">
|
||||
<header class="note-header intro">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
<time class="note-date"><?= $page->date()->toDate('d F Y') ?></time>
|
||||
<?php if ($page->tags()->isNotEmpty()) : ?>
|
||||
<p class="note-tags tags"><?= $page->tags() ?></p>
|
||||
<?php endif ?>
|
||||
</header>
|
||||
|
||||
<div class="note-text text">
|
||||
<?= $page->text()->kt() ?>
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
23
site/templates/notes.php
Executable file
23
site/templates/notes.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<main>
|
||||
<header class="intro">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
</header>
|
||||
|
||||
<div class="notes">
|
||||
<?php foreach ($page->children()->listed()->sortBy('date', 'desc') as $note): ?>
|
||||
<article class="note">
|
||||
<header class="note-header">
|
||||
<a href="<?= $note->url() ?>">
|
||||
<h2><?= $note->title() ?></h2>
|
||||
<time><?= $note->date()->toDate('d F Y') ?></time>
|
||||
</a>
|
||||
</header>
|
||||
</article>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
24
site/templates/photography.php
Executable file
24
site/templates/photography.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<main>
|
||||
<header class="intro">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
</header>
|
||||
|
||||
<ul class="albums"<?= attr(['data-even' => $page->children()->listed()->isEven()], ' ') ?>>
|
||||
<?php foreach ($page->children()->listed() as $album): ?>
|
||||
<li>
|
||||
<a href="<?= $album->url() ?>">
|
||||
<figure>
|
||||
<?php if ($cover = $album->cover()): ?>
|
||||
<?= $cover->crop(800, 1000) ?>
|
||||
<?php endif ?>
|
||||
<figcaption><?= $album->title() ?></figcaption>
|
||||
</figure>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</main>
|
||||
|
||||
<?php snippet('footer') ?>
|
Reference in New Issue
Block a user