diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6c105853dd..f4bce87858 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,8 @@ **Ticket:** DOC- -**Site:** [Staging branch](https://pr-.tinymce-docs.iad.staging.tiny.cloud/docs/tinymce/8/) +**Site:** `https://pr-PR_NUMBER.tinymce-docs.iad.staging.tiny.cloud/docs/tinymce/latest/PAGE_PATH` – Replace PR_NUMBER (from `gh pr view`) and PAGE_PATH. For shared partials affecting multiple pages, list each: +- [Page 1](https://pr-PR_NUMBER.tinymce-docs.iad.staging.tiny.cloud/docs/tinymce/latest/page-1) +- [Page 2](https://pr-PR_NUMBER.tinymce-docs.iad.staging.tiny.cloud/docs/tinymce/latest/page-2) **Changes:** * diff --git a/modules/ROOT/partials/integrations/laravel-quick-start.adoc b/modules/ROOT/partials/integrations/laravel-quick-start.adoc index 9892c1d6d6..4164d9a504 100644 --- a/modules/ROOT/partials/integrations/laravel-quick-start.adoc +++ b/modules/ROOT/partials/integrations/laravel-quick-start.adoc @@ -3,15 +3,15 @@ ifeval::["{productSource}" == "cloud"] :packageSource: {cloudname} endif::[] ifeval::["{productSource}" == "composer"] -:scriptsource: {{ asset('js/tinymce/tinymce.min.js') }} +:scriptsource: {{ asset('build/js/tinymce/tinymce.min.js') }} :packageSource: https://packagist.org/packages/tinymce/tinymce[TinyMCE Composer package] endif::[] ifeval::["{productSource}" == "zip"] -:scriptsource: {{ asset('js/tinymce/tinymce.min.js') }} +:scriptsource: {{ asset('build/js/tinymce/tinymce.min.js') }} :packageSource: TinyMCE .zip package endif::[] -https://laravel.com/[Laravel] is a scaleable web application framework built on PHP. This guide assists with adding {productname} from the {packageSource} to pages or views in Laravel. The example Laravel project created in this procedure is based on the Laravel project documented in the Laravel Docs, under https://laravel.com/docs/8.x/installation#installation-via-composer[Installation Via Composer]. The guide will create two blades: one for the JavaScript and another for the editor placeholder, to reflect how {productname} should be used in production environments. +https://laravel.com/[Laravel] is a scaleable web application framework built on PHP. This guide assists with adding {productname} from the {packageSource} to pages or views in Laravel. The example Laravel project created in this procedure is based on the Laravel project documented in the Laravel Docs, under https://laravel.com/docs/12.x/installation#installation-via-composer[Installation Via Composer]. The guide will create two blades: one for the JavaScript and another for the editor placeholder, to reflect how {productname} should be used in production environments. == Requirements @@ -40,7 +40,7 @@ cd my-example-app ifeval::["{productSource}" != "cloud"] -. Install the required Node.js components, including https://laravel.com/docs/8.x/mix[Laravel Mix]: +. Install the required Node.js components, including https://laravel.com/docs/12.x/vite[Vite]: + [source,sh] ---- @@ -56,13 +56,31 @@ ifeval::["{productSource}" == "composer"] ---- composer require tinymce/tinymce ---- -. Add a Laravel Mix task to copy {productname} to the public files when Mix is run, such as: +. Add a Vite task to copy {productname} to the public files when the build runs. Install the static copy plugin and configure Vite: + -_File:_ `+webpack.mix.js+` +[source,sh] +---- +npm install -D vite-plugin-static-copy +---- ++ +_File:_ `+vite.config.js+` + [source,js] ---- -mix.copyDirectory('vendor/tinymce/tinymce', 'public/js/tinymce'); +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; +import { viteStaticCopy } from 'vite-plugin-static-copy'; + +export default defineConfig({ + plugins: [ + laravel(['resources/css/app.css', 'resources/js/app.js']), + viteStaticCopy({ + targets: [ + { src: 'vendor/tinymce/tinymce', dest: 'js' } + ] + }) + ] +}); ---- endif::[] @@ -76,28 +94,46 @@ include::partial$integrations/download-tinymce-zip.adoc[] ---- unzip ../tinymce_latest.zip -d resources/js ---- -. Add a Laravel Mix task to copy {productname} to the public files when Mix is run, such as: +. Add a Vite task to copy {productname} to the public files when the build runs. Install the static copy plugin and configure Vite: + -_File:_ `+webpack.mix.js+` +[source,sh] +---- +npm install -D vite-plugin-static-copy +---- ++ +_File:_ `+vite.config.js+` + [source,js] ---- -mix.copyDirectory('resources/js/tinymce/js/tinymce', 'public/js/tinymce'); +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; +import { viteStaticCopy } from 'vite-plugin-static-copy'; + +export default defineConfig({ + plugins: [ + laravel(['resources/css/app.css', 'resources/js/app.js']), + viteStaticCopy({ + targets: [ + { src: 'resources/js/tinymce/js/tinymce', dest: 'js' } + ] + }) + ] +}); ---- endif::[] ifeval::["{productSource}" != "cloud"] -. Run Laravel Mix to copy {productname} to the `+public/js/+` directory: +. Run Vite to copy {productname} to the `+public/build/js/+` directory: + [source,sh] ---- -npx mix +npm run build ---- endif::[] -. Create a new reusable https://laravel.com/docs/8.x/blade#components[component (`+blade.php+`)] for the {productname} configuration, such as: +. Create a new reusable https://laravel.com/docs/12.x/blade#components[component (`+blade.php+`)] for the {productname} configuration, such as: + [source,sh] ----