From abff2cba9ba6117ff00d6a017b7a88058fea16a0 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Mon, 24 Nov 2025 18:33:54 +0100 Subject: [PATCH 01/15] style d'impression --- assets/css/panel.css | 10 +++--- assets/css/src/generic.css | 3 ++ assets/css/src/print.css | 69 +++++++++++++++++++++++++++++++------- site/templates/linear.php | 4 +++ 4 files changed, 68 insertions(+), 18 deletions(-) diff --git a/assets/css/panel.css b/assets/css/panel.css index 33ce206..3b53cbb 100644 --- a/assets/css/panel.css +++ b/assets/css/panel.css @@ -1,12 +1,12 @@ .k-panel-menu { - background-color: var(--color-primary); + background-color: #000; } .k-panel-menu * { - color: var(--color-background); + color: #fff; } .k-panel-menu-button[aria-current] * { - color: var(--color-primary); + color: #000; } .k-panel[data-template="year"] .k-list-items .k-item:first-child { @@ -20,6 +20,6 @@ border-radius: var(--rounded-md) var(--rounded-md) 0 0; transform: translateY(0.3rem); - background-color: var(--color-primary); - color: var(--color-background); + background-color: #000; + color: #fff; } diff --git a/assets/css/src/generic.css b/assets/css/src/generic.css index 99508e2..bd94abc 100644 --- a/assets/css/src/generic.css +++ b/assets/css/src/generic.css @@ -138,5 +138,8 @@ button.less::after { width: 100%; margin-top: calc(var(--unit--vertical) / 2); } +.only-print{ + display: none; +} diff --git a/assets/css/src/print.css b/assets/css/src/print.css index 25c61bc..c608b47 100644 --- a/assets/css/src/print.css +++ b/assets/css/src/print.css @@ -1,8 +1,18 @@ @media print { /* Hide header / footer infos. */ + * { + -webkit-print-color-adjust: exact; + print-color-adjust: exact; + } + @page { - margin: 0; + /*variable pas supporter dans les marges...*/ + /* + --unit--horizontal: 2.5vw; + --unit--vertical: 1.7rem; + */ + margin: 2.5vw 1.7rem; size: auto; @top-left { @@ -25,38 +35,58 @@ content: none; } } + .only-print{ + display: block; + } - .panel, nav { - display: none; + .panel, nav, .main-edito-btn, .theme-toggler, .page-cover .links, + [data-template="home"] .title-wrapper button.open-nav, #nav-overlay{ + display: none !important; } /* regle du light mode dupliqué*/ :root { - --color-background: #ffffff; - --color-primary: #000; + --color-background: #ffffff !important; + --color-primary: #000 !important; --color-secondary-rgb: 140, 140, 140; --font-weight-light: 240; + + --unit--vertical: 2cm; } body { - padding-top: 4rem; background-image: none; background-color: var(--color-background) !important; } - + #main-header { + position: relative; + page-break-after: always; + padding-top: 0; + } .minimized #inactuel{ transform: none !important; margin: 0 !important; } + #logo *{ + font-size: 27.3vw; + } #logo h1{ display: grid; grid-template-columns: 100%; grid-template-rows: auto; } + #logo span{ + padding: 0; + } #logo #actuel, #logo #inactuel{ grid-column: 1; grid-row: 1; } + [data-theme="light"] #logo #actuel, [data-theme="dark"] #logo #actuel, + [data-theme="light"] #logo #inactuel, [data-theme="dark"] #logo #inactuel{ + mix-blend-mode: normal; + } + #logo #actuel { font-weight: 550; color: rgb(254, 250, 254) !important; @@ -66,16 +96,19 @@ #logo #inactuel { z-index: 0; } + .page-cover{ + padding-top: 0; + position: absolute; + bottom: 0; + left: 0; + height: auto; + page-break-after: always; + } .main-title.fs-xxl { font-size: 7rem !important; line-height: 1 !important; } - - #main-header { - position: relative; - } - #entry-btns { display: none; } @@ -85,7 +118,17 @@ } article #main-content { - width: 60%; + /* width: 60%; */ margin: auto; } + main { + padding-left: 0; + } + /* .url{ + position: absolute; + transform: rotate(90deg); + transform-origin: top left; + bottom: 0; + right: 0; + } */ } diff --git a/site/templates/linear.php b/site/templates/linear.php index beab9b3..cd94c5e 100644 --- a/site/templates/linear.php +++ b/site/templates/linear.php @@ -20,6 +20,10 @@ / category() ?>

+

+ imprimé le format('d/m/Y'); ?>
+ url() ?> +

From d365abfdb9e6033ce690482d981f45292b62ad6d Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Thu, 27 Nov 2025 14:17:05 +0100 Subject: [PATCH 02/15] initialisation of the plugin web2print --- site/plugins/your-plugin/.editorconfig | 20 +++ site/plugins/your-plugin/.gitattributes | 11 ++ site/plugins/your-plugin/.gitignore | 14 +++ site/plugins/your-plugin/LICENSE.md | 21 ++++ site/plugins/your-plugin/README.md | 117 ++++++++++++++++++ site/plugins/your-plugin/SECURITY.md | 18 +++ site/plugins/your-plugin/composer.json | 21 ++++ site/plugins/your-plugin/composer.lock | 66 ++++++++++ site/plugins/your-plugin/index.css | 2 + site/plugins/your-plugin/index.js | 40 ++++++ site/plugins/your-plugin/index.php | 7 ++ site/plugins/your-plugin/package.json | 12 ++ .../src/components/DemoSection.vue | 17 +++ site/plugins/your-plugin/src/index.js | 7 ++ 14 files changed, 373 insertions(+) create mode 100644 site/plugins/your-plugin/.editorconfig create mode 100644 site/plugins/your-plugin/.gitattributes create mode 100644 site/plugins/your-plugin/.gitignore create mode 100644 site/plugins/your-plugin/LICENSE.md create mode 100644 site/plugins/your-plugin/README.md create mode 100644 site/plugins/your-plugin/SECURITY.md create mode 100644 site/plugins/your-plugin/composer.json create mode 100644 site/plugins/your-plugin/composer.lock create mode 100644 site/plugins/your-plugin/index.css create mode 100644 site/plugins/your-plugin/index.js create mode 100644 site/plugins/your-plugin/index.php create mode 100644 site/plugins/your-plugin/package.json create mode 100644 site/plugins/your-plugin/src/components/DemoSection.vue create mode 100644 site/plugins/your-plugin/src/index.js diff --git a/site/plugins/your-plugin/.editorconfig b/site/plugins/your-plugin/.editorconfig new file mode 100644 index 0000000..3b762c9 --- /dev/null +++ b/site/plugins/your-plugin/.editorconfig @@ -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 diff --git a/site/plugins/your-plugin/.gitattributes b/site/plugins/your-plugin/.gitattributes new file mode 100644 index 0000000..033ba13 --- /dev/null +++ b/site/plugins/your-plugin/.gitattributes @@ -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 diff --git a/site/plugins/your-plugin/.gitignore b/site/plugins/your-plugin/.gitignore new file mode 100644 index 0000000..4d81cf5 --- /dev/null +++ b/site/plugins/your-plugin/.gitignore @@ -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 diff --git a/site/plugins/your-plugin/LICENSE.md b/site/plugins/your-plugin/LICENSE.md new file mode 100644 index 0000000..8e663d7 --- /dev/null +++ b/site/plugins/your-plugin/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) + +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. diff --git a/site/plugins/your-plugin/README.md b/site/plugins/your-plugin/README.md new file mode 100644 index 0000000..ad2b202 --- /dev/null +++ b/site/plugins/your-plugin/README.md @@ -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) diff --git a/site/plugins/your-plugin/SECURITY.md b/site/plugins/your-plugin/SECURITY.md new file mode 100644 index 0000000..3726336 --- /dev/null +++ b/site/plugins/your-plugin/SECURITY.md @@ -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.* diff --git a/site/plugins/your-plugin/composer.json b/site/plugins/your-plugin/composer.json new file mode 100644 index 0000000..fa07b14 --- /dev/null +++ b/site/plugins/your-plugin/composer.json @@ -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 + } + } +} diff --git a/site/plugins/your-plugin/composer.lock b/site/plugins/your-plugin/composer.lock new file mode 100644 index 0000000..a5ae0fa --- /dev/null +++ b/site/plugins/your-plugin/composer.lock @@ -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" +} diff --git a/site/plugins/your-plugin/index.css b/site/plugins/your-plugin/index.css new file mode 100644 index 0000000..d9c4995 --- /dev/null +++ b/site/plugins/your-plugin/index.css @@ -0,0 +1,2 @@ + +/** Put your CSS here **/ diff --git a/site/plugins/your-plugin/index.js b/site/plugins/your-plugin/index.js new file mode 100644 index 0000000..89fa8b4 --- /dev/null +++ b/site/plugins/your-plugin/index.js @@ -0,0 +1,40 @@ +(function() { + "use strict"; + function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { + var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; + if (render) { + options.render = render; + options.staticRenderFns = staticRenderFns; + options._compiled = true; + } + return { + exports: scriptExports, + options + }; + } + const _sfc_main = { + // Put your section logic here + }; + var _sfc_render = function render() { + var _vm = this; + _vm._self._c; + return _vm._m(0); + }; + var _sfc_staticRenderFns = [function() { + var _vm = this, _c = _vm._self._c; + return _c("section", { staticClass: "k-demo-section" }, [_c("header", { staticClass: "k-section-header" }, [_c("h2", { staticClass: "k-headline" }, [_vm._v("Your custom section")])])]); + }]; + _sfc_render._withStripped = true; + var __component__ = /* @__PURE__ */ normalizeComponent( + _sfc_main, + _sfc_render, + _sfc_staticRenderFns + ); + __component__.options.__file = "C:/Users/anton/Desktop/studioVariable/actuelleInactuelle/actuel-inactuel/site/plugins/your-plugin/src/components/DemoSection.vue"; + const DemoSection = __component__.exports; + window.panel.plugin("getkirby/pluginkit", { + sections: { + demo: DemoSection + } + }); +})(); diff --git a/site/plugins/your-plugin/index.php b/site/plugins/your-plugin/index.php new file mode 100644 index 0000000..e4f92c0 --- /dev/null +++ b/site/plugins/your-plugin/index.php @@ -0,0 +1,7 @@ + [ + 'demo' => [] + ], +]); diff --git a/site/plugins/your-plugin/package.json b/site/plugins/your-plugin/package.json new file mode 100644 index 0000000..1913c34 --- /dev/null +++ b/site/plugins/your-plugin/package.json @@ -0,0 +1,12 @@ +{ + "name": "getkirby/pluginkit", + "description": "Kirby Example Plugin", + "license": "MIT", + "type": "kirby-plugin", + "version": "1.0.0", + "scripts": { + "dev": "npx -y kirbyup src/index.js --watch", + "serve": "npx -y kirbyup serve src/index.js", + "build": "npx -y kirbyup src/index.js" + } +} diff --git a/site/plugins/your-plugin/src/components/DemoSection.vue b/site/plugins/your-plugin/src/components/DemoSection.vue new file mode 100644 index 0000000..b8e211a --- /dev/null +++ b/site/plugins/your-plugin/src/components/DemoSection.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/site/plugins/your-plugin/src/index.js b/site/plugins/your-plugin/src/index.js new file mode 100644 index 0000000..1c6306a --- /dev/null +++ b/site/plugins/your-plugin/src/index.js @@ -0,0 +1,7 @@ +import DemoSection from "./components/DemoSection.vue"; + +window.panel.plugin("getkirby/pluginkit", { + sections: { + demo: DemoSection + } +}); From 7d3d20d006a5e77f28fe0264783c2aecda88d4ea Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Fri, 28 Nov 2025 14:40:57 +0100 Subject: [PATCH 03/15] fin du tuto, les vrais galere commence --- site/blueprints/pages/author.yml | 2 + site/plugins/your-plugin/index.js | 2 +- site/plugins/your-plugin/index.php | 17 ++++++- .../src/components/DemoSection.vue | 51 +++++++++++++++++-- site/plugins/your-plugin/src/index.js | 2 +- 5 files changed, 66 insertions(+), 8 deletions(-) diff --git a/site/blueprints/pages/author.yml b/site/blueprints/pages/author.yml index 7860b89..f17f9f2 100644 --- a/site/blueprints/pages/author.yml +++ b/site/blueprints/pages/author.yml @@ -8,6 +8,8 @@ tabs: presentationSection: type: fields fields: + demo: + type: demo presentation: extends: fields/body label: Présentation diff --git a/site/plugins/your-plugin/index.js b/site/plugins/your-plugin/index.js index 89fa8b4..8b85eda 100644 --- a/site/plugins/your-plugin/index.js +++ b/site/plugins/your-plugin/index.js @@ -22,7 +22,7 @@ }; var _sfc_staticRenderFns = [function() { var _vm = this, _c = _vm._self._c; - return _c("section", { staticClass: "k-demo-section" }, [_c("header", { staticClass: "k-section-header" }, [_c("h2", { staticClass: "k-headline" }, [_vm._v("Your custom section")])])]); + return _c("section", { staticClass: "k-demo-section" }, [_c("header", { staticClass: "k-section-header" }, [_c("h2", { staticClass: "k-headline" }, [_vm._v("Test")])])]); }]; _sfc_render._withStripped = true; var __component__ = /* @__PURE__ */ normalizeComponent( diff --git a/site/plugins/your-plugin/index.php b/site/plugins/your-plugin/index.php index e4f92c0..1be738a 100644 --- a/site/plugins/your-plugin/index.php +++ b/site/plugins/your-plugin/index.php @@ -1,7 +1,20 @@ [ - 'demo' => [] + 'fields' => [ + 'demo' => [ + 'props' => [ + 'value' => function ($value = null) { + $margins = Yaml::decode($value); + return [ + 'top' => 0, + 'right' => 0, + 'bottom' => 0, + 'left' => 0, + ...$margins + ]; + } + ] + ] ], ]); diff --git a/site/plugins/your-plugin/src/components/DemoSection.vue b/site/plugins/your-plugin/src/components/DemoSection.vue index b8e211a..02accdc 100644 --- a/site/plugins/your-plugin/src/components/DemoSection.vue +++ b/site/plugins/your-plugin/src/components/DemoSection.vue @@ -1,14 +1,57 @@ diff --git a/site/plugins/your-plugin/src/index.js b/site/plugins/your-plugin/src/index.js index 1c6306a..a0895ca 100644 --- a/site/plugins/your-plugin/src/index.js +++ b/site/plugins/your-plugin/src/index.js @@ -1,7 +1,7 @@ import DemoSection from "./components/DemoSection.vue"; window.panel.plugin("getkirby/pluginkit", { - sections: { + fields: { demo: DemoSection } }); From 3df6ff186f1c4bcb9e990b94fe4ea51f8e3a29da Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Fri, 28 Nov 2025 17:58:50 +0100 Subject: [PATCH 04/15] tout doit disparaitre --- site/blueprints/pages/author.yml | 10 ++- site/plugins/your-plugin/index.css | 2 - site/plugins/your-plugin/index.js | 41 +------------ site/plugins/your-plugin/index.php | 30 ++++----- .../src/components/DemoSection.vue | 60 ------------------ .../src/components/Web2printField.vue | 61 +++++++++++++++++++ site/plugins/your-plugin/src/index.js | 6 +- 7 files changed, 86 insertions(+), 124 deletions(-) delete mode 100644 site/plugins/your-plugin/src/components/DemoSection.vue create mode 100644 site/plugins/your-plugin/src/components/Web2printField.vue diff --git a/site/blueprints/pages/author.yml b/site/blueprints/pages/author.yml index f17f9f2..598ce96 100644 --- a/site/blueprints/pages/author.yml +++ b/site/blueprints/pages/author.yml @@ -8,8 +8,14 @@ tabs: presentationSection: type: fields fields: - demo: - type: demo + + web2printTest: + type: web2print + options: + - summary + - page-number + - cover + presentation: extends: fields/body label: Présentation diff --git a/site/plugins/your-plugin/index.css b/site/plugins/your-plugin/index.css index d9c4995..e69de29 100644 --- a/site/plugins/your-plugin/index.css +++ b/site/plugins/your-plugin/index.css @@ -1,2 +0,0 @@ - -/** Put your CSS here **/ diff --git a/site/plugins/your-plugin/index.js b/site/plugins/your-plugin/index.js index 8b85eda..a149249 100644 --- a/site/plugins/your-plugin/index.js +++ b/site/plugins/your-plugin/index.js @@ -1,40 +1 @@ -(function() { - "use strict"; - function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { - var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; - if (render) { - options.render = render; - options.staticRenderFns = staticRenderFns; - options._compiled = true; - } - return { - exports: scriptExports, - options - }; - } - const _sfc_main = { - // Put your section logic here - }; - var _sfc_render = function render() { - var _vm = this; - _vm._self._c; - return _vm._m(0); - }; - var _sfc_staticRenderFns = [function() { - var _vm = this, _c = _vm._self._c; - return _c("section", { staticClass: "k-demo-section" }, [_c("header", { staticClass: "k-section-header" }, [_c("h2", { staticClass: "k-headline" }, [_vm._v("Test")])])]); - }]; - _sfc_render._withStripped = true; - var __component__ = /* @__PURE__ */ normalizeComponent( - _sfc_main, - _sfc_render, - _sfc_staticRenderFns - ); - __component__.options.__file = "C:/Users/anton/Desktop/studioVariable/actuelleInactuelle/actuel-inactuel/site/plugins/your-plugin/src/components/DemoSection.vue"; - const DemoSection = __component__.exports; - window.panel.plugin("getkirby/pluginkit", { - sections: { - demo: DemoSection - } - }); -})(); +(function(){"use strict";function d(n,t,o,c,s,r,i,a){var e=typeof n=="function"?n.options:n;return t&&(e.render=t,e.staticRenderFns=o,e._compiled=!0),{exports:n,options:e}}const l={__name:"Web2PrintBtn",props:{htmlPageString:String},setup(n){const{htmlPageString:t}=n;async function o(){const r=await fetch("https://web2print.studio-variable.com",{method:"POST","Content-Type":"application/pdf","X-API-Key":"25377ab6e2153b159d1d5fa22501228810b6aec9d63346bd0614045dc167061c",body:{html:t}});if(r.ok){const i=await r.blob(),a=window.URL.createObjectURL(i),e=document.createElement("a");e.href=a,e.download="document.pdf",e.click()}else{const i=await r.json();console.error("Erreur:",i)}}return{__sfc:!0,getPdf:o}}};var u=function(){var t=this,o=t._self._c,c=t._self._setupProxy;return o("k-button",{attrs:{variant:"filled"},on:{click:function(s){return c.getPdf()}}},[t._v("Button")])},f=[],_=d(l,u,f);const p=_.exports;window.panel.plugin("studio-variable/web2print",{fields:{web2print:p}})})(); diff --git a/site/plugins/your-plugin/index.php b/site/plugins/your-plugin/index.php index 1be738a..2b8a31b 100644 --- a/site/plugins/your-plugin/index.php +++ b/site/plugins/your-plugin/index.php @@ -1,20 +1,16 @@ [ - 'demo' => [ - 'props' => [ - 'value' => function ($value = null) { - $margins = Yaml::decode($value); - return [ - 'top' => 0, - 'right' => 0, - 'bottom' => 0, - 'left' => 0, - ...$margins - ]; - } - ] - ] - ], +Kirby::plugin('studio-variable/web2print', [ + 'fields' => [ + 'web2print' => [ + 'props' => [ + 'options' => function ($options = []) { + return $options; + }, + 'value' => function ($value = []) { + return $value; + } + ], + ], + ], ]); diff --git a/site/plugins/your-plugin/src/components/DemoSection.vue b/site/plugins/your-plugin/src/components/DemoSection.vue deleted file mode 100644 index 02accdc..0000000 --- a/site/plugins/your-plugin/src/components/DemoSection.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/site/plugins/your-plugin/src/components/Web2printField.vue b/site/plugins/your-plugin/src/components/Web2printField.vue new file mode 100644 index 0000000..3d0d1af --- /dev/null +++ b/site/plugins/your-plugin/src/components/Web2printField.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/site/plugins/your-plugin/src/index.js b/site/plugins/your-plugin/src/index.js index a0895ca..288e91c 100644 --- a/site/plugins/your-plugin/src/index.js +++ b/site/plugins/your-plugin/src/index.js @@ -1,7 +1,7 @@ -import DemoSection from "./components/DemoSection.vue"; +import ToggleGroup from "./components/Web2printField.vue"; -window.panel.plugin("getkirby/pluginkit", { +window.panel.plugin("studio-variable/web2print", { fields: { - demo: DemoSection + web2print: ToggleGroup } }); From c0ec5f30ad43981d9d0faaadce7800db9dff0550 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Wed, 3 Dec 2025 14:09:48 +0100 Subject: [PATCH 05/15] test --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37636c1..59cab4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ image: node:latest - +#test stages: - build and deploy From 0c447209d95f5024a2cca6a7f5b58fd92ae5cc61 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Wed, 3 Dec 2025 14:49:24 +0100 Subject: [PATCH 06/15] supression your-plugin --- site/plugins/your-plugin/.editorconfig | 20 --- site/plugins/your-plugin/.gitattributes | 11 -- site/plugins/your-plugin/.gitignore | 14 --- site/plugins/your-plugin/LICENSE.md | 21 ---- site/plugins/your-plugin/README.md | 117 ------------------ site/plugins/your-plugin/SECURITY.md | 18 --- site/plugins/your-plugin/composer.json | 21 ---- site/plugins/your-plugin/composer.lock | 66 ---------- site/plugins/your-plugin/index.css | 0 site/plugins/your-plugin/index.js | 1 - site/plugins/your-plugin/index.php | 16 --- site/plugins/your-plugin/package.json | 12 -- .../src/components/Web2printField.vue | 61 --------- site/plugins/your-plugin/src/index.js | 7 -- 14 files changed, 385 deletions(-) delete mode 100644 site/plugins/your-plugin/.editorconfig delete mode 100644 site/plugins/your-plugin/.gitattributes delete mode 100644 site/plugins/your-plugin/.gitignore delete mode 100644 site/plugins/your-plugin/LICENSE.md delete mode 100644 site/plugins/your-plugin/README.md delete mode 100644 site/plugins/your-plugin/SECURITY.md delete mode 100644 site/plugins/your-plugin/composer.json delete mode 100644 site/plugins/your-plugin/composer.lock delete mode 100644 site/plugins/your-plugin/index.css delete mode 100644 site/plugins/your-plugin/index.js delete mode 100644 site/plugins/your-plugin/index.php delete mode 100644 site/plugins/your-plugin/package.json delete mode 100644 site/plugins/your-plugin/src/components/Web2printField.vue delete mode 100644 site/plugins/your-plugin/src/index.js diff --git a/site/plugins/your-plugin/.editorconfig b/site/plugins/your-plugin/.editorconfig deleted file mode 100644 index 3b762c9..0000000 --- a/site/plugins/your-plugin/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -# 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 diff --git a/site/plugins/your-plugin/.gitattributes b/site/plugins/your-plugin/.gitattributes deleted file mode 100644 index 033ba13..0000000 --- a/site/plugins/your-plugin/.gitattributes +++ /dev/null @@ -1,11 +0,0 @@ -# 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 diff --git a/site/plugins/your-plugin/.gitignore b/site/plugins/your-plugin/.gitignore deleted file mode 100644 index 4d81cf5..0000000 --- a/site/plugins/your-plugin/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# OS files -.DS_Store - -# npm modules -/node_modules - -# Parcel cache folder -.cache - -# Composer files -/vendor - -# kirbyup temp development entry -/index.dev.mjs diff --git a/site/plugins/your-plugin/LICENSE.md b/site/plugins/your-plugin/LICENSE.md deleted file mode 100644 index 8e663d7..0000000 --- a/site/plugins/your-plugin/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) - -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. diff --git a/site/plugins/your-plugin/README.md b/site/plugins/your-plugin/README.md deleted file mode 100644 index ad2b202..0000000 --- a/site/plugins/your-plugin/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# 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) diff --git a/site/plugins/your-plugin/SECURITY.md b/site/plugins/your-plugin/SECURITY.md deleted file mode 100644 index 3726336..0000000 --- a/site/plugins/your-plugin/SECURITY.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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.* diff --git a/site/plugins/your-plugin/composer.json b/site/plugins/your-plugin/composer.json deleted file mode 100644 index fa07b14..0000000 --- a/site/plugins/your-plugin/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "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 - } - } -} diff --git a/site/plugins/your-plugin/composer.lock b/site/plugins/your-plugin/composer.lock deleted file mode 100644 index a5ae0fa..0000000 --- a/site/plugins/your-plugin/composer.lock +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_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" -} diff --git a/site/plugins/your-plugin/index.css b/site/plugins/your-plugin/index.css deleted file mode 100644 index e69de29..0000000 diff --git a/site/plugins/your-plugin/index.js b/site/plugins/your-plugin/index.js deleted file mode 100644 index a149249..0000000 --- a/site/plugins/your-plugin/index.js +++ /dev/null @@ -1 +0,0 @@ -(function(){"use strict";function d(n,t,o,c,s,r,i,a){var e=typeof n=="function"?n.options:n;return t&&(e.render=t,e.staticRenderFns=o,e._compiled=!0),{exports:n,options:e}}const l={__name:"Web2PrintBtn",props:{htmlPageString:String},setup(n){const{htmlPageString:t}=n;async function o(){const r=await fetch("https://web2print.studio-variable.com",{method:"POST","Content-Type":"application/pdf","X-API-Key":"25377ab6e2153b159d1d5fa22501228810b6aec9d63346bd0614045dc167061c",body:{html:t}});if(r.ok){const i=await r.blob(),a=window.URL.createObjectURL(i),e=document.createElement("a");e.href=a,e.download="document.pdf",e.click()}else{const i=await r.json();console.error("Erreur:",i)}}return{__sfc:!0,getPdf:o}}};var u=function(){var t=this,o=t._self._c,c=t._self._setupProxy;return o("k-button",{attrs:{variant:"filled"},on:{click:function(s){return c.getPdf()}}},[t._v("Button")])},f=[],_=d(l,u,f);const p=_.exports;window.panel.plugin("studio-variable/web2print",{fields:{web2print:p}})})(); diff --git a/site/plugins/your-plugin/index.php b/site/plugins/your-plugin/index.php deleted file mode 100644 index 2b8a31b..0000000 --- a/site/plugins/your-plugin/index.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'web2print' => [ - 'props' => [ - 'options' => function ($options = []) { - return $options; - }, - 'value' => function ($value = []) { - return $value; - } - ], - ], - ], -]); diff --git a/site/plugins/your-plugin/package.json b/site/plugins/your-plugin/package.json deleted file mode 100644 index 1913c34..0000000 --- a/site/plugins/your-plugin/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "getkirby/pluginkit", - "description": "Kirby Example Plugin", - "license": "MIT", - "type": "kirby-plugin", - "version": "1.0.0", - "scripts": { - "dev": "npx -y kirbyup src/index.js --watch", - "serve": "npx -y kirbyup serve src/index.js", - "build": "npx -y kirbyup src/index.js" - } -} diff --git a/site/plugins/your-plugin/src/components/Web2printField.vue b/site/plugins/your-plugin/src/components/Web2printField.vue deleted file mode 100644 index 3d0d1af..0000000 --- a/site/plugins/your-plugin/src/components/Web2printField.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - diff --git a/site/plugins/your-plugin/src/index.js b/site/plugins/your-plugin/src/index.js deleted file mode 100644 index 288e91c..0000000 --- a/site/plugins/your-plugin/src/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import ToggleGroup from "./components/Web2printField.vue"; - -window.panel.plugin("studio-variable/web2print", { - fields: { - web2print: ToggleGroup - } -}); From fcf47818d0b64aec6751c4a1949807828c9e4c22 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Wed, 3 Dec 2025 16:08:25 +0100 Subject: [PATCH 07/15] =?UTF-8?q?Fixes=20#43=20-=20Standardisation=20des?= =?UTF-8?q?=20titres=20=20faite=20avec=20correction=20en=20h1=20de=20ce=20?= =?UTF-8?q?qui=20ne=20devait=20pas=20=C3=AAtre=20des=20h2=20et=20--font-si?= =?UTF-8?q?ze-xl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 2 +- assets/css/src/texts.css | 1 + site/templates/author.php | 2 +- site/templates/error.php | 4 +--- site/templates/grid.php | 8 +++++--- site/templates/home.php | 6 +++++- site/templates/info.php | 4 +--- site/templates/newsletter.php | 2 +- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59cab4a..37636c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ image: node:latest -#test + stages: - build and deploy diff --git a/assets/css/src/texts.css b/assets/css/src/texts.css index 6bdb636..b86f747 100644 --- a/assets/css/src/texts.css +++ b/assets/css/src/texts.css @@ -64,6 +64,7 @@ article h2 { box-sizing: border-box; font-weight: var(--font-weight-light); margin-bottom: var(--unit--vertical); + font-size: var(--font-size-xl); } .text__title { diff --git a/site/templates/author.php b/site/templates/author.php index d002cf9..d70a54a 100644 --- a/site/templates/author.php +++ b/site/templates/author.php @@ -4,7 +4,7 @@
-

title() ?>

+

title() ?>

presentation() ?> diff --git a/site/templates/error.php b/site/templates/error.php index b930d26..780ff03 100644 --- a/site/templates/error.php +++ b/site/templates/error.php @@ -3,9 +3,7 @@
true], slots: true) ?> -

- title() ?>

+

title() ?>

diff --git a/site/templates/grid.php b/site/templates/grid.php index 2f0a22a..efd8f5e 100644 --- a/site/templates/grid.php +++ b/site/templates/grid.php @@ -3,9 +3,7 @@
true], slots: true) ?> -

- title() ?>

+

title() ?>

par category() ?>

+

+ imprimé le format('d/m/Y'); ?>
+ url() ?> +

diff --git a/site/templates/home.php b/site/templates/home.php index 8b0d181..fc9dcaf 100644 --- a/site/templates/home.php +++ b/site/templates/home.php @@ -9,8 +9,12 @@ class="no-underline home-baseline" title="lire l'éditorial" > -

subtitle()->inline() ?>

+

subtitle()->inline() ?>

+

+ imprimé le format('d/m/Y'); ?>
+ url() ?> +

true], slots: true) ?> -

- title() ?>

+

title() ?>

body() ?>
diff --git a/site/templates/newsletter.php b/site/templates/newsletter.php index 7e1e5b8..ff9552f 100644 --- a/site/templates/newsletter.php +++ b/site/templates/newsletter.php @@ -3,7 +3,7 @@
true), slots: true) ?> -

title() ?>

+

title() ?>

body() ?>
\ No newline at end of file diff --git a/site/templates/author.php b/site/templates/author.php index d70a54a..201c31b 100644 --- a/site/templates/author.php +++ b/site/templates/author.php @@ -32,4 +32,6 @@
- \ No newline at end of file + + + \ No newline at end of file diff --git a/site/templates/newsletter.php b/site/templates/newsletter.php index ff9552f..bafb26e 100644 --- a/site/templates/newsletter.php +++ b/site/templates/newsletter.php @@ -1,4 +1,5 @@ +
true), slots: true) ?> @@ -14,6 +15,4 @@
-
- - \ No newline at end of file + \ No newline at end of file From 0a92094e53ac7a164ec59fdcf81d95da159930f6 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Wed, 3 Dec 2025 16:50:47 +0100 Subject: [PATCH 09/15] =?UTF-8?q?alignement=20du=20toggle,=20j'ai=20l'impr?= =?UTF-8?q?ession=20que=20=C3=A7a=20faiat=20milles=20fois=20que=20je=20le?= =?UTF-8?q?=20fait=20je=20ne=20comprend=20pas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/src/toggle-light-mode.css | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/assets/css/src/toggle-light-mode.css b/assets/css/src/toggle-light-mode.css index d8d44ce..0bcb7e3 100644 --- a/assets/css/src/toggle-light-mode.css +++ b/assets/css/src/toggle-light-mode.css @@ -18,10 +18,16 @@ mask: var(--icon-theme-toggler) no-repeat center; -webkit-mask: var(--icon-theme-toggler) no-repeat center; } -@media screen and (max-width: 640px) { -.theme-toggler-icon { - width: 1.1rem; - height: 1.1rem; + +@media screen and (min-width: 641px) { + .theme-toggler-icon { + padding-bottom: calc(var(--unit--vertical) - (var(--unit--vertical) / 4)); + } } +@media screen and (max-width: 640px) { + .theme-toggler-icon { + width: 1.1rem; + height: 1.1rem; + } } \ No newline at end of file From 4323b79ac169f13ef226b22265a2ccf977bba876 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Wed, 3 Dec 2025 17:21:37 +0100 Subject: [PATCH 10/15] recaler la grille pour la version print + correctin paddin main print --- assets/css/src/grid.css | 18 ++++++++++++++++-- assets/css/src/print.css | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/assets/css/src/grid.css b/assets/css/src/grid.css index 28594cf..26e31ba 100644 --- a/assets/css/src/grid.css +++ b/assets/css/src/grid.css @@ -25,7 +25,7 @@ body.full-width #main-content { margin-left: inherit; } -@media screen and (max-width: 640px) { +@media (max-width: 640px) { .grid .column:not(:last-child) { margin-bottom: calc(2 * var(--unit--vertical)); } @@ -35,7 +35,11 @@ body.full-width #main-content { [data-template="grid"] main #main-content { margin-left: calc(0px - calc(4 * var(--unit--horizontal))); } - + [data-template="grid"] .grid { + column-gap: var(--unit--horizontal); + } +} +@media (min-width: 640px) { [data-template="grid"] .grid { display: grid; grid-template-columns: repeat(39, 1fr); @@ -43,3 +47,13 @@ body.full-width #main-content { margin-bottom: calc(var(--unit--vertical) * 2); } } + +@media print{ + .grid .column { + grid-column: span 1; + } + [data-template="grid"] .grid { + column-gap: 20px; + grid-template-columns: repeat(2, 1fr); + } +} \ No newline at end of file diff --git a/assets/css/src/print.css b/assets/css/src/print.css index c608b47..82f0271 100644 --- a/assets/css/src/print.css +++ b/assets/css/src/print.css @@ -123,6 +123,7 @@ } main { padding-left: 0; + padding-right: 0; } /* .url{ position: absolute; From 7829420c780b8fb6abeda8fb64ebf9aaeeef111c Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Wed, 3 Dec 2025 18:14:31 +0100 Subject: [PATCH 11/15] pause --- assets/css/src/grid.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/css/src/grid.css b/assets/css/src/grid.css index 26e31ba..511370c 100644 --- a/assets/css/src/grid.css +++ b/assets/css/src/grid.css @@ -56,4 +56,8 @@ body.full-width #main-content { column-gap: 20px; grid-template-columns: repeat(2, 1fr); } + + .blocks, .column { + page-break-inside: auto; /* autoriser la coupe si nécessaire */ + } } \ No newline at end of file From a9d24a43a9cc8a9a9c4b222767c245bc97a7230d Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Thu, 4 Dec 2025 12:11:46 +0100 Subject: [PATCH 12/15] revision interlignage print + marge dans linear --- assets/css/src/grid.css | 14 -------------- assets/css/src/print.css | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/assets/css/src/grid.css b/assets/css/src/grid.css index 511370c..b9cc259 100644 --- a/assets/css/src/grid.css +++ b/assets/css/src/grid.css @@ -46,18 +46,4 @@ body.full-width #main-content { column-gap: var(--unit--horizontal); margin-bottom: calc(var(--unit--vertical) * 2); } -} - -@media print{ - .grid .column { - grid-column: span 1; - } - [data-template="grid"] .grid { - column-gap: 20px; - grid-template-columns: repeat(2, 1fr); - } - - .blocks, .column { - page-break-inside: auto; /* autoriser la coupe si nécessaire */ - } } \ No newline at end of file diff --git a/assets/css/src/print.css b/assets/css/src/print.css index 82f0271..41c663a 100644 --- a/assets/css/src/print.css +++ b/assets/css/src/print.css @@ -1,11 +1,35 @@ @media print { /* Hide header / footer infos. */ + :root{ + --font-size-m: calc(var(--font-size-s) * 1.4) !important; + } + *:not(.page-cover) p, *:not(.page-cover) li, *:not(.page-cover) button, *:not(.page-cover) .fs-m{ + font-size: var(--font-size-m); + line-height: 1.2; + } + * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } + [data-template="linear"] #main-content{ + padding-right: calc(var(--unit--horizontal) * 2) ; + + } + + [data-template="grid"] .grid .column { + grid-column: span 1; + } + [data-template="grid"] .grid { + column-gap: 20px; + grid-template-columns: repeat(2, 1fr); + } + [data-template="grid"] .blocks, .column { + page-break-inside: auto; /* autoriser la coupe si nécessaire */ + } + @page { /*variable pas supporter dans les marges...*/ /* From 8c8295b677d043113a5dd364ae2e5b236bce4647 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Thu, 4 Dec 2025 15:15:40 +0100 Subject: [PATCH 13/15] =?UTF-8?q?ajout=20du=20bouton=20et=20du=20champs=20?= =?UTF-8?q?dans=20le=20panel=20pour=20t=C3=A9l=C3=A9charger=20le=20pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/src/print.css | 2 +- site/blueprints/files/pdfVersion-file.yml | 2 ++ site/blueprints/pages/grid.yml | 8 ++++++++ site/blueprints/pages/linear.yml | 8 ++++++++ site/templates/grid.php | 7 +++++++ site/templates/linear.php | 7 +++++++ 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 site/blueprints/files/pdfVersion-file.yml diff --git a/assets/css/src/print.css b/assets/css/src/print.css index 41c663a..eeea972 100644 --- a/assets/css/src/print.css +++ b/assets/css/src/print.css @@ -64,7 +64,7 @@ } .panel, nav, .main-edito-btn, .theme-toggler, .page-cover .links, - [data-template="home"] .title-wrapper button.open-nav, #nav-overlay{ + [data-template="home"] .title-wrapper button.open-nav, #nav-overlay, .only-screen{ display: none !important; } diff --git a/site/blueprints/files/pdfVersion-file.yml b/site/blueprints/files/pdfVersion-file.yml new file mode 100644 index 0000000..92de0e0 --- /dev/null +++ b/site/blueprints/files/pdfVersion-file.yml @@ -0,0 +1,2 @@ +accept: + extension: pdf \ No newline at end of file diff --git a/site/blueprints/pages/grid.yml b/site/blueprints/pages/grid.yml index 414460c..b9cb32e 100644 --- a/site/blueprints/pages/grid.yml +++ b/site/blueprints/pages/grid.yml @@ -15,6 +15,14 @@ tabs: label: Corps type: fields fields: + pdfVersion: + label: version pdf + help: glisser ici le fichier pdf généré avec `ctrl + p` depuis la page du site + type: files + multiple: false + image: false + uploads: pdfVersion-file + width: 1/3 fullWidth: label: Pleine largeur type: toggle diff --git a/site/blueprints/pages/linear.yml b/site/blueprints/pages/linear.yml index e6cf2e5..d11ed0f 100644 --- a/site/blueprints/pages/linear.yml +++ b/site/blueprints/pages/linear.yml @@ -15,6 +15,14 @@ tabs: label: Corps type: fields fields: + pdfVersion: + label: version pdf + help: glisser ici le fichier pdf généré avec `ctrl + p` depuis la page du site + type: files + multiple: false + image: false + uploads: pdfVersion-file + width: 1/3 subtitle: label: Sous-titre type: writer diff --git a/site/templates/grid.php b/site/templates/grid.php index efd8f5e..62c3ff1 100644 --- a/site/templates/grid.php +++ b/site/templates/grid.php @@ -15,6 +15,13 @@ / category() ?>

+ pdfVersion()->toFile()): ?> +

+ + télécharger le pdf + +

+

imprimé le format('d/m/Y'); ?>
url() ?> diff --git a/site/templates/linear.php b/site/templates/linear.php index cd94c5e..a7c9cb1 100644 --- a/site/templates/linear.php +++ b/site/templates/linear.php @@ -20,6 +20,13 @@ / category() ?>

+ pdfVersion()->toFile()): ?> +

+ + télécharger le pdf + +

+

imprimé le format('d/m/Y'); ?>
url() ?> From c4892e919cff3b51a1a4ce541167dc2519fb33cc Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Wed, 10 Dec 2025 14:54:12 +0100 Subject: [PATCH 14/15] =?UTF-8?q?premi=C3=A8re=20tentative=20d'export=20du?= =?UTF-8?q?=20body=20en=20md,=20pas=20tr=C3=A8s=20concluant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/src/header.css | 1 + site/blueprints/pages/linear.yml | 3 + site/plugins/epub-export/.editorconfig | 20 +++ site/plugins/epub-export/.gitattributes | 11 ++ site/plugins/epub-export/.gitignore | 14 +++ site/plugins/epub-export/LICENSE.md | 21 ++++ site/plugins/epub-export/README.md | 117 ++++++++++++++++++ site/plugins/epub-export/SECURITY.md | 18 +++ site/plugins/epub-export/composer.json | 21 ++++ site/plugins/epub-export/composer.lock | 66 ++++++++++ site/plugins/epub-export/index.css | 2 + site/plugins/epub-export/index.js | 63 ++++++++++ site/plugins/epub-export/index.php | 50 ++++++++ site/plugins/epub-export/package.json | 8 ++ .../src/components/ExportButton.vue | 55 ++++++++ site/plugins/epub-export/src/index.js | 7 ++ 16 files changed, 477 insertions(+) create mode 100644 site/plugins/epub-export/.editorconfig create mode 100644 site/plugins/epub-export/.gitattributes create mode 100644 site/plugins/epub-export/.gitignore create mode 100644 site/plugins/epub-export/LICENSE.md create mode 100644 site/plugins/epub-export/README.md create mode 100644 site/plugins/epub-export/SECURITY.md create mode 100644 site/plugins/epub-export/composer.json create mode 100644 site/plugins/epub-export/composer.lock create mode 100644 site/plugins/epub-export/index.css create mode 100644 site/plugins/epub-export/index.js create mode 100644 site/plugins/epub-export/index.php create mode 100644 site/plugins/epub-export/package.json create mode 100644 site/plugins/epub-export/src/components/ExportButton.vue create mode 100644 site/plugins/epub-export/src/index.js diff --git a/assets/css/src/header.css b/assets/css/src/header.css index 783e683..3b13f00 100644 --- a/assets/css/src/header.css +++ b/assets/css/src/header.css @@ -92,6 +92,7 @@ article > h1 { margin-bottom: calc(0.255 * var(--unit--vertical)); } + .page-cover .text-wrapper { height: 100%; overflow: auto; diff --git a/site/blueprints/pages/linear.yml b/site/blueprints/pages/linear.yml index d11ed0f..5525fa2 100644 --- a/site/blueprints/pages/linear.yml +++ b/site/blueprints/pages/linear.yml @@ -11,6 +11,9 @@ tabs: contentTab: label: Contenu sections: + epub-export: + type: epubexport + headline: "Exporter cette page" bodySection: label: Corps type: fields diff --git a/site/plugins/epub-export/.editorconfig b/site/plugins/epub-export/.editorconfig new file mode 100644 index 0000000..3b762c9 --- /dev/null +++ b/site/plugins/epub-export/.editorconfig @@ -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 diff --git a/site/plugins/epub-export/.gitattributes b/site/plugins/epub-export/.gitattributes new file mode 100644 index 0000000..033ba13 --- /dev/null +++ b/site/plugins/epub-export/.gitattributes @@ -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 diff --git a/site/plugins/epub-export/.gitignore b/site/plugins/epub-export/.gitignore new file mode 100644 index 0000000..4d81cf5 --- /dev/null +++ b/site/plugins/epub-export/.gitignore @@ -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 diff --git a/site/plugins/epub-export/LICENSE.md b/site/plugins/epub-export/LICENSE.md new file mode 100644 index 0000000..8e663d7 --- /dev/null +++ b/site/plugins/epub-export/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) + +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. diff --git a/site/plugins/epub-export/README.md b/site/plugins/epub-export/README.md new file mode 100644 index 0000000..ad2b202 --- /dev/null +++ b/site/plugins/epub-export/README.md @@ -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) diff --git a/site/plugins/epub-export/SECURITY.md b/site/plugins/epub-export/SECURITY.md new file mode 100644 index 0000000..3726336 --- /dev/null +++ b/site/plugins/epub-export/SECURITY.md @@ -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.* diff --git a/site/plugins/epub-export/composer.json b/site/plugins/epub-export/composer.json new file mode 100644 index 0000000..b692c07 --- /dev/null +++ b/site/plugins/epub-export/composer.json @@ -0,0 +1,21 @@ +{ + "name": "studioVariable/epub", + "description": "Kirby Example Plugin", + "license": "MIT", + "type": "kirby-plugin", + "version": "1.0.0", + "authors": [ + { + "name": "Studio Variable", + "email": "contact@studio-variable.com" + } + ], + "require": { + "getkirby/composer-installer": "^1.1" + }, + "config": { + "allow-plugins": { + "getkirby/composer-installer": true + } + } +} diff --git a/site/plugins/epub-export/composer.lock b/site/plugins/epub-export/composer.lock new file mode 100644 index 0000000..a5ae0fa --- /dev/null +++ b/site/plugins/epub-export/composer.lock @@ -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" +} diff --git a/site/plugins/epub-export/index.css b/site/plugins/epub-export/index.css new file mode 100644 index 0000000..d9c4995 --- /dev/null +++ b/site/plugins/epub-export/index.css @@ -0,0 +1,2 @@ + +/** Put your CSS here **/ diff --git a/site/plugins/epub-export/index.js b/site/plugins/epub-export/index.js new file mode 100644 index 0000000..3a625cb --- /dev/null +++ b/site/plugins/epub-export/index.js @@ -0,0 +1,63 @@ +(function() { + "use strict"; + function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { + var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; + if (render) { + options.render = render; + options.staticRenderFns = staticRenderFns; + options._compiled = true; + } + return { + exports: scriptExports, + options + }; + } + const _sfc_main = { + props: { + pageId: String + }, + data() { + return { + loading: false, + error: null + }; + }, + methods: { + async exportEpub() { + this.loading = true; + this.error = null; + try { + const response = await this.$api.post(`epub-export/${this.pageId}`); + const blob = await response.blob(); + const url = window.URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = this.pageId + ".epub"; + a.click(); + } catch (e) { + this.error = "Erreur : " + e.message; + } finally { + this.loading = false; + } + } + } + }; + var _sfc_render = function render() { + var _vm = this, _c = _vm._self._c; + return _c("k-box", [_c("k-button", { attrs: { "theme": "positive", "icon": "download", "disabled": _vm.loading }, on: { "click": _vm.exportEpub } }, [_vm._v(" Exporter en EPUB ")]), _vm.loading ? _c("k-text", [_vm._v("Génération en cours…")]) : _vm._e(), _vm.error ? _c("k-text", { attrs: { "theme": "negative" } }, [_vm._v(_vm._s(_vm.error))]) : _vm._e()], 1); + }; + var _sfc_staticRenderFns = []; + _sfc_render._withStripped = true; + var __component__ = /* @__PURE__ */ normalizeComponent( + _sfc_main, + _sfc_render, + _sfc_staticRenderFns + ); + __component__.options.__file = "C:/Users/anton/Desktop/studioVariable/actuelleInactuelle/actuel-inactuel/site/plugins/epub-export/src/components/ExportButton.vue"; + const ExportButton = __component__.exports; + window.panel.plugin("getkirby/pluginkit", { + sections: { + epubexport: ExportButton + } + }); +})(); diff --git a/site/plugins/epub-export/index.php b/site/plugins/epub-export/index.php new file mode 100644 index 0000000..3640093 --- /dev/null +++ b/site/plugins/epub-export/index.php @@ -0,0 +1,50 @@ + [ + 'routes' => [ + [ + 'pattern' => 'epub-export/(:any)', + 'method' => 'POST', + 'action' => function () { + $pageId = get('id'); + $page = page($pageId); + throw new Exception($page); + if (!$page) { + throw new Exception("Page introuvable"); + } + + // Markdown du champ Body + $markdown = $page->body()->toMarkdown(); + + // Emplacement du fichier + $root = kirby()->root('media') . '/exports'; + Dir::make($root); + + $filename = $page->id() . '.md'; + $filepath = $root . '/' . $filename; + + file_put_contents($filepath, $markdown); + + return [ + 'message' => 'OK', + 'file' => $filename, + 'path' => $filepath, + 'url' => kirby()->url('media') . '/exports/' . $filename, + ]; + } + ] + ] + ], + + 'sections' => [ + 'epubexport' => [ + 'props' => [ + 'pageId' => function () { + return $this->model()->id(); + }, + ], + 'component' => 'export-button' + ] + ] +]); diff --git a/site/plugins/epub-export/package.json b/site/plugins/epub-export/package.json new file mode 100644 index 0000000..c55c993 --- /dev/null +++ b/site/plugins/epub-export/package.json @@ -0,0 +1,8 @@ +{ + "name": "studioVariable/epub", + "scripts": { + "dev": "npx -y kirbyup src/index.js --watch", + "serve": "npx -y kirbyup serve src/index.js", + "build": "npx -y kirbyup src/index.js" + } +} diff --git a/site/plugins/epub-export/src/components/ExportButton.vue b/site/plugins/epub-export/src/components/ExportButton.vue new file mode 100644 index 0000000..aa7bd73 --- /dev/null +++ b/site/plugins/epub-export/src/components/ExportButton.vue @@ -0,0 +1,55 @@ + + + diff --git a/site/plugins/epub-export/src/index.js b/site/plugins/epub-export/src/index.js new file mode 100644 index 0000000..b8a3802 --- /dev/null +++ b/site/plugins/epub-export/src/index.js @@ -0,0 +1,7 @@ +import ExportButton from "./components/ExportButton.vue"; + +window.panel.plugin("tonnom/epub-export", { + sections: { + epubexport: ExportButton + } +}); From 309111c23a27c0d86e2b26ea40f2bc11eafdd686 Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Mon, 9 Feb 2026 15:36:00 +0100 Subject: [PATCH 15/15] je ne sais plus se que contient se commit --- composer.json | 3 +- composer.lock | 51 ++++++++++++++++++- site/blueprints/pages/linear.yml | 6 +-- site/plugins/epub-export/index.php | 9 ++-- .../src/components/ExportButton.vue | 43 ++++++++++++++-- site/plugins/epub-export/src/index.js | 3 +- 6 files changed, 102 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index ffcade6..6f44ca5 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "php-http/guzzle7-adapter": "^1.1", "mailersend/mailersend": "^0.28.0", "sylvainjule/code-editor": "^1.0", - "tobimori/kirby-seo": "^1.1" + "tobimori/kirby-seo": "^1.1", + "splorp/paperback-export": "^2.0" }, "config": { "platform": { diff --git a/composer.lock b/composer.lock index 29ac08e..c580047 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "30f9edc8f90ec79150fffac01e3b80fd", + "content-hash": "8ef02ef5b3cde9ff5bc677b8766397a3", "packages": [ { "name": "beberlei/assert", @@ -2292,6 +2292,55 @@ ], "time": "2025-01-31T14:54:12+00:00" }, + { + "name": "splorp/paperback-export", + "version": "2.0.7", + "source": { + "type": "git", + "url": "https://github.com/splorp/kirby-paperback-export.git", + "reference": "94a43248af69040f1144700262e35842ce6602ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/splorp/kirby-paperback-export/zipball/94a43248af69040f1144700262e35842ce6602ff", + "reference": "94a43248af69040f1144700262e35842ce6602ff", + "shasum": "" + }, + "require": { + "getkirby/composer-installer": "^1.1" + }, + "type": "kirby-plugin", + "extra": { + "installer-name": "paperback-export" + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grant Hutchinson", + "email": "grant@splorp.com", + "homepage": "https://splorp.com/" + } + ], + "description": "Export Kirby CMS content for use with the PaperBack Book Maker", + "homepage": "https://github.com/splorp/kirby-paperback-export", + "keywords": [ + "kirby", + "kirby-cms", + "kirby-plugin", + "newton-book", + "newton-os", + "paperback-book-maker" + ], + "support": { + "docs": "https://github.com/splorp/kirby-paperback-export/blob/master/readme.md", + "issues": "https://github.com/splorp/kirby-paperback-export/issues", + "source": "https://github.com/splorp/kirby-paperback-export" + }, + "time": "2025-06-25T20:50:14+00:00" + }, { "name": "sylvainjule/code-editor", "version": "1.1.0", diff --git a/site/blueprints/pages/linear.yml b/site/blueprints/pages/linear.yml index 5525fa2..7cd72c5 100644 --- a/site/blueprints/pages/linear.yml +++ b/site/blueprints/pages/linear.yml @@ -11,13 +11,13 @@ tabs: contentTab: label: Contenu sections: - epub-export: - type: epubexport - headline: "Exporter cette page" bodySection: label: Corps type: fields fields: + epub-export: + type: epubexport + headline: "Exporter cette page" pdfVersion: label: version pdf help: glisser ici le fichier pdf généré avec `ctrl + p` depuis la page du site diff --git a/site/plugins/epub-export/index.php b/site/plugins/epub-export/index.php index 3640093..57fbc6e 100644 --- a/site/plugins/epub-export/index.php +++ b/site/plugins/epub-export/index.php @@ -7,9 +7,11 @@ Kirby::plugin('tonnom/epub-export', [ 'pattern' => 'epub-export/(:any)', 'method' => 'POST', 'action' => function () { + $pageId = get('id'); $page = page($pageId); - throw new Exception($page); + + throw new Exception($pageId); if (!$page) { throw new Exception("Page introuvable"); } @@ -37,14 +39,13 @@ Kirby::plugin('tonnom/epub-export', [ ] ], - 'sections' => [ + 'fields' => [ 'epubexport' => [ - 'props' => [ + 'computed' => [ 'pageId' => function () { return $this->model()->id(); }, ], - 'component' => 'export-button' ] ] ]); diff --git a/site/plugins/epub-export/src/components/ExportButton.vue b/site/plugins/epub-export/src/components/ExportButton.vue index aa7bd73..4535a3c 100644 --- a/site/plugins/epub-export/src/components/ExportButton.vue +++ b/site/plugins/epub-export/src/components/ExportButton.vue @@ -14,7 +14,7 @@ - + diff --git a/site/plugins/epub-export/src/index.js b/site/plugins/epub-export/src/index.js index b8a3802..b202eef 100644 --- a/site/plugins/epub-export/src/index.js +++ b/site/plugins/epub-export/src/index.js @@ -1,7 +1,8 @@ import ExportButton from "./components/ExportButton.vue"; window.panel.plugin("tonnom/epub-export", { - sections: { + fields: { epubexport: ExportButton } }); +