From: Vincent Vanwaelscappel Date: Mon, 20 Dec 2021 18:24:46 +0000 (+0100) Subject: wip #4972 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6397ab9a23a587378b9c2d2b94ebd1056527770d;p=odl.git wip #4972 @2 --- diff --git a/.gitignore b/.gitignore index e6e9353..762165c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /public/js /public/mix-manifest.json /storage/*.key +/storage/package/* /vendor .env .env.backup diff --git a/app/Jobs/ProducePackage.php b/app/Jobs/ProducePackage.php new file mode 100644 index 0000000..a766bb8 --- /dev/null +++ b/app/Jobs/ProducePackage.php @@ -0,0 +1,65 @@ +dir = storage_path('package'); + $this->vdir = new VirtualDirectory($this->dir); + + $this->vdir->copyDirectory(storage_path('fluidbook/out'), 'coeur'); + $frontDirectories=['css','fonts','images','js']; + foreach ($frontDirectories as $frontDirectory) { + $this->vdir->copyDirectory(public_path($frontDirectory), $frontDirectory); + } + + $frontController = new FrontController(); + $this->vdir->file_put_contents('index.html', $this->_render($frontController->splash())); + $this->vdir->file_put_contents('accueil.html', $this->_render($frontController->home())); + $this->vdir->file_put_contents('mediatheque.html', $this->_render($frontController->medialibrary())); + $this->vdir->file_put_contents('ressources.html', $this->_render($frontController->resources())); + + $this->vdir->sync(true); + } + + /** + * @param $view View + */ + protected function _render($view) { + $html = $view->render(); + $replace = [ + 'https://odl.paris.cubedesigners.com/front/' => './', + 'https://odl.paris.cubedesigners.com/'=>'./', + '/front/'=>'./', + ]; + $html = str_replace(array_keys($replace), array_values($replace), $html); + + return $html; + } + + +} diff --git a/webpack.mix.js b/webpack.mix.js index 89398b6..a298868 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -2,10 +2,13 @@ const mix = require('laravel-mix'); mix.js('resources/js/app.js', 'public/js') - .postCss('resources/css/app.css', 'public/css', [ + .postCss('resources/css/app.css', 'public/css', [ require('postcss-import'), // Enables build-time imports require('tailwindcss'), - ]); + ]).options({ + processCssUrls: false +}); +; // Copy pre-compiled Isotope JS package mix.copy('node_modules/isotope-layout/dist/isotope.pkgd.min.js', 'public/js/isotope.js');