update to kirby 4.8
This commit is contained in:
commit
7d7df341d1
636 changed files with 139949 additions and 0 deletions
0
site/accounts/index.html
Normal file
0
site/accounts/index.html
Normal file
12
site/blueprints/blocks/collapsable-section.yml
Normal file
12
site/blueprints/blocks/collapsable-section.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
title: Section dépliable
|
||||
icon: angle-down
|
||||
fields:
|
||||
title:
|
||||
type: text
|
||||
blocks:
|
||||
label: Contenu
|
||||
type: blocks
|
||||
fieldsets:
|
||||
- text
|
||||
- image
|
||||
- quote
|
||||
18
site/blueprints/blocks/text.yml
Normal file
18
site/blueprints/blocks/text.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
name: field.blocks.text.name
|
||||
icon: text
|
||||
wysiwyg: true
|
||||
preview: text
|
||||
fields:
|
||||
text:
|
||||
type: writer
|
||||
# nodes: true
|
||||
marks:
|
||||
- callout
|
||||
- link
|
||||
nodes:
|
||||
- heading
|
||||
headings:
|
||||
- 2
|
||||
- 3
|
||||
- 4
|
||||
placeholder: field.blocks.text.placeholder
|
||||
17
site/blueprints/blocks/tmp-text.yml
Normal file
17
site/blueprints/blocks/tmp-text.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
name: field.blocks.text.name
|
||||
icon: text
|
||||
wysiwyg: true
|
||||
preview: text
|
||||
fields:
|
||||
text:
|
||||
type: textarea
|
||||
nodes: false
|
||||
placeholder: field.blocks.text.placeholder
|
||||
buttons:
|
||||
- note
|
||||
- headlines
|
||||
- bold
|
||||
- italic
|
||||
- link
|
||||
- email
|
||||
- ul
|
||||
16
site/blueprints/fields/body.yml
Normal file
16
site/blueprints/fields/body.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
label: Texte
|
||||
type: layout
|
||||
layouts:
|
||||
- "1/1"
|
||||
- "1/2, 1/2"
|
||||
- "1/3, 2/3"
|
||||
- "2/3, 1/3"
|
||||
- "1/4, 3/4"
|
||||
- "3/4, 1/4"
|
||||
fieldsets:
|
||||
- text
|
||||
- image
|
||||
- quote
|
||||
- markdown
|
||||
- line
|
||||
- collapsable-section
|
||||
21
site/blueprints/pages/default.yml
Normal file
21
site/blueprints/pages/default.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
title: Default Page
|
||||
|
||||
columns:
|
||||
main:
|
||||
width: 2/3
|
||||
sections:
|
||||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
text:
|
||||
type: textarea
|
||||
size: huge
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
pages:
|
||||
type: pages
|
||||
template: default
|
||||
files:
|
||||
type: files
|
||||
|
||||
24
site/blueprints/pages/page.yml
Normal file
24
site/blueprints/pages/page.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
title: Page
|
||||
|
||||
tabs:
|
||||
content:
|
||||
label: Contenu
|
||||
columns:
|
||||
- width: 1/4
|
||||
sections:
|
||||
pages:
|
||||
type: pages
|
||||
template: subpage
|
||||
image: false
|
||||
files:
|
||||
headline: Fichiers
|
||||
type: files
|
||||
help: Supprimez les fichiers inutilisés pour ne pas encombrer inutilement le serveur.
|
||||
- width: 3/4
|
||||
fields:
|
||||
body: fields/body
|
||||
|
||||
seo:
|
||||
label: SEO
|
||||
sections:
|
||||
seoSection: sections/seo
|
||||
11
site/blueprints/pages/subpage.yml
Normal file
11
site/blueprints/pages/subpage.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
title: Sous-page
|
||||
columns:
|
||||
- width: 1/4
|
||||
sections:
|
||||
files:
|
||||
headline: Fichiers
|
||||
type: files
|
||||
help: Supprimez les fichiers inutilisés pour ne pas encombrer inutilement le serveur.
|
||||
- width: 3/4
|
||||
fields:
|
||||
body: fields/body
|
||||
26
site/blueprints/sections/seo.yml
Normal file
26
site/blueprints/sections/seo.yml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
type: fields
|
||||
fields:
|
||||
seoTitle:
|
||||
label: Titre SEO
|
||||
type: text
|
||||
icon: headline
|
||||
help: Permet de fournir aux moteurs de recherche un titre différent de celui affiché sur la page.
|
||||
width: 1/2
|
||||
description:
|
||||
label: Meta description
|
||||
type: text
|
||||
icon: text
|
||||
maxlength: 155
|
||||
help: Utilisée par les moteurs de recherche. Sur mobile, les moteurs n'affichent que 120 caractères, 155 sur ordinateur.
|
||||
width: 1/2
|
||||
author:
|
||||
label: Auteur(s)·rice(s)
|
||||
type: text
|
||||
icon: user
|
||||
width: 1/2
|
||||
published:
|
||||
label: Date de publication
|
||||
type: date
|
||||
display: DD/MM/YYYY
|
||||
default: today
|
||||
width: 1/2
|
||||
71
site/blueprints/site.yml
Normal file
71
site/blueprints/site.yml
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
title: Site
|
||||
|
||||
tabs:
|
||||
content:
|
||||
label: Contenu
|
||||
columns:
|
||||
- width: 1/4
|
||||
sections:
|
||||
backupButtonSection:
|
||||
type: fields
|
||||
fields:
|
||||
backupButton:
|
||||
type: backup-content-button
|
||||
help: Télécharge le contenu du site sous la forme d'une archive (.zip)
|
||||
pages:
|
||||
type: pages
|
||||
template: page
|
||||
image: false
|
||||
files:
|
||||
headline: Fichiers
|
||||
type: files
|
||||
help: Supprimez les fichiers inutilisés pour ne pas encombrer inutilement le serveur.
|
||||
- width: 3/4
|
||||
fields:
|
||||
body: fields/body
|
||||
seo:
|
||||
label: SEO
|
||||
fields:
|
||||
seoTitle:
|
||||
label: Titre SEO
|
||||
type: text
|
||||
icon: headline
|
||||
help: Permet de fournir aux moteurs de recherche un titre différent de celui affiché sur la page.
|
||||
width: 1/3
|
||||
description:
|
||||
type: textarea
|
||||
buttons: false
|
||||
maxlength: 155
|
||||
help: Utilisée par les moteurs de recherche. Sur mobile, les moteurs n'affichent que 120 caractères, 155 sur ordinateur.
|
||||
width: 2/3
|
||||
cover:
|
||||
label: Image de couverture
|
||||
type: files
|
||||
multiple: false
|
||||
width: 1/2
|
||||
help: Utilisée lorsque le site est partagé sur les réseaux sociaux. Taille recommandée = 1024 × 576px
|
||||
author:
|
||||
label: Auteur(s)·rice(s)
|
||||
type: text
|
||||
icon: user
|
||||
width: 1/2
|
||||
twitter:
|
||||
type: text
|
||||
icon: twitter
|
||||
width: 1/4
|
||||
before: @
|
||||
facebook:
|
||||
type: text
|
||||
icon: facebook
|
||||
width: 1/4
|
||||
before: @
|
||||
instagram:
|
||||
type: text
|
||||
icon: instagram
|
||||
width: 1/4
|
||||
before: @
|
||||
mastodon:
|
||||
type: text
|
||||
icon: mastodon
|
||||
width: 1/4
|
||||
before: @
|
||||
0
site/cache/index.html
vendored
Normal file
0
site/cache/index.html
vendored
Normal file
67
site/config/config.php
Normal file
67
site/config/config.php
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
return [
|
||||
'routes' => [
|
||||
[
|
||||
'pattern' => 'sitemap.xml',
|
||||
'action' => function() {
|
||||
$pages = site()->pages()->index();
|
||||
|
||||
$ignore = kirby()->option('sitemap.ignore', ['error']);
|
||||
|
||||
$content = snippet('sitemap', compact('pages', 'ignore'), true);
|
||||
|
||||
return new Kirby\Cms\Response($content, 'application/xml');
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => 'sitemap',
|
||||
'action' => function() {
|
||||
return go('sitemap.xml', 301);
|
||||
}
|
||||
]
|
||||
],
|
||||
'sitemap.ignore' => ['error'],
|
||||
'debug' => true,
|
||||
'api' => [
|
||||
'basicAuth' => true
|
||||
],
|
||||
'markdown' => [
|
||||
'extra' => true,
|
||||
],
|
||||
'thumbs' => [
|
||||
'srcsets' => [
|
||||
'default' => [
|
||||
'500w' => ['width' => 500, 'quality' => 80],
|
||||
'800w' => ['width' => 800, 'quality' => 80],
|
||||
'1024w' => ['width' => 1024, 'quality' => 80],
|
||||
'1440w' => ['width' => 1440, 'quality' => 80],
|
||||
'2048w' => ['width' => 2048, 'quality' => 80]
|
||||
]
|
||||
]
|
||||
],
|
||||
'kirbytext' => [
|
||||
'image' => [
|
||||
'width' => 800,
|
||||
]
|
||||
],
|
||||
'hooks' => [
|
||||
'page.update:after' => function($newPage) {
|
||||
$contentSize = $newPage->contentSize();
|
||||
|
||||
$newPage->update([
|
||||
'size' => $contentSize
|
||||
]);
|
||||
},
|
||||
'site.update:after' => function($newSite) {
|
||||
$contentSize = 0;
|
||||
$contentSize = $newSite->homePage()->contentSize();
|
||||
|
||||
$newSite->homePage()->update([
|
||||
'size' => $contentSize
|
||||
]);
|
||||
}
|
||||
],
|
||||
'panel' => [
|
||||
'css' => 'assets/css/custom-panel.css'
|
||||
]
|
||||
];
|
||||
20
site/plugins/backup-content-button/.editorconfig
Normal file
20
site/plugins/backup-content-button/.editorconfig
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.php]
|
||||
indent_size = 4
|
||||
|
||||
[*.md,*.txt]
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
|
||||
[composer.json]
|
||||
indent_size = 4
|
||||
11
site/plugins/backup-content-button/.gitattributes
vendored
Normal file
11
site/plugins/backup-content-button/.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Note: You need to uncomment the lines you want to use; the other lines can be deleted
|
||||
|
||||
# Git
|
||||
# .gitattributes export-ignore
|
||||
# .gitignore export-ignore
|
||||
|
||||
# Tests
|
||||
# /.coveralls.yml export-ignore
|
||||
# /.travis.yml export-ignore
|
||||
# /phpunit.xml.dist export-ignore
|
||||
# /tests/ export-ignore
|
||||
14
site/plugins/backup-content-button/.gitignore
vendored
Normal file
14
site/plugins/backup-content-button/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# OS files
|
||||
.DS_Store
|
||||
|
||||
# npm modules
|
||||
/node_modules
|
||||
|
||||
# Parcel cache folder
|
||||
.cache
|
||||
|
||||
# Composer files
|
||||
/vendor
|
||||
|
||||
# kirbyup temp development entry
|
||||
/index.dev.mjs
|
||||
21
site/plugins/backup-content-button/LICENSE.md
Normal file
21
site/plugins/backup-content-button/LICENSE.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) <Year> <Your Name>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
117
site/plugins/backup-content-button/README.md
Normal file
117
site/plugins/backup-content-button/README.md
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
# Kirby Pluginkit: Example plugin for Kirby
|
||||
|
||||
> Variant "Panel plugin setup"
|
||||
|
||||
This is a boilerplate for a Kirby Panel plugin that can be installed via all three [supported installation methods](https://getkirby.com/docs/guide/plugins/plugin-setup-basic#the-three-plugin-installation-methods).
|
||||
|
||||
You can find a list of Pluginkit variants on the [`master` branch](https://github.com/getkirby/pluginkit/tree/master).
|
||||
|
||||
****
|
||||
|
||||
## How to use the Pluginkit
|
||||
|
||||
1. Fork this repository
|
||||
2. Change the plugin name and description in the `composer.json`
|
||||
3. Change the plugin name in the `index.php` and `src/index.js`
|
||||
4. Change the license if you don't want to publish under MIT
|
||||
5. Add your plugin code to the `index.php` and `src/index.js`
|
||||
6. Update this `README` with instructions for your plugin
|
||||
|
||||
### Install the development and build setup
|
||||
|
||||
We use [kirbyup](https://github.com/johannschopplich/kirbyup) for the development and build setup.
|
||||
|
||||
You can start developing directly. kirbyup will be fetched remotely with your first `npm run` command, which may take a short amount of time.
|
||||
|
||||
### Development
|
||||
|
||||
You can start the dev process with:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
This will automatically update the `index.js` and `index.css` of your plugin as soon as you make changes.
|
||||
Reload the Panel to see your code changes reflected.
|
||||
|
||||
With kirbyup 2.0.0+ and Kirby 3.7.4+ you can alternatively use hot module reloading (HMR):
|
||||
|
||||
```bash
|
||||
npm run serve
|
||||
```
|
||||
|
||||
This will start a development server that updates the page as soon as you make changes. Some updates are instant, like CSS or Vue template changes, others require a reload of the page, which happens automatically.
|
||||
|
||||
> [!NOTE]
|
||||
> The live reload functionality requires top level await, [which is only supported in modern browsers](https://caniuse.com/mdn-javascript_operators_await_top_level). If you're developing in older browsers, use `npm run dev` and reload the page manually to see changes.
|
||||
|
||||
### Production
|
||||
|
||||
As soon as you are happy with your plugin, you should build the final version with:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
This will automatically create a minified and optimized version of your `index.js` and `index.css`
|
||||
which you can ship with your plugin.
|
||||
|
||||
We have a tutorial on how to build your own plugin based on the Pluginkit [in the Kirby documentation](https://getkirby.com/docs/guide/plugins/plugin-setup-basic).
|
||||
|
||||
### Build reproducibility
|
||||
|
||||
While kirbyup will stay backwards compatible, exact build reproducibility may be of importance to you. If so, we recommend to target a specific package version, rather than using npx:
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"dev": "kirbyup src/index.js --watch",
|
||||
"build": "kirbyup src/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"kirbyup": "^3.1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
What follows is an example README for your plugin.
|
||||
|
||||
****
|
||||
|
||||
## Installation
|
||||
|
||||
### Download
|
||||
|
||||
Download and copy this repository to `/site/plugins/{{ plugin-name }}`.
|
||||
|
||||
### Git submodule
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/{{ your-name }}/{{ plugin-name }}.git site/plugins/{{ plugin-name }}
|
||||
```
|
||||
|
||||
### Composer
|
||||
|
||||
```bash
|
||||
composer require {{ your-name }}/{{ plugin-name }}
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
*Additional instructions on how to configure the plugin (e.g. blueprint setup, config options, etc.)*
|
||||
|
||||
## Options
|
||||
|
||||
*Document the options and APIs that this plugin offers*
|
||||
|
||||
## Development
|
||||
|
||||
*Add instructions on how to help working on the plugin (e.g. npm setup, Composer dev dependencies, etc.)*
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
## Credits
|
||||
|
||||
- [Your Name](https://github.com/ghost)
|
||||
18
site/plugins/backup-content-button/SECURITY.md
Normal file
18
site/plugins/backup-content-button/SECURITY.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
*Use this section to tell people about which versions of your project are currently being supported with security updates.*
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 5.1.x | :white_check_mark: |
|
||||
| 5.0.x | :x: |
|
||||
| 4.0.x | :white_check_mark: |
|
||||
| < 4.0 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
*Use this section to tell people how to report a vulnerability.*
|
||||
|
||||
*Tell them where to go, how often they can expect to get an update on a reported vulnerability, what to expect if the vulnerability is accepted or declined, etc.*
|
||||
21
site/plugins/backup-content-button/composer.json
Normal file
21
site/plugins/backup-content-button/composer.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "getkirby/pluginkit",
|
||||
"description": "Kirby Example Plugin",
|
||||
"license": "MIT",
|
||||
"type": "kirby-plugin",
|
||||
"version": "1.0.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Your Name",
|
||||
"email": "you@example.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"getkirby/composer-installer": "^1.1"
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"getkirby/composer-installer": true
|
||||
}
|
||||
}
|
||||
}
|
||||
66
site/plugins/backup-content-button/composer.lock
generated
Normal file
66
site/plugins/backup-content-button/composer.lock
generated
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "37a8e61308b9b6f49cb9835f477f0c64",
|
||||
"packages": [
|
||||
{
|
||||
"name": "getkirby/composer-installer",
|
||||
"version": "1.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/getkirby/composer-installer.git",
|
||||
"reference": "c98ece30bfba45be7ce457e1102d1b169d922f3d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/getkirby/composer-installer/zipball/c98ece30bfba45be7ce457e1102d1b169d922f3d",
|
||||
"reference": "c98ece30bfba45be7ce457e1102d1b169d922f3d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "^1.0 || ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "^1.8 || ^2.0"
|
||||
},
|
||||
"type": "composer-plugin",
|
||||
"extra": {
|
||||
"class": "Kirby\\ComposerInstaller\\Plugin"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Kirby\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Kirby's custom Composer installer for the Kirby CMS and for Kirby plugins",
|
||||
"homepage": "https://getkirby.com",
|
||||
"support": {
|
||||
"issues": "https://github.com/getkirby/composer-installer/issues",
|
||||
"source": "https://github.com/getkirby/composer-installer/tree/1.2.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://getkirby.com/buy",
|
||||
"type": "custom"
|
||||
}
|
||||
],
|
||||
"time": "2020-12-28T12:54:39+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
0
site/plugins/backup-content-button/index.css
Normal file
0
site/plugins/backup-content-button/index.css
Normal file
1
site/plugins/backup-content-button/index.js
Normal file
1
site/plugins/backup-content-button/index.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
(function(){"use strict";function u(c,e,s,n,i,r,a,o){var t=typeof c=="function"?c.options:c;return t.render=e,t.staticRenderFns=s,t._compiled=!0,{exports:c,options:t}}const _={__name:"BackupContentButton",setup(c){async function e(){const n=s(),i={method:"POST",body:JSON.stringify({fileName:n})},a=await(await fetch("/zip-content.json",i)).json();if(console.log(a),a.status==="success"){console.log("test");const o=document.createElement("a");o.href="/"+n;const t=document.querySelector("head");t.appendChild(o),o.click(),t.removeChild(o),setTimeout(()=>{location.href=location.href},500)}}function s(){const n=new Date,i=n.getDate(),r=n.getMonth(),a=n.getYear(),o=n.getHours(),t=n.getMinutes(),m=n.getSeconds();return`decarbone_content_backup-${i}_${r}_${a}__${o}h${t}min${m}.zip`}return{__sfc:!0,zipContent:e,getFileName:s}}};var d=function(){var e=this,s=e._self._c,n=e._self._setupProxy;return s("k-button",{attrs:{variant:"filled",icon:"download"},on:{click:n.zipContent}},[e._v("Backup")])},l=[],p=u(_,d,l);const f=p.exports;window.panel.plugin("adrienpayet/backup-content-button",{fields:{"backup-content-button":f}})})();
|
||||
10
site/plugins/backup-content-button/index.php
Normal file
10
site/plugins/backup-content-button/index.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
Kirby::plugin('adrienpayet/backup-content-button', [
|
||||
'fields' => [
|
||||
'backup-content-button' => [],
|
||||
],
|
||||
'routes' => [
|
||||
require_once __DIR__ . '/src/routes/zip-content.php',
|
||||
],
|
||||
]);
|
||||
7
site/plugins/backup-content-button/package.json
Normal file
7
site/plugins/backup-content-button/package.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"scripts": {
|
||||
"dev": "npx -y kirbyup src/index.js --watch",
|
||||
"serve": "npx -y kirbyup serve src/index.js",
|
||||
"build": "npx -y kirbyup src/index.js"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<template>
|
||||
<k-button variant="filled" icon="download" @click="zipContent"
|
||||
>Backup</k-button
|
||||
>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
async function zipContent() {
|
||||
const fileName = getFileName();
|
||||
|
||||
const init = {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
fileName,
|
||||
}),
|
||||
};
|
||||
|
||||
const response = await fetch("/zip-content.json", init);
|
||||
const json = await response.json();
|
||||
console.log(json);
|
||||
|
||||
if (json.status === "success") {
|
||||
console.log("test");
|
||||
const aTag = document.createElement("a");
|
||||
aTag.href = "/" + fileName;
|
||||
const headTag = document.querySelector("head");
|
||||
headTag.appendChild(aTag);
|
||||
aTag.click();
|
||||
headTag.removeChild(aTag);
|
||||
setTimeout(() => {
|
||||
location.href = location.href;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
function getFileName() {
|
||||
const now = new Date();
|
||||
const date = now.getDate();
|
||||
const month = now.getMonth();
|
||||
const year = now.getYear();
|
||||
const hour = now.getHours();
|
||||
const mins = now.getMinutes();
|
||||
const secs = now.getSeconds();
|
||||
|
||||
return `decarbone_content_backup-${date}_${month}_${year}__${hour}h${mins}min${secs}.zip`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/** Put your CSS here **/
|
||||
</style>
|
||||
7
site/plugins/backup-content-button/src/index.js
Normal file
7
site/plugins/backup-content-button/src/index.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import BackupContentButton from "./components/BackupContentButton.vue";
|
||||
|
||||
window.panel.plugin("adrienpayet/backup-content-button", {
|
||||
fields: {
|
||||
"backup-content-button": BackupContentButton,
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'pattern' => '/zip-content.json',
|
||||
'method' => 'POST',
|
||||
'action' => function () {
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json);
|
||||
|
||||
// Get real path for our folder
|
||||
$inputDirPath = realpath(__DIR__ . '/../../../../../content');
|
||||
$outputFilePath = __DIR__ . '/../../../../../content/' . $data->fileName;
|
||||
|
||||
try {
|
||||
createZip($inputDirPath, $outputFilePath);
|
||||
return json_encode([
|
||||
'status' => 'success',
|
||||
'message' => 'Archive' . $data->fileName . ' created',
|
||||
]);
|
||||
} catch (\Throwable $th) {
|
||||
return json_encode([
|
||||
'status' => 'error',
|
||||
'message' => 'Can\'t create archive.',
|
||||
'details' => $th->getMessage() . ' in ' . $th->getFile() . ' line ' . $th->getLine(),
|
||||
]);
|
||||
}
|
||||
},
|
||||
];
|
||||
36
site/plugins/content-size/index.php
Normal file
36
site/plugins/content-size/index.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
Kirby::plugin('adrienpayet/content-size', [
|
||||
'pageMethods' => [
|
||||
'contentSize' => function () {
|
||||
$contentSize = 0;
|
||||
$site = site();
|
||||
$html = $this->render();
|
||||
$dom = new DOMDocument();
|
||||
@$dom->loadHTML($html);
|
||||
|
||||
$xpath = new DOMXPath($dom);
|
||||
$currentDivs = $xpath->query('//div[contains(@class, "current")]');
|
||||
|
||||
if ($currentDivs->length > 0) {
|
||||
$content = $dom->saveHTML($currentDivs->item(0));
|
||||
$contentSize += strlen($content);
|
||||
} else {
|
||||
throw new Exception("No content div founded.", 1);
|
||||
}
|
||||
|
||||
$images = $dom->getElementsByTagName('img');
|
||||
foreach ($images as $image) {
|
||||
$src = $image->getAttribute('src');
|
||||
|
||||
if (!empty($src)) {
|
||||
$localSrc = str_replace($site->url(), realpath(__DIR__ . '/../../../'), $src);
|
||||
|
||||
$contentSize += filesize($localSrc);
|
||||
}
|
||||
}
|
||||
|
||||
return $contentSize;
|
||||
}
|
||||
]
|
||||
]);
|
||||
50
site/plugins/helpers/index.php
Normal file
50
site/plugins/helpers/index.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
function formatSize($bytes)
|
||||
{
|
||||
if ($bytes >= 1_000_000_000) {
|
||||
$bytes = number_format($bytes / 1_000_000_000, 2) . ' Go';
|
||||
} elseif ($bytes >= 1_000_000) {
|
||||
$bytes = number_format($bytes / 1_000_000, 1) . ' Mo';
|
||||
} elseif ($bytes >= 1_000) {
|
||||
$bytes = number_format($bytes / 1_000, 0) . ' Ko';
|
||||
} elseif ($bytes > 1) {
|
||||
$bytes = $bytes . ' octets';
|
||||
} elseif ($bytes == 1) {
|
||||
$bytes = $bytes . ' octet';
|
||||
} else {
|
||||
$bytes = '0 octets';
|
||||
}
|
||||
|
||||
return $bytes;
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/4914750/how-to-zip-a-whole-folder-using-php
|
||||
function createZip($inputDirPath, $outputFilePath)
|
||||
{
|
||||
// Initialize archive object
|
||||
$zip = new ZipArchive();
|
||||
$zip->open($outputFilePath, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
|
||||
// Create recursive directory iterator
|
||||
/** @var SplFileInfo[] $files */
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($inputDirPath),
|
||||
RecursiveIteratorIterator::LEAVES_ONLY
|
||||
);
|
||||
|
||||
foreach ($files as $file) {
|
||||
// Skip directories (they would be added automatically)
|
||||
if (!$file->isDir()) {
|
||||
// Get real and relative path for current file
|
||||
$filePath = $file->getRealPath();
|
||||
$relativePath = substr($filePath, strlen($inputDirPath) + 1);
|
||||
|
||||
// Add current file to archive
|
||||
$zip->addFile($filePath, $relativePath);
|
||||
}
|
||||
}
|
||||
|
||||
// Zip archive will be created only after closing object
|
||||
$zip->close();
|
||||
}
|
||||
3
site/plugins/kirby-writer-callout/index.css
Normal file
3
site/plugins/kirby-writer-callout/index.css
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.k-writer .ProseMirror .callout {
|
||||
font-size: 2.0625rem;
|
||||
}
|
||||
1
site/plugins/kirby-writer-callout/index.js
Normal file
1
site/plugins/kirby-writer-callout/index.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
(function(){"use strict";function i(e){const t=window.panel.plugins.thirdParty;if(t.__marksInitialized)return;const n=t.marks;if(!n)return;const s=e.component("k-writer");e.component("k-writer",{extends:s,methods:{createMarks(){const l=s.options.methods.createMarks.call(this).filter(({name:r})=>!Object.keys(n).includes(r)),c=Object.entries(n).reduce((r,[d,m])=>(r[d]=new m,r),{});return[...l,...this.filterExtensions(c,this.marks)]}}}),t.__marksInitialized=!0}class a{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class u extends a{constructor(t={}){super(t)}command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return null}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class o extends u{get button(){return{icon:"star",label:"Callout"}}commands(){return()=>this.toggle()}get name(){return"callout"}get schema(){return{parseDOM:[{tag:"span"}],toDOM:t=>["span",{...t.attrs,class:"callout"},0]}}}window.panel.plugin("adrienpayet/kirby-writer-callout",{use:[i],thirdParty:{marks:{...window.panel.plugins.thirdParty.marks||{},callout:o}}})})();
|
||||
9
site/plugins/kirby-writer-callout/index.php
Normal file
9
site/plugins/kirby-writer-callout/index.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Add `article-footnote` to Kirby's Sane class allowed tags, otherwise
|
||||
* the writer field content parsed by the sanitizer would strip it
|
||||
*/
|
||||
// \Kirby\Sane\Html::$allowedTags['article-footnote'] = true;
|
||||
|
||||
\Kirby\Cms\App::plugin('adrienpayet/kirby-writer-callout', []);
|
||||
69
site/plugins/process-links/index.php
Normal file
69
site/plugins/process-links/index.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
Kirby::plugin('adrienpayet/process-links', [
|
||||
'fieldMethods' => [
|
||||
'processLinks' => function ($field) {
|
||||
$dom = new DOMDocument();
|
||||
@$dom->loadHTML(mb_convert_encoding($field->value(), 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
$anchorTags = $dom->getElementsByTagName('a');
|
||||
$site = site();
|
||||
|
||||
for ($i = $anchorTags->length - 1; $i >= 0; $i--) {
|
||||
$anchorTag = $anchorTags->item($i);
|
||||
$href = $anchorTag->getAttribute('href');
|
||||
$getIdPattern = '/@\/page\/(.*)/';
|
||||
$regexResult = preg_match($getIdPattern, $href, $matches);
|
||||
$isInternalPageLink = $regexResult && isset($matches[1]);
|
||||
$isMailto = str_contains($href, 'mailto');
|
||||
$isNote = !str_contains($href, 'http');
|
||||
|
||||
if (!$isMailto) {
|
||||
if ($isInternalPageLink) {
|
||||
processInternalLink($anchorTag, $site, $matches[1]);
|
||||
} elseif ($isNote) {
|
||||
processNote($dom, $anchorTag, $href);
|
||||
} else {
|
||||
$anchorTag->setAttribute('target', '_blank');
|
||||
}
|
||||
}
|
||||
}
|
||||
return $dom->saveHTML();
|
||||
}
|
||||
]
|
||||
]);
|
||||
|
||||
function processInternalLink($anchorTag, $site, $targetId) {
|
||||
try {
|
||||
$targetPage = $site->find('page://' . $targetId);
|
||||
if (!$targetPage) {
|
||||
throw new Exception("No internal page found.");
|
||||
}
|
||||
$anchorTag->removeAttribute('target');
|
||||
$attributes = [
|
||||
'href' => $targetPage->url(),
|
||||
'class' => 'internal-link',
|
||||
'data-size' => formatSize($targetPage->size()->toInt())
|
||||
];
|
||||
foreach ($attributes as $key => $value) {
|
||||
$anchorTag->setAttribute($key, $value);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function processNote($dom, $anchorTag, $href) {
|
||||
$note = $dom->createElement('span');
|
||||
$note->setAttribute('class', 'note');
|
||||
$button = $dom->createElement('button');
|
||||
$text = new DOMText($anchorTag->nodeValue);
|
||||
$button->appendChild($text);
|
||||
$note->appendChild($button);
|
||||
$details = $dom->createElement('span');
|
||||
$details->setAttribute('class', 'details hide');
|
||||
$detailsText = new DOMText(' ' . urldecode($href));
|
||||
$details->appendChild($detailsText);
|
||||
$note->appendChild($details);
|
||||
$anchorTag->parentNode->replaceChild($note, $anchorTag);
|
||||
}
|
||||
|
||||
0
site/sessions/index.html
Normal file
0
site/sessions/index.html
Normal file
8
site/snippets/blocks/collapsable-section.php
Normal file
8
site/snippets/blocks/collapsable-section.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<section class="collapsable">
|
||||
<button class="collapsable__button">
|
||||
<h4><?= $block->title() ?></h4>
|
||||
</button>
|
||||
<div class="collapsable__content">
|
||||
<?= $block->blocks()->toBlocks() ?>
|
||||
</div>
|
||||
</section>
|
||||
41
site/snippets/blocks/image.php
Normal file
41
site/snippets/blocks/image.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
$alt = $block->alt();
|
||||
$caption = $block->caption();
|
||||
$crop = $block->crop()->isTrue();
|
||||
$link = $block->link();
|
||||
$ratio = $block->ratio()->or('auto');
|
||||
$src = null;
|
||||
$srcset = null;
|
||||
|
||||
if ($block->location() == 'web') {
|
||||
$src = $block->src()->esc();
|
||||
} elseif ($image = $block->image()->toFile()) {
|
||||
$alt = $alt->or($image->alt());
|
||||
$src = $image->url();
|
||||
$srcset = $image->srcset();
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if ($src): ?>
|
||||
<figure<?= Html::attr(['data-ratio' => $ratio, 'data-crop' => $crop], null, ' ') ?>>
|
||||
<?php if ($link->isNotEmpty()): ?>
|
||||
<a href="<?= Str::esc($link->toUrl()) ?>"
|
||||
<?= e(!str_contains($link->toUrl(), $site->url()), ' target="_blank"') ?>>
|
||||
<img src="<?= $src ?>"
|
||||
alt="<?= $alt->esc() ?>"
|
||||
srcset="<?= $srcset ?>">
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<img src="<?= $src ?>"
|
||||
alt="<?= $alt->esc() ?>"
|
||||
srcset="<?= $srcset ?>">
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($caption->isNotEmpty()): ?>
|
||||
<figcaption>
|
||||
<?= $caption ?>
|
||||
</figcaption>
|
||||
<?php endif ?>
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
1
site/snippets/blocks/markdown.php
Normal file
1
site/snippets/blocks/markdown.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?= $block->text()->kt()->processLinks();
|
||||
1
site/snippets/blocks/text.php
Normal file
1
site/snippets/blocks/text.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?= $block->text()->processLinks();
|
||||
3
site/snippets/footer.php
Normal file
3
site/snippets/footer.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
</main>
|
||||
</body>
|
||||
</html>
|
||||
26
site/snippets/header.php
Normal file
26
site/snippets/header.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="<?= url('assets') ?>/css/style.css">
|
||||
<?php snippet('meta') ?>
|
||||
<?php snippet('favicon') ?>
|
||||
<script>
|
||||
const csrf = "<?= csrf() ?>";
|
||||
const rootUrl = "<?= $site->url() ?>";
|
||||
</script>
|
||||
<script src="<?= url('assets') ?>/js/script.js" defer></script>
|
||||
<title><?= $site->title() ?> <?php e(!$page->isHomePage(), ' - ' . $page->title()) ?></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="cursor">
|
||||
<span id="target"></span>
|
||||
<span id="text"></span>
|
||||
</div>
|
||||
<?php if ($page->isHomePage()): ?>
|
||||
<div id="introduction">
|
||||
<h1><span class="hide">de<br class="mobile">carb</span><span class="hide">.<br class="mobile tablet"></span><span class="hide">one</span></h1>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<main>
|
||||
0
site/snippets/index.html
Normal file
0
site/snippets/index.html
Normal file
110
site/snippets/meta.php
Normal file
110
site/snippets/meta.php
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
$pageTitle = $page->seoTitle()->isNotEmpty() ? $page->seoTitle() : $page->title();
|
||||
$title = $page->isHomePage() ? $site->title() : $pageTitle . " | " . $site->title();
|
||||
$description = $page->isHomePage() ? $site->description() : $page->description();
|
||||
$siteCover = $site->cover()->isNotEmpty() ? $site->cover()->toFile()->url() : false;
|
||||
$pageCover = $page->coverThumb()->isNotEmpty() ? $page->coverThumb() : false;
|
||||
$image = $page->isHomePage() ? $siteCover : $pageCover;
|
||||
?>
|
||||
|
||||
<link rel="canonical" href="<?= $page->url() ?>">
|
||||
|
||||
<title><?= $title ?></title>
|
||||
<?php if ($description->isNotEmpty()): ?>
|
||||
<meta name="description" content="<?= $description ?>">
|
||||
<?php endif ?>
|
||||
<meta name="generator" content="Kirby (<?= Kirby::version() ?>)">
|
||||
|
||||
<!--========== TWITTER ==========-->
|
||||
<meta name="twitter:card" content="<?= $image ? "summary_large_image" : "summary" ?>">
|
||||
<meta name="twitter:title" content="<?= $title ?>">
|
||||
<?php if ($description->isNotEmpty()): ?>
|
||||
<meta name="twitter:description" content="<?= $description ?>">
|
||||
<?php endif ?>
|
||||
<?php if ($image): ?>
|
||||
<meta property="og:image" content="<?= $image ?>">
|
||||
<?php endif ?>
|
||||
<?php if ($site->twitter()->isNotEmpty()): ?>
|
||||
<meta name="twitter:site" content="@<?= $site->twitter() ?>">
|
||||
<?php endif ?>
|
||||
|
||||
<!--========== OG GRAPH ==========-->
|
||||
<meta property="og:title" content="<?= $title ?>">
|
||||
<meta property="og:site_name" content="<?= $site->title() ?>">
|
||||
<?php if ($description->isNotEmpty()): ?>
|
||||
<meta property="og:description" content="<?= $description ?>">
|
||||
<?php endif ?>
|
||||
<meta property="og:url" content="<?= $page->url() ?>">
|
||||
<meta property="og:type" content="<?= $page->isHomePage() ? "website" : "article" ?>">
|
||||
<?php if ($page->author()->isNotEmpty()): ?>
|
||||
<meta name="author" content="<?= $page->author() ?>">
|
||||
<meta property="article:author" content="<?= $page->author() ?>">
|
||||
<?php endif ?>
|
||||
<?php if ($page->published()->isNotEmpty()): ?>
|
||||
<meta name="date" content="<?= $page->published() ?>" scheme="YYYY-MM-DD">
|
||||
<meta property="article:published_time" content="<?= $page->published() ?>">
|
||||
<?php endif ?>
|
||||
<?php if ($page->tag()->isNotEmpty()): ?>
|
||||
<meta property="article:tag" content="<?= $page->tag() ?>">
|
||||
<?php endif ?>
|
||||
<?php if ($image): ?>
|
||||
<meta property="twitter:image" content="<?= $image ?>">
|
||||
<?php endif ?>
|
||||
|
||||
<!--========== SCHEMA ==========-->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [{
|
||||
"@type": "ListItem",
|
||||
"position": 1,
|
||||
"item": {
|
||||
"@id": "<?= $site->homePage()->url() ?>",
|
||||
"name": "<?= $site->title() ?>"
|
||||
}
|
||||
}<?php if (!$page->isHomePage() && $page->depth() === 1): ?>,
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 2,
|
||||
"item":
|
||||
{
|
||||
"@id": "<?= $page->url() ?>",
|
||||
"name": "<?= $page->title() ?>"
|
||||
}
|
||||
}<?php endif ?><?php if ($page->depth() === 2): ?>,
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 2,
|
||||
"item":
|
||||
{
|
||||
"@id": "<?= $page->parent()->url() ?>",
|
||||
"name": "<?= $page->parent()->title() ?>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 3,
|
||||
"item":
|
||||
{
|
||||
"@id": "<?= $page->url() ?>",
|
||||
"name": "<?= $page->title() ?>"
|
||||
}
|
||||
}<?php endif ?>
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<?php if (!$page->isHomePage()): ?>
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
"name": "<?= $page->title() ?>"<?php if ($page->author()->isNotEmpty()): ?>,
|
||||
"author": "<?= $page->author() ?>"<?php endif ?><?php if ($page->created()->isNotEmpty()): ?>,
|
||||
"datePublished": "<?= $page->created() ?>"<?php endif ?><?php if ($page->created()->toDate('d/m/Y') !== $page->modified('d/m/Y')): ?>,
|
||||
"dateModified": "<?= $page->modified() ?>"<?php endif ?><?php if ($page->description()->isNotEmpty()): ?>,
|
||||
"headline": "<?= $page->description() ?>"<?php endif ?><?php if ($image): ?>,
|
||||
"image": "<?= $image ?>"<?php endif ?>
|
||||
}
|
||||
</script>
|
||||
<?php endif ?>
|
||||
11
site/snippets/sitemap.php
Normal file
11
site/snippets/sitemap.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?= '<?xml version="1.0" encoding="utf-8"?>'; ?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<?php foreach ($pages as $p): ?>
|
||||
<?php if (in_array($p->uri(), $ignore)) continue ?>
|
||||
<url>
|
||||
<loc><?= html($p->url()) ?></loc>
|
||||
<lastmod><?= $p->modified('c', 'date') ?></lastmod>
|
||||
<priority><?= ($p->isHomePage()) ? 1 : number_format(0.5 / $p->depth(), 1) ?></priority>
|
||||
</url>
|
||||
<?php endforeach ?>
|
||||
</urlset>
|
||||
1
site/templates/default.php
Normal file
1
site/templates/default.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<h1><?= $page->title() ?></h1>
|
||||
24
site/templates/home.php
Normal file
24
site/templates/home.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php snippet('header') ?>
|
||||
<div id="first-level" class="layer current home">
|
||||
<a href="<?= $site->homePage()->url() ?>" class="layer-btn unvisible internal-link" title="retourner à l'accueil" data-size="Accueil">Accueil</a>
|
||||
<div class="content-background">
|
||||
<h2 id="logo">decarb.one</h2>
|
||||
<?php foreach ($site->body()->toLayouts() as $layout): ?>
|
||||
<section class="row" id="<?= $layout->id() ?>">
|
||||
<?php foreach ($layout->columns() as $column): ?>
|
||||
<div class="column" style="--span:<?= $column->span() ?>">
|
||||
<div class="blocks">
|
||||
<?php foreach($column->blocks() as $block): ?>
|
||||
<?= $block ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</section>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="second-level" class="layer out-screen">
|
||||
</div>
|
||||
<div id="third-level" class="layer out-screen"></div>
|
||||
<?php snippet('footer') ?>
|
||||
27
site/templates/page.php
Normal file
27
site/templates/page.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php snippet('header') ?>
|
||||
<div id="first-level" class="layer home" data-title="<?= $site->title() ?>">
|
||||
<a href="<?= $site->homePage()->url() ?>" class="layer-btn internal-link" title="retourner à l'accueil" data-size="Accueil">Accueil</a>
|
||||
</div>
|
||||
|
||||
<div id="second-level" class="layer current">
|
||||
<div class="empty"></div>
|
||||
<a href="<?= $page->url() ?>" class="layer-btn unvisible internal-link" title="aller à la page <?= $page->title() ?>" data-size="<?= $page->title() ?>"><?= $page->title() ?></a>
|
||||
<div class="content-background">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
<?php foreach ($page->body()->toLayouts() as $layout): ?>
|
||||
<section class="row" id="<?= $layout->id() ?>">
|
||||
<?php foreach ($layout->columns() as $column): ?>
|
||||
<div class="column" style="--span:<?= $column->span() ?>">
|
||||
<div class="blocks">
|
||||
<?php foreach($column->blocks() as $block): ?>
|
||||
<?= $block ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</section>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="third-level" class="layer out-screen"></div>
|
||||
<?php snippet('footer') ?>
|
||||
30
site/templates/subpage.php
Normal file
30
site/templates/subpage.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php snippet('header') ?>
|
||||
<div id="first-level" class="layer home">
|
||||
<a href="<?= $site->homePage()->url() ?>" class="layer-btn internal-link" data-size="Accueil">Accueil</a>
|
||||
</div>
|
||||
<div id="second-level" class="layer">
|
||||
<div class="empty"></div>
|
||||
<a href="<?= $page->parent()->url() ?>" class="layer-btn internal-link" data-size="<?= $page->parent()->title() ?>"><?= $page->parent()->title() ?></a>
|
||||
</div>
|
||||
<div id="third-level" class="layer current">
|
||||
<div class="empty"></div>
|
||||
<div class="empty"></div>
|
||||
<div class="content-background">
|
||||
<div class="empty"></div>
|
||||
<h1><?= $page->title() ?></h1>
|
||||
<?php foreach ($page->body()->toLayouts() as $layout): ?>
|
||||
<section class="row" id="<?= $layout->id() ?>">
|
||||
<?php foreach ($layout->columns() as $column): ?>
|
||||
<div class="column" style="--span:<?= $column->span() ?>">
|
||||
<div class="blocks">
|
||||
<?php foreach($column->blocks() as $block): ?>
|
||||
<?= $block ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</section>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php snippet('footer') ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue