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 } }); +