diff options
| -rw-r--r-- | composer.json | 23 | ||||
| -rw-r--r-- | composer.lock | 526 | ||||
| -rw-r--r-- | config/dotenv.php | 20 | ||||
| -rw-r--r-- | config/webpack/paths.js (renamed from config/paths.js) | 4 | ||||
| -rw-r--r-- | config/webpack/webpack.common.js (renamed from config/webpack.common.js) | 0 | ||||
| -rw-r--r-- | config/webpack/webpack.dev.js (renamed from config/webpack.dev.js) | 0 | ||||
| -rw-r--r-- | config/webpack/webpack.prod.js (renamed from config/webpack.prod.js) | 0 | ||||
| -rw-r--r-- | index.php (renamed from index.html) | 33 | ||||
| -rw-r--r-- | legal-notice.php (renamed from legal-notice.html) | 35 | ||||
| -rw-r--r-- | license.php (renamed from license.html) | 33 | ||||
| -rw-r--r-- | mentions-legales.php (renamed from mentions-legales.html) | 35 | ||||
| -rw-r--r-- | package.json | 1 | ||||
| -rw-r--r-- | src/js/i18n/locales/en.js | 2 | ||||
| -rw-r--r-- | src/js/i18n/locales/fr.js | 2 | ||||
| -rw-r--r-- | webpack.config.js | 10 |
15 files changed, 653 insertions, 71 deletions
diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..44af05a --- /dev/null +++ b/composer.json @@ -0,0 +1,23 @@ +{ + "name": "armandphilippot/demo.armandphilippot.test", + "description": "A collection of small apps demo.", + "license": "MIT", + "authors": [ + { + "name": "Armand Philippot", + "email": "contact@armandphilippot.com", + "homepage": "https://www.armandphilippot.com/" + } + ], + "homepage": "https://demo.armandphilippot.com/", + "scripts": { + "lint": "phpcs --standard=PSR2", + "fix": "phpcbf --standard=PSR2" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^3.6" + }, + "require": { + "vlucas/phpdotenv": "^5.3" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..ed2822a --- /dev/null +++ b/composer.lock @@ -0,0 +1,526 @@ +{ + "_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": "f2435682c29a01197ab8727ee125f1ca", + "packages": [ + { + "name": "graham-campbell/result-type", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/296c015dc30ec4322168c5ad3ee5cc11dae827ac", + "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "phpoption/phpoption": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2021-10-17T19:48:54+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "5455cb38aed4523f99977c4a12ef19da4bfe2a28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/5455cb38aed4523f99977c4a12ef19da4bfe2a28", + "reference": "5455cb38aed4523f99977c4a12ef19da4bfe2a28", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "phpunit/phpunit": "^6.5.14 || ^7.0.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.8.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2021-08-28T21:27:29+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-28T13:41:28+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.3.1", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "accaddf133651d4b5cf81a119f25296736ffc850" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/accaddf133651d4b5cf81a119f25296736ffc850", + "reference": "accaddf133651d4b5cf81a119f25296736ffc850", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.2", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-filter": "*", + "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2021-10-02T19:24:42+00:00" + } + ], + "packages-dev": [ + { + "name": "squizlabs/php_codesniffer", + "version": "3.6.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-10-11T04:00:11+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/config/dotenv.php b/config/dotenv.php new file mode 100644 index 0000000..16d31af --- /dev/null +++ b/config/dotenv.php @@ -0,0 +1,20 @@ +<?php +/** + * Get current environment defined in .env file. + * + * @since 1.2.0 + * + * @return string Current env or empty string. + */ +function dap_get_current_env() +{ + if (file_exists(__DIR__ . '/vendor/autoload.php')) { + require_once __DIR__ . '/vendor/autoload.php'; + $dotenv = Dotenv\Dotenv::createImmutable(__DIR__); + $dotenv->safeLoad(); + $current_env = $_ENV['CURRENT_ENV']; + return $current_env; + } else { + return ''; + } +} diff --git a/config/paths.js b/config/webpack/paths.js index 8b67206..fd4c73f 100644 --- a/config/paths.js +++ b/config/webpack/paths.js @@ -1,6 +1,6 @@ const path = require('path'); -const devFolder = path.resolve(__dirname, '../src/'); +const devFolder = path.resolve(__dirname, '../../src/'); module.exports = { src: { @@ -10,6 +10,6 @@ module.exports = { style: path.resolve(devFolder, './scss/style.scss'), }, dist: path.resolve(devFolder, '../assets/'), - files: [path.resolve(devFolder, '../**/*.html')], + files: [path.resolve(devFolder, '../**/*.php')], sassPaths: [path.resolve(devFolder, '../node_modules/modern-normalize/')], }; diff --git a/config/webpack.common.js b/config/webpack/webpack.common.js index 69ecd2f..69ecd2f 100644 --- a/config/webpack.common.js +++ b/config/webpack/webpack.common.js diff --git a/config/webpack.dev.js b/config/webpack/webpack.dev.js index 4ac420c..4ac420c 100644 --- a/config/webpack.dev.js +++ b/config/webpack/webpack.dev.js diff --git a/config/webpack.prod.js b/config/webpack/webpack.prod.js index a2778f5..a2778f5 100644 --- a/config/webpack.prod.js +++ b/config/webpack/webpack.prod.js @@ -1,11 +1,21 @@ +<?php +require_once('./config/dotenv.php'); + +$dap_current_env = dap_get_current_env(); +?> <!DOCTYPE html> <html lang="en"> + <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Demo | Armand Philippot</title> - <link rel="stylesheet" href="assets/css/style.css" /> + <?php + if ($dap_current_env === 'production') { + echo '<link rel="stylesheet" href="assets/css/style.css" />'; + } + ?> </head> <body class="body"> @@ -19,16 +29,10 @@ <div class="branding"> <div class="branding__logo logo"> <a href="/" rel="home" class="logo__link"> - <img - src="./assets/images/armand-philippot.jpg" - alt="Back to homepage" - class="logo__image logo__image--front" - /> - <img - src="./assets/images/armand-philippot-logo.svg" - alt="Back to homepage" - class="logo__image logo__image--back" - /> + <img src="./assets/images/armand-philippot.jpg" alt="Back to homepage" + class="logo__image logo__image--front" /> + <img src="./assets/images/armand-philippot-logo.svg" alt="Back to homepage" + class="logo__image logo__image--back" /> </a> </div> <h1 class="branding__title"> @@ -57,7 +61,7 @@ <nav class="nav nav--footer"> <ul class="nav__list"> <li class="nav__item"> - <a href="legal-notice.html" class="nav__link nav__link--legal"> + <a href="legal-notice.php" class="nav__link nav__link--legal"> Legal notice </a> </li> @@ -66,12 +70,11 @@ <div class="copyright"> <span class="copyright__license" title="License MIT">MIT</span> <span class="copyright__date">2021.</span> - <a href="https://www.armandphilippot.com/" class="copyright__author" - >Armand Philippot.</a - > + <a href="https://www.armandphilippot.com/" class="copyright__author">Armand Philippot.</a> </div> </footer> <script src="./assets/js/runtime.js"></script> <script src="./assets/js/app.js"></script> </body> + </html> diff --git a/legal-notice.html b/legal-notice.php index 7b6c2bc..67a1ade 100644 --- a/legal-notice.html +++ b/legal-notice.php @@ -1,11 +1,21 @@ +<?php +require_once('./config/dotenv.php'); + +$dap_current_env = dap_get_current_env(); +?> <!DOCTYPE html> <html lang="en"> + <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Legal Notice | Demo | Armand Philippot</title> - <link rel="stylesheet" href="assets/css/style.css" /> + <?php + if ($dap_current_env === 'production') { + echo '<link rel="stylesheet" href="assets/css/style.css" />'; + } + ?> </head> <body class="body"> @@ -19,16 +29,10 @@ <div class="branding"> <div class="branding__logo logo"> <a href="/" rel="home" class="logo__link"> - <img - src="./assets/images/armand-philippot.jpg" - alt="Back to homepage" - class="logo__image logo__image--front" - /> - <img - src="./assets/images/armand-philippot-logo.svg" - alt="Back to homepage" - class="logo__image logo__image--back" - /> + <img src="./assets/images/armand-philippot.jpg" alt="Back to homepage" + class="logo__image logo__image--front" /> + <img src="./assets/images/armand-philippot-logo.svg" alt="Back to homepage" + class="logo__image logo__image--back" /> </a> </div> <h1 class="branding__title"> @@ -62,7 +66,7 @@ <p> The contents of the site, with the exception of those not belonging to Armand Philippot, are made available under the terms of the - <a href="license.html">MIT license</a>. + <a href="license.php">MIT license</a>. </p> </div> </main> @@ -70,7 +74,7 @@ <nav class="nav nav--footer"> <ul class="nav__list"> <li class="nav__item"> - <a href="legal-notice.html" class="nav__link nav__link--legal"> + <a href="legal-notice.php" class="nav__link nav__link--legal"> Legal notice </a> </li> @@ -79,12 +83,11 @@ <div class="copyright"> <span class="copyright__license" title="License MIT">MIT</span> <span class="copyright__date">2021.</span> - <a href="https://www.armandphilippot.com/" class="copyright__author" - >Armand Philippot.</a - > + <a href="https://www.armandphilippot.com/" class="copyright__author">Armand Philippot.</a> </div> </footer> <script src="./assets/js/runtime.js"></script> <script src="./assets/js/app.js"></script> </body> + </html> diff --git a/license.html b/license.php index 15ea458..402c696 100644 --- a/license.html +++ b/license.php @@ -1,11 +1,21 @@ +<?php +require_once('./config/dotenv.php'); + +$dap_current_env = dap_get_current_env(); +?> <!DOCTYPE html> <html lang="en"> + <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>License | Demo | Armand Philippot</title> - <link rel="stylesheet" href="assets/css/style.css" /> + <?php + if ($dap_current_env === 'production') { + echo '<link rel="stylesheet" href="assets/css/style.css" />'; + } + ?> </head> <body class="body"> @@ -19,16 +29,10 @@ <div class="branding"> <div class="branding__logo logo"> <a href="/" rel="home" class="logo__link"> - <img - src="./assets/images/armand-philippot.jpg" - alt="Back to homepage" - class="logo__image logo__image--front" - /> - <img - src="./assets/images/armand-philippot-logo.svg" - alt="Back to homepage" - class="logo__image logo__image--back" - /> + <img src="./assets/images/armand-philippot.jpg" alt="Back to homepage" + class="logo__image logo__image--front" /> + <img src="./assets/images/armand-philippot-logo.svg" alt="Back to homepage" + class="logo__image logo__image--back" /> </a> </div> <h1 class="branding__title"> @@ -73,7 +77,7 @@ <nav class="nav nav--footer"> <ul class="nav__list"> <li class="nav__item"> - <a href="legal-notice.html" class="nav__link nav__link--legal"> + <a href="legal-notice.php" class="nav__link nav__link--legal"> Legal notice </a> </li> @@ -82,12 +86,11 @@ <div class="copyright"> <span class="copyright__license" title="License MIT">MIT</span> <span class="copyright__date">2021.</span> - <a href="https://www.armandphilippot.com/" class="copyright__author" - >Armand Philippot.</a - > + <a href="https://www.armandphilippot.com/" class="copyright__author">Armand Philippot.</a> </div> </footer> <script src="./assets/js/runtime.js"></script> <script src="./assets/js/app.js"></script> </body> + </html> diff --git a/mentions-legales.html b/mentions-legales.php index ebfdf52..e42f363 100644 --- a/mentions-legales.html +++ b/mentions-legales.php @@ -1,11 +1,21 @@ +<?php +require_once('./config/dotenv.php'); + +$dap_current_env = dap_get_current_env(); +?> <!DOCTYPE html> <html lang="en"> + <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Mentions légales | Demo | Armand Philippot</title> - <link rel="stylesheet" href="assets/css/style.css" /> + <?php + if ($dap_current_env === 'production') { + echo '<link rel="stylesheet" href="assets/css/style.css" />'; + } + ?> </head> <body class="body"> @@ -19,16 +29,10 @@ <div class="branding"> <div class="branding__logo logo"> <a href="/" rel="home" class="logo__link"> - <img - src="./assets/images/armand-philippot.jpg" - alt="Back to homepage" - class="logo__image logo__image--front" - /> - <img - src="./assets/images/armand-philippot-logo.svg" - alt="Back to homepage" - class="logo__image logo__image--back" - /> + <img src="./assets/images/armand-philippot.jpg" alt="Back to homepage" + class="logo__image logo__image--front" /> + <img src="./assets/images/armand-philippot-logo.svg" alt="Back to homepage" + class="logo__image logo__image--back" /> </a> </div> <h1 class="branding__title"> @@ -62,7 +66,7 @@ <p> Les contenus du site, à l’exception de ceux n’appartenant pas à Armand Philippot, sont mis à disposition selon les termes de la - <a href="license.html">licence MIT</a>. + <a href="license.php">licence MIT</a>. </p> </div> </main> @@ -70,7 +74,7 @@ <nav class="nav nav--footer"> <ul class="nav__list"> <li class="nav__item"> - <a href="legal-notice.html" class="nav__link nav__link--legal"> + <a href="legal-notice.php" class="nav__link nav__link--legal"> Legal notice </a> </li> @@ -79,12 +83,11 @@ <div class="copyright"> <span class="copyright__license" title="License MIT">MIT</span> <span class="copyright__date">2021.</span> - <a href="https://www.armandphilippot.com/" class="copyright__author" - >Armand Philippot.</a - > + <a href="https://www.armandphilippot.com/" class="copyright__author">Armand Philippot.</a> </div> </footer> <script src="./assets/js/runtime.js"></script> <script src="./assets/js/app.js"></script> </body> + </html> diff --git a/package.json b/package.json index b9f77f5..7048257 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "fix:scss": "stylelint \"**/*.scss\" --fix", "lint": "npm-run-all --parallel lint:*", "lint:js": "eslint --ext .js,.jsx", + "lint:php": "composer lint", "lint:scss": "stylelint \"**/*.scss\" --syntax scss --formatter verbose", "release": "standard-version -s", "rtl": "rtlcss assets/css/style.css assets/css/style-rtl.css", diff --git a/src/js/i18n/locales/en.js b/src/js/i18n/locales/en.js index 9717528..a24b944 100644 --- a/src/js/i18n/locales/en.js +++ b/src/js/i18n/locales/en.js @@ -27,7 +27,7 @@ const en = { footer: { legalNotice: { txt: 'Legal notice', - link: 'legal-notice.html', + link: 'legal-notice.php', }, license: 'License MIT', }, diff --git a/src/js/i18n/locales/fr.js b/src/js/i18n/locales/fr.js index 9c93012..401f297 100644 --- a/src/js/i18n/locales/fr.js +++ b/src/js/i18n/locales/fr.js @@ -27,7 +27,7 @@ const fr = { footer: { legalNotice: { txt: 'Mentions légales', - link: 'mentions-legales.html', + link: 'mentions-legales.php', }, license: 'Licence MIT', }, diff --git a/webpack.config.js b/webpack.config.js index 44379a1..734cc5a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,9 @@ -const { merge } = require("webpack-merge"); -const common = require("./config/webpack.common"); -const dev = require("./config/webpack.dev"); -const prod = require("./config/webpack.prod"); +const { merge } = require('webpack-merge'); +const common = require('./config/webpack/webpack.common'); +const dev = require('./config/webpack/webpack.dev'); +const prod = require('./config/webpack/webpack.prod'); -const isProduction = process.env.NODE_ENV === "production"; +const isProduction = process.env.NODE_ENV === 'production'; module.exports = () => { if (isProduction) return merge(common, prod); |
