Skip to content

Commit cf9b338

Browse files
authored
Merge pull request #7 from dotkernel/stefan-dev
first update
2 parents b574a67 + 6e4f4ec commit cf9b338

15 files changed

Lines changed: 228 additions & 181 deletions

.github/workflows/codecov.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
- ubuntu-latest
1616

1717
php:
18-
- "8.3"
19-
- "8.4"
2018
- "8.5"
2119

2220
steps:

.github/workflows/qodana_code_quality.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/static-analysis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
- ubuntu-latest
1616

1717
php:
18-
- "8.3"
19-
- "8.4"
2018
- "8.5"
2119

2220
steps:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
"require": {
29-
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
29+
"php": "~8.5.0",
3030
"doctrine/data-fixtures": "^2.2",
3131
"doctrine/doctrine-fixtures-bundle": "^4.3",
3232
"dotkernel/dot-errorhandler": "^4.4.0",

src/App/src/RoutesDelegator.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Light\App;
66

7+
use Laminas\Diactoros\Response\RedirectResponse;
78
use Light\App\Handler\GetIndexViewHandler;
89
use Mezzio\Application;
910
use Psr\Container\ContainerInterface;
@@ -16,9 +17,17 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal
1617
{
1718
$app = $callback();
1819
assert($app instanceof Application);
19-
2020
$app->get('/', [GetIndexViewHandler::class], 'app::index');
2121

22+
$app->get('/{first}', function ($request) {
23+
$uri = $request->getUri();
24+
return new RedirectResponse((string) $uri . '/', 301);
25+
});
26+
$app->get('/{first}/{second}', function ($request) {
27+
$uri = $request->getUri();
28+
return new RedirectResponse((string) $uri . '/', 301);
29+
});
30+
2231
return $app;
2332
}
2433
}

src/App/templates/app/index.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@
130130
</div>
131131
</div>
132132
</section>
133-
{% endblock %}
133+
{% endblock %}

src/App/templates/layout/default.html.twig

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
4+
<meta charset="utf-8" />
55
{{ include('@partial/meta.html.twig') }}
6-
{% block canonical %}<link rel="canonical" href="{{ url(routeName ?? null) }}" />{% endblock %}
7-
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('images/app/favicon/apple-touch-icon.png') }}">
6+
{% block canonical %}<link rel="canonical" href="{{ url(routeName ?? null) }}" />
7+
{% endblock %}<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('images/app/favicon/apple-touch-icon.png') }}">
88
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('images/app/favicon/favicon-32x32.png') }}">
99
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('images/app/favicon/favicon-16x16.png') }}">
1010
<link rel="manifest" href="{{ asset('images/app/favicon/site.webmanifest') }}">
1111
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet" />
1212
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600" rel="stylesheet">
1313
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600" rel="stylesheet">
14-
1514
<link href="{{ asset('css/app.css') }}" rel="stylesheet" />
16-
17-
{% block stylesheets %}{% endblock %}
15+
{% block stylesheets %}
16+
{% endblock %}
1817
</head>
1918
<body class="app d-flex flex-column min-vh-100 bg-light text-secondary {% block body_class %}{% endblock %}">
20-
2119
<header class="app-header sticky-top bg-white border-bottom shadow-sm">
2220
<nav class="navbar navbar-expand-lg navbar-light py-2">
2321
<div class="container-fluid px-4 px-lg-5">
2422
<a href="/" class="navbar-brand d-flex align-items-center">
2523
<img src="{{ asset('images/app/logo.svg') }}"
2624
onerror="this.onerror=null; this.src='{{ asset('images/app/logo.png') }}';"
2725
alt="Dotkernel"
28-
style="height: 35px;" />
26+
style="height: 50px;" />
2927
</a>
30-
3128
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarHeader">
3229
<span class="navbar-toggler-icon"></span>
3330
</button>
34-
3531
<div class="collapse navbar-collapse" id="navbarHeader">
3632
<ul class="navbar-nav mx-auto gap-lg-4">
3733
<li class="nav-item">
38-
<a class="nav-link px-3 fw-semibold transition-all" href="{{ url('page::blog') }}">Posts</a>
34+
<a class="nav-link px-3 fw-semibold fs-5 transition-all" target="_blank" href="https://docs.dotkernel.org/">Documentation</a>
3935
</li>
4036
<li class="nav-item">
41-
<a class="nav-link px-3 fw-semibold transition-all" href="{{ url('page::categories') }}">Categories</a>
37+
<a class="nav-link px-3 fw-semibold fs-5 transition-all" href="{{ url('page::dotkernel-packages-oss-lifecycle') }}">Packages Lifecycle</a>
4238
</li>
4339
<li class="nav-item">
44-
<a class="nav-link px-3 fw-semibold transition-all" href="{{ url('page::about') }}">About Us</a>
40+
<a class="nav-link px-3 fw-semibold fs-5 transition-all" href="{{ url('page::category-resource', {slug: 'how-to'}) }}">How to's</a>
41+
</li>
42+
<li class="nav-item">
43+
<a class="nav-link px-3 fw-semibold fs-5 transition-all" href="{{ url('page::blog') }}">Blog</a>
44+
</li>
45+
<li class="nav-item">
46+
<a class="nav-link px-3 fw-semibold fs-5 transition-all" href="{{ url('page::categories') }}">Categories</a>
4547
</li>
4648
</ul>
47-
4849
<div class="d-none d-lg-block">
49-
<a href="#" class="btn btn-primary rounded-pill px-4">Contact</a>
50+
<a href="{{ url('page::contact') }}" class="btn btn-primary rounded-pill px-4">Contact</a>
5051
</div>
5152
</div>
5253
</div>
@@ -57,13 +58,11 @@
5758
<header class="content-header mb-4">
5859
{% block page_title %}{% endblock %}
5960
</header>
60-
6161
<section class="content">
6262
{% block content %}{% endblock %}
6363
</section>
6464
</div>
6565
</main>
66-
6766
<footer class="app-footer bg-white border-top py-4 mt-auto text-muted">
6867
<div class="container d-flex flex-column flex-md-row justify-content-between align-items-center gap-2">
6968
<p class="enjoy text-uppercase tracking-wider small fw-bold text-primary mb-0">
@@ -74,7 +73,6 @@
7473
</p>
7574
</div>
7675
</footer>
77-
7876
<script src="{{ asset('js/app.js') }}"></script>
7977
{% block javascript %}{% endblock %}
8078
</body>
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
<meta charset="utf-8" />
2-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
3-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
4-
<meta name="msapplication-TileColor" content="#2d89ef">
5-
<meta name="theme-color" content="#ffffff">
6-
<title>{{ meta.title ?? meta.name ?? app.meta.title }}</title>
1+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
2+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
3+
<meta name="msapplication-TileColor" content="#2d89ef">
4+
<meta name="theme-color" content="#ffffff">
5+
<title>{{ meta.title ?? meta.name ?? app.meta.title }}</title>
6+
<meta name="description" content="{{ (meta.description ?? meta.excerpt ?? app.meta.description)|slice(0, 155) }}"/>
7+
<meta property="og:title" content="{{ meta.title ?? app.meta.title }}"/>
8+
<meta property="og:description" content="{{ (meta.description ?? meta.excerpt ?? app.meta.description)|slice(0, 120) }}"/>
9+
<meta property="og:image" content="{{ meta.image ?? app.meta.image }}"/>
10+
<meta property="og:type" content="{{ meta.type ?? app.meta.type }}"/>
11+
<meta property="og:site_name" content="{{ app.meta.siteName }}"/>
12+
<meta property="og:url" content="{{ meta.url ?? app.meta.url }}"/>
13+
<meta property="og:locale" content="{{ app.meta.locale }}"/>
714

8-
<meta name="description" content="{{ (meta.description ?? meta.excerpt ?? app.meta.description)|slice(0, 155) }}"/>
9-
<meta property="og:title" content="{{ meta.title ?? app.meta.title }}"/>
10-
<meta property="og:description" content="{{ (meta.description ?? meta.excerpt ?? app.meta.description)|slice(0, 120) }}"/>
11-
<meta property="og:image" content="{{ meta.image ?? app.meta.image }}"/>
12-
<meta property="og:type" content="{{ meta.type ?? app.meta.type }}"/>
13-
<meta property="og:site_name" content="{{ app.meta.siteName }}"/>
14-
<meta property="og:url" content="{{ meta.url ?? app.meta.url }}"/>
15-
<meta property="og:locale" content="{{ app.meta.locale }}"/>
16-
17-
<meta name="twitter:card" content="{{ app.meta.twitterCard }}"/>
18-
<meta name="twitter:site" content="{{ app.meta.twitterSite }}"/>
19-
<meta name="twitter:title" content="{{ meta.title ?? meta.name ?? app.meta.title }}"/>
20-
<meta name="twitter:description" content="{{ (meta.description ?? meta.excerpt ?? app.meta.description)|slice(0, 155) }}"/>
21-
<meta name="twitter:image" content="{{ meta.image ?? app.meta.image }}"/>
15+
<meta name="twitter:card" content="{{ app.meta.twitterCard }}"/>
16+
<meta name="twitter:site" content="{{ app.meta.twitterSite }}"/>
17+
<meta name="twitter:title" content="{{ meta.title ?? meta.name ?? app.meta.title }}"/>
18+
<meta name="twitter:description" content="{{ (meta.description ?? meta.excerpt ?? app.meta.description)|slice(0, 155) }}"/>
19+
<meta name="twitter:image" content="{{ meta.image ?? app.meta.image }}"/>

src/Blog/src/RoutesDelegator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal
2020
{
2121
$app = $callback();
2222
assert($app instanceof Application);
23-
$app->get('/blog', [GetPostCollectionHandler::class], 'page::blog');
24-
$app->get('/category/{slug}', [GetCategoryResourceHandler::class], 'page::category-resource');
25-
$app->get('/categories', [GetCategoryCollectionHandler::class], 'page::categories');
26-
$app->get('/author/{slug}', [GetAuthorResourceHandler::class], 'page::author-resource');
27-
$app->get('/{categorySlug}/{slug}', [GetPostResourceHandler::class], 'page::blog-resource');
23+
$app->get('/blog/', [GetPostCollectionHandler::class], 'page::blog');
24+
$app->get('/category/{slug}/', [GetCategoryResourceHandler::class], 'page::category-resource');
25+
$app->get('/categories/', [GetCategoryCollectionHandler::class], 'page::categories');
26+
$app->get('/author/{slug}/', [GetAuthorResourceHandler::class], 'page::author-resource');
27+
$app->get('/{categorySlug}/{slug}/', [GetPostResourceHandler::class], 'page::blog-resource');
2828
return $app;
2929
}
3030
}

0 commit comments

Comments
 (0)