Compare commits

..

No commits in common. "ea3814991d87e2350d060f721b198f53eb22dd35" and "6962d85075f5830f76e5a27384f2c068e61bbe00" have entirely different histories.

12 changed files with 658 additions and 1243 deletions

View File

@ -1,4 +1,4 @@
# Website # Website
Copyright (c) 2021- Jeroen De Meerleer <me@jeroened.be> (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": "^v6.3", "symfony/console": "^6.2",
"symfony/dotenv": "^6.3", "symfony/dotenv": "^6.2",
"symfony/flex": "^2.2", "symfony/flex": "^2.2",
"symfony/framework-bundle": "^6.3", "symfony/framework-bundle": "^6.2",
"symfony/runtime": "^6.3", "symfony/runtime": "^6.2",
"symfony/twig-bundle": "^6.3", "symfony/twig-bundle": "^6.2",
"symfony/webpack-encore-bundle": "^2.0", "symfony/webpack-encore-bundle": "^v1.16",
"symfony/yaml": "^6.3" "symfony/yaml": "^6.2"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {

672
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,6 @@ 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,10 +25,14 @@ 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'
# pass the build name as the 3rd argument to the Twig functions # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# {{ encore_entry_script_tags('entry1', null, 'frontend') }} # Put in config/packages/prod/webpack_encore.yaml
# cache: true
framework: framework:
assets: assets:

View File

@ -1,5 +1,13 @@
controllers: error:
resource: path: '/error/{status}'
path: ../src/Controller/ defaults:
namespace: App\Controller _controller: App\Controller\DefaultController::ErrorAction
type: attribute status: '404'
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,22 +11,15 @@
"js-cookie": "^3.0" "js-cookie": "^3.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.0", "@symfony/webpack-encore": "^4.3",
"@babel/preset-env": "^7.16.0", "core-js": "^3.30",
"@symfony/webpack-encore": "^4.0.0", "sass": "^1.62",
"core-js": "^3.23.0", "sass-loader": "^13.2"
"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": "encore production --progress" "build-dev": "encore dev",
"build": "encore prod"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -7,11 +7,9 @@ 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);
@ -19,8 +17,7 @@ class DefaultController extends AbstractController
return $this->render('/page.html.twig', $return, $response); return $this->render('/page.html.twig', $return, $response);
} }
#[Route('/error/{status}', name: 'error', requirements: ['status' => '[0-9]{3}'], priority: 2)] public function ErrorAction(Request $request, Page $page, KernelInterface $kernel, string $status)
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.3", "version": "6.0",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "6.2", "version": "5.4",
"ref": "af47254c5e4cd543e6af3e4508298ffebbdaddd3" "ref": "3cd216a4d007b78d8554d44a5b1c0a446dab24fb"
}, },
"files": [ "files": [
"config/packages/cache.yaml", "config/packages/cache.yaml",
@ -43,12 +43,12 @@
] ]
}, },
"symfony/routing": { "symfony/routing": {
"version": "6.3", "version": "6.0",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "6.2", "version": "6.0",
"ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6" "ref": "eb3b377a4dc07006c4bdb2c773652cc9434f5246"
}, },
"files": [ "files": [
"config/packages/routing.yaml", "config/packages/routing.yaml",
@ -56,12 +56,12 @@
] ]
}, },
"symfony/twig-bundle": { "symfony/twig-bundle": {
"version": "6.3", "version": "6.0",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "6.3", "version": "5.4",
"ref": "b7772eb20e92f3fb4d4fe756e7505b4ba2ca1a2c" "ref": "bb2178c57eee79e6be0b297aa96fc0c0def81387"
}, },
"files": [ "files": [
"config/packages/twig.yaml", "config/packages/twig.yaml",
@ -69,15 +69,18 @@
] ]
}, },
"symfony/webpack-encore-bundle": { "symfony/webpack-encore-bundle": {
"version": "2.0", "version": "1.15",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "main", "branch": "main",
"version": "2.0", "version": "1.10",
"ref": "13ebe04e25085e2ff0bcb0f9218b561d8b5089f3" "ref": "2e458cc7e6f1df1dad890eb104b81e4f302c9bd4"
}, },
"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 subdirectory deploy // only needed for CDN's or sub-directory 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.23'; config.corejs = 3;
}) })
// enables Sass/SCSS support // enables Sass/SCSS support