From 82f7b2109ca27c2435c5384f6d3add04442b7fe6 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Thu, 12 Jul 2018 19:25:45 +0200 Subject: [PATCH] Changed how custom JS/CSS can be added --- README.md | 5 +++-- views/layout/default.blade.php | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 21e203b0..a2dffbe4 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,9 @@ Database schema migration is automatically done when visiting the root (`/`) rou ### Demo mode When the file `data/demo.txt` exists, the application will work in a demo mode which means authentication is disabled and some demo data will be generated during the database schema migration. -### Other things -When the file `data/add_before_end_body.html` exists, the contents of the file be added just before `` on every page, useful for your own JS/CSS without to have to modify the application itself. +### Adding your own CSS or JS without to have to modify the application itself +- When the file `data/custom.js` exists, the contents of the file be added just before `` on every page +- When the file `data/custom.css` exists, the contents of the file be added just before `` on every page ## Screenshots #### Dashboard diff --git a/views/layout/default.blade.php b/views/layout/default.blade.php index a6e11db2..2acd092f 100644 --- a/views/layout/default.blade.php +++ b/views/layout/default.blade.php @@ -26,6 +26,10 @@ @stack('pageStyles') + @if(file_exists(__DIR__ . '/../../data/custom.css')) + @php include __DIR__ . '/../../data/custom.css' @endphp + @endif + - @if(file_exists(__DIR__ . '/../../data/add_before_end_body.html')) - @php include __DIR__ . '/../../data/add_before_end_body.html' @endphp + @if(file_exists(__DIR__ . '/../../data/custom.js')) + @php include __DIR__ . '/../../data/custom.js' @endphp @endif