Compare commits

..

2 Commits

Author SHA1 Message Date
ea3814991d
Update Symfony packages to version 6.3 2023-06-27 12:11:04 +02:00
fee87ef707
Fix typo in README.md copyright notice
The commit fixes a typo in the copyright notice of the README.md file. The word "Copyright" was misspelled as "(c)".
2023-06-27 11:25:49 +02:00
12 changed files with 1245 additions and 660 deletions

View File

@ -1,4 +1,4 @@
# Website # Website
(c) 2021- Jeroen De Meerleer <me@jeroened.be> Copyright (c) 2021- Jeroen De Meerleer <me@jeroened.be>
Source code of my personal website Source code of my personal website

View File

@ -8,14 +8,14 @@
"ext-ctype": "*", "ext-ctype": "*",
"ext-iconv": "*", "ext-iconv": "*",
"erusev/parsedown": "^1.7", "erusev/parsedown": "^1.7",
"symfony/console": "^6.2", "symfony/console": "^v6.3",
"symfony/dotenv": "^6.2", "symfony/dotenv": "^6.3",
"symfony/flex": "^2.2", "symfony/flex": "^2.2",
"symfony/framework-bundle": "^6.2", "symfony/framework-bundle": "^6.3",
"symfony/runtime": "^6.2", "symfony/runtime": "^6.3",
"symfony/twig-bundle": "^6.2", "symfony/twig-bundle": "^6.3",
"symfony/webpack-encore-bundle": "^v1.16", "symfony/webpack-encore-bundle": "^2.0",
"symfony/yaml": "^6.2" "symfony/yaml": "^6.3"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {

676
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@ framework:
secret: '%env(APP_SECRET)%' secret: '%env(APP_SECRET)%'
#csrf_protection: true #csrf_protection: true
http_method_override: false http_method_override: false
handle_all_throwables: true
# Enables session support. Note that the session will ONLY be started if you read or write from it. # Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support. # Remove or comment this section to explicitly disable session support.

View File

@ -25,14 +25,10 @@ webpack_encore:
# If you have multiple builds: # If you have multiple builds:
# builds: # builds:
# pass "frontend" as the 3rg arg to the Twig functions
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
# frontend: '%kernel.project_dir%/public/frontend/build' # frontend: '%kernel.project_dir%/public/frontend/build'
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) # pass the build name as the 3rd argument to the Twig functions
# Put in config/packages/prod/webpack_encore.yaml # {{ encore_entry_script_tags('entry1', null, 'frontend') }}
# cache: true
framework: framework:
assets: assets:

View File

@ -1,13 +1,5 @@
error: controllers:
path: '/error/{status}' resource:
defaults: path: ../src/Controller/
_controller: App\Controller\DefaultController::ErrorAction namespace: App\Controller
status: '404' type: attribute
default:
path: '/{slug}'
defaults:
_controller: App\Controller\DefaultController::DefaultAction
slug: 'index'
requirements:
slug: "[a-zA-Z0-9\/]+"

1127
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,15 +11,22 @@
"js-cookie": "^3.0" "js-cookie": "^3.0"
}, },
"devDependencies": { "devDependencies": {
"@symfony/webpack-encore": "^4.3", "@babel/core": "^7.17.0",
"core-js": "^3.30", "@babel/preset-env": "^7.16.0",
"sass": "^1.62", "@symfony/webpack-encore": "^4.0.0",
"sass-loader": "^13.2" "core-js": "^3.23.0",
"regenerator-runtime": "^0.13.9",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-notifier": "^1.15.0"
}, },
"license": "UNLICENSED",
"private": true,
"scripts": { "scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch", "watch": "encore dev --watch",
"build-dev": "encore dev", "build": "encore production --progress"
"build": "encore prod"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -7,9 +7,11 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController class DefaultController extends AbstractController
{ {
#[Route('/{slug}', name: 'default', requirements: ['slug' => '[a-zA-Z0-9\/]+'])]
public function DefaultAction(Request $request, Page $page, KernelInterface $kernel, string $slug = 'index') public function DefaultAction(Request $request, Page $page, KernelInterface $kernel, string $slug = 'index')
{ {
$return = $page->getPage($kernel, $slug); $return = $page->getPage($kernel, $slug);
@ -17,7 +19,8 @@ class DefaultController extends AbstractController
return $this->render('/page.html.twig', $return, $response); return $this->render('/page.html.twig', $return, $response);
} }
public function ErrorAction(Request $request, Page $page, KernelInterface $kernel, string $status) #[Route('/error/{status}', name: 'error', requirements: ['status' => '[0-9]{3}'], priority: 2)]
public function ErrorAction(Request $request, Page $page, KernelInterface $kernel, string $status = '404')
{ {
$return = $page->getPage($kernel, 'error/' . $status); $return = $page->getPage($kernel, 'error/' . $status);
$response = new Response('', (int)$status); $response = new Response('', (int)$status);

View File

@ -24,12 +24,12 @@
] ]
}, },
"symfony/framework-bundle": { "symfony/framework-bundle": {
"version": "6.0", "version": "6.3",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "5.4", "version": "6.2",
"ref": "3cd216a4d007b78d8554d44a5b1c0a446dab24fb" "ref": "af47254c5e4cd543e6af3e4508298ffebbdaddd3"
}, },
"files": [ "files": [
"config/packages/cache.yaml", "config/packages/cache.yaml",
@ -43,12 +43,12 @@
] ]
}, },
"symfony/routing": { "symfony/routing": {
"version": "6.0", "version": "6.3",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "6.0", "version": "6.2",
"ref": "eb3b377a4dc07006c4bdb2c773652cc9434f5246" "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6"
}, },
"files": [ "files": [
"config/packages/routing.yaml", "config/packages/routing.yaml",
@ -56,12 +56,12 @@
] ]
}, },
"symfony/twig-bundle": { "symfony/twig-bundle": {
"version": "6.0", "version": "6.3",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "5.4", "version": "6.3",
"ref": "bb2178c57eee79e6be0b297aa96fc0c0def81387" "ref": "b7772eb20e92f3fb4d4fe756e7505b4ba2ca1a2c"
}, },
"files": [ "files": [
"config/packages/twig.yaml", "config/packages/twig.yaml",
@ -69,18 +69,15 @@
] ]
}, },
"symfony/webpack-encore-bundle": { "symfony/webpack-encore-bundle": {
"version": "1.15", "version": "2.0",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "1.10", "version": "2.0",
"ref": "2e458cc7e6f1df1dad890eb104b81e4f302c9bd4" "ref": "13ebe04e25085e2ff0bcb0f9218b561d8b5089f3"
}, },
"files": [ "files": [
"assets/app.js", "assets/app.js",
"assets/bootstrap.js",
"assets/controllers.json",
"assets/controllers/hello_controller.js",
"assets/styles/app.css", "assets/styles/app.css",
"config/packages/webpack_encore.yaml", "config/packages/webpack_encore.yaml",
"package.json", "package.json",

View File

@ -1,8 +1,8 @@
<!doctype html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Jeroen De Meerleer{% if block("title") is not empty %} :: {% block title %}{% endblock %}{% endif %}</title> <title>Jeroen De Meerleer{% if block("title") is not empty %} :: {% block title %}{% endblock %}{% endif %}</title>
{% block styles %}{% endblock %} {% block styles %}{% endblock %}

View File

@ -11,7 +11,7 @@ Encore
.setOutputPath('public/build/') .setOutputPath('public/build/')
// public path used by the web server to access the output path // public path used by the web server to access the output path
.setPublicPath('/build') .setPublicPath('/build')
// only needed for CDN's or sub-directory deploy // only needed for CDN's or subdirectory deploy
//.setManifestKeyPrefix('build/') //.setManifestKeyPrefix('build/')
/* /*
@ -52,7 +52,7 @@ Encore
// enables @babel/preset-env polyfills // enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => { .configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage'; config.useBuiltIns = 'usage';
config.corejs = 3; config.corejs = '3.23';
}) })
// enables Sass/SCSS support // enables Sass/SCSS support