Skip to content

Commit 097934c

Browse files
committed
meta
1 parent dce1717 commit 097934c

12 files changed

Lines changed: 59 additions & 22 deletions

config/autoload/app.global.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,28 @@
44

55
$app = [
66
'name' => 'Dotkernel Light | PSR-15 compliant application',
7+
'meta' => [
8+
'title' => 'Dotkernel Light',
9+
'description' => 'Dotkernel is a Headless Platformfor building modern web applications
10+
Dotkernel is a collection of applications (skeletons) that use a middleware-first architecture
11+
built on top of the Mezzio microframework using Laminas components. The goal is to provide a
12+
pre-configured environment for app',
13+
14+
'image' => '/uploads/logos/logo.png',
15+
'type' => 'website',
16+
'siteName' => 'Dotkernel Light',
17+
'locale' => 'en_US',
18+
'url' => 'https://www.dotkernel.com',
19+
'twitterCard' => 'summary_large_image',
20+
'twitterSite' => '@dotkernel',
21+
],
722
];
823

924
return [
10-
'app' => $app,
25+
'app' => $app,
26+
'twig' => [
27+
'globals' => [
28+
'app' => $app,
29+
],
30+
],
1131
];

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
74

8-
<title>{% block title %}{% endblock %} | Dotkernel Light</title>
5+
{% include '@partial/meta.html.twig' %}
96
{% block canonical %}<link rel="canonical" href="{{ url(routeName ?? null) }}" />{% endblock %}
10-
117
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('images/app/favicon/apple-touch-icon.png') }}">
128
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('images/app/favicon/favicon-32x32.png') }}">
139
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('images/app/favicon/favicon-16x16.png') }}">
1410
<link rel="manifest" href="{{ asset('images/app/favicon/site.webmanifest') }}">
15-
<meta name="msapplication-TileColor" content="#2d89ef">
16-
<meta name="theme-color" content="#ffffff">
17-
1811
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet" />
1912
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600" rel="stylesheet">
2013
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600" rel="stylesheet">
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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>
7+
<meta name="description" content="{{ meta.description ?? meta.excerpt?? app.meta.description }}"/>
8+
9+
<meta property="og:title" content="{{ meta.title ?? app.meta.title }}"/>
10+
<meta name="description" content="{{ meta.description ?? meta.excerpt?? app.meta.description }}"/>
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="{{ app.meta.url }}"/>
15+
16+
<meta name="twitter:card" content="{{ app.meta.twitterCard }}"/>
17+
<meta name="twitter:site" content="{{ app.meta.twitterSite }}"/>
18+
<meta name="twitter:title" content="{{ meta.title ?? meta.name?? app.meta.title }}"/>
19+
<meta name="twitter:description" content="{{ meta.excerpt ?? app.meta.description }}"/>
20+
<meta name="twitter:image" content="{{ meta.image ?? app.meta.image }}"/>

src/Blog/src/Handler/GetCategoryResourceHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface
2323
{
2424
$categorySlug = $request->getAttribute('slug');
2525
$category = $this->categoryRepository->getCategoryResource($categorySlug);
26+
$meta = $category;
27+
2628
if (! $category) {
2729
return new HtmlResponse('Category not found', 404);
2830
}
@@ -32,6 +34,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
3234
$this->template->render('page::category-resource', [
3335
'categories' => $categories,
3436
'category' => $category,
37+
'meta' => $meta,
3538
'categoryArticles' => $categoryArticles,
3639
])
3740
);

src/Blog/src/Handler/GetPostResourceHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ public function handle(ServerRequestInterface $request): ResponseInterface
2727
$categorySlug = $request->getAttribute('categorySlug');
2828
$article = $this->articleRepository->getArticleResource($slug, $categorySlug);
2929
$categories = $this->categoryRepository->getCategories();
30-
30+
$meta = $article;
3131
return new HtmlResponse(
3232
$this->template->render('page::blog-resource/' . $article->getCategory()->getSlug() . '/' . $slug, [
3333
'article' => $article,
34+
'meta' => $meta,
3435
'categories' => $categories,
3536
])
3637
);

src/Blog/templates/page/blog-resource/best-practice/aptana-set-svn-keywords.html.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ For example if you want to set the svn keyword property <em><strong>Id</strong><
3131
<ul>
3232
<li>In the file where you want to add the svn keyword property write <strong>$Id$</strong></li>
3333
</ul>
34-
<a href="http://www.dotkernel.com/wp-content/uploads/2011/04/id-file.gif"><img class="alignnone size-medium wp-image-1268" title="Write the ID keyword in the file" src="http://www.dotkernel.com/wp-content/uploads/2011/04/id-file-300x235.gif" alt="" width="300" height="235" / class="img-fluid rounded my-2"></a>
34+
<a href="/uploads/2011/04/id-file.gif"><img class="alignnone size-medium wp-image-1268" title="Write the ID keyword in the file" src="/uploads/2011/04/id-file-300x235.gif" alt="" width="300" height="235" / class="img-fluid rounded my-2"></a>
3535
<ul>
3636
<li>Right click on the file, then follow Team -&gt; Set Property...<strong> </strong><strong>Note*</strong>: <em>Set Property...</em> will not be active if you haven't first added the file to SVN: <em>Team</em>-&gt;<em>Add to Version Controller</em></li>
3737
</ul>
38-
<a href="http://www.dotkernel.com/wp-content/uploads/2011/04/set-property.gif"><img class="alignnone size-medium wp-image-1269" title="Select set property..." src="http://www.dotkernel.com/wp-content/uploads/2011/04/set-property-300x152.gif" alt="" width="300" height="152" / class="img-fluid rounded my-2"></a>
38+
<a href="/uploads/2011/04/set-property.gif"><img class="alignnone size-medium wp-image-1269" title="Select set property..." src="/uploads/2011/04/set-property-300x152.gif" alt="" width="300" height="152" / class="img-fluid rounded my-2"></a>
3939
<ul>
4040
<li>Select <strong>svn:keywords</strong>, and write <strong>Id</strong> in the text field <strong></strong></li>
4141
</ul>
42-
<a href="http://www.dotkernel.com/wp-content/uploads/2011/04/svn-keywords.gif"><img class="alignnone size-medium wp-image-1272" title="svn-keywords" src="http://www.dotkernel.com/wp-content/uploads/2011/04/svn-keywords-300x298.gif" alt="" width="300" height="298" / class="img-fluid rounded my-2"></a>
42+
<a href="/uploads/2011/04/svn-keywords.gif"><img class="alignnone size-medium wp-image-1272" title="svn-keywords" src="/uploads/2011/04/svn-keywords-300x298.gif" alt="" width="300" height="298" / class="img-fluid rounded my-2"></a>
4343

4444
When you make the SVN commit of the file, the <em>$Id$</em> keyword will be replaced with text in the format shown below:
4545

46-
<a href="http://www.dotkernel.com/wp-content/uploads/2011/04/id-file-svn.gif"><img class="alignnone size-medium wp-image-1276" title="Id keyword after commit" src="http://www.dotkernel.com/wp-content/uploads/2011/04/id-file-svn-300x141.gif" alt="" width="300" height="141" / class="img-fluid rounded my-2"></a>
46+
<a href="/uploads/2011/04/id-file-svn.gif"><img class="alignnone size-medium wp-image-1276" title="Id keyword after commit" src="/uploads/2011/04/id-file-svn-300x141.gif" alt="" width="300" height="141" / class="img-fluid rounded my-2"></a>
4747
</section>
4848
</article>
4949
</main>

src/Blog/templates/page/blog-resource/best-practice/svn-keywords-setup-in-php-ide-zend-studio.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Check the <strong>Apply property recursively to:</strong>
6363
Select <strong>All resources</strong>
6464
Check the <strong>Use filtration by the resource name </strong> and add <strong>Mask: </strong>*.php
6565

66-
<a href="http://www.dotkernel.com/wp-content/uploads/2013/02/svn-add.jpg"><img class="aligncenter size-full wp-image-1980" alt="svn-add" src="http://www.dotkernel.com/wp-content/uploads/2013/02/svn-add.jpg" width="589" height="668" / class="img-fluid rounded my-2"></a>
66+
<a href="/uploads/2013/02/svn-add.jpg"><img class="aligncenter size-full wp-image-1980" alt="svn-add" src="/uploads/2013/02/svn-add.jpg" width="589" height="668" / class="img-fluid rounded my-2"></a>
6767
</section>
6868
</article>
6969
</main>

src/Blog/templates/page/blog-resource/dotkernel/adding-windows-10-os-and-browser-detection-in-dotkernel-projects.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
In this article we will have the icon upgrade guide.
3030

31-
<a href="http://www.dotkernel.com/wp-content/uploads/2015/09/icons.png"><img class="size-full wp-image-2862" src="http://www.dotkernel.com/wp-content/uploads/2015/09/icons.png" alt="Icons Patch" width="232" height="162" / class="img-fluid rounded my-2"></a> The new Icons listed in User and Admin Logins
31+
<a href="/uploads/2015/09/icons.png"><img class="size-full wp-image-2862" src="/uploads/2015/09/icons.png" alt="Icons Patch" width="232" height="162" / class="img-fluid rounded my-2"></a> The new Icons listed in User and Admin Logins
3232

3333
<!--more-->
3434

src/Blog/templates/page/blog-resource/dotkernel/highcharts-integration-in-dotkernel-1-6-0.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<!--more-->
3030

3131
Also in admin we made some samples using highcharts. These samples includes an pie chart (with a small custom feature), an column chart and the last one is an line chart.
32-
<p style="text-align: center;"><a href="http://www.dotkernel.com/wp-content/uploads/2012/05/highcharts.png"><img class="aligncenter wp-image-1771" title="Highcharts" src="http://www.dotkernel.com/wp-content/uploads/2012/05/highcharts-1024x651.png" alt="" width="704" height="447" / class="img-fluid rounded my-2"></a></p>
32+
<p style="text-align: center;"><a href="/uploads/2012/05/highcharts.png"><img class="aligncenter wp-image-1771" title="Highcharts" src="/uploads/2012/05/highcharts-1024x651.png" alt="" width="704" height="447" / class="img-fluid rounded my-2"></a></p>
3333
You can find highcharts library in the <strong>externals </strong>directory.
3434

3535
Take a quick view on the code to see how highcharts are working.

src/Blog/templates/page/blog-resource/dotkernel/using-dotkernel-with-composer-dependencies.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Barcode::factory(
7272
<h4>The result</h4>
7373
Both the examples will render the following barcode if nothing goes wrong:
7474

75-
<a href="http://www.dotkernel.com/wp-content/uploads/2016/04/zend.barcode.introduction.example-1.png" rel="attachment wp-att-2948"><img class="size-full wp-image-2948" src="http://www.dotkernel.com/wp-content/uploads/2016/04/zend.barcode.introduction.example-1.png" alt="Resulting barcode. Source: http://framework.zend.com/images/manual/zend.barcode.introduction.example-1.png" width="275" height="61" / class="img-fluid rounded my-2"></a> Resulting barcode.<br />Source: bit.ly/1XbZZ81
75+
<a href="/uploads/2016/04/zend.barcode.introduction.example-1.png" rel="attachment wp-att-2948"><img class="size-full wp-image-2948" src="/uploads/2016/04/zend.barcode.introduction.example-1.png" alt="Resulting barcode. Source: http://framework.zend.com/images/manual/zend.barcode.introduction.example-1.png" width="275" height="61" / class="img-fluid rounded my-2"></a> Resulting barcode.<br />Source: bit.ly/1XbZZ81
7676
<h4>Tip</h4>
7777
In this case the first example will work for both namespaced an non-namespaced dependencies if we add the the following as the first line at the first example:
7878
<pre class="bg-light border rounded p-3 overflow-auto">>use Zend\Barcode\Barcode as Zend_Barcode;</pre>

0 commit comments

Comments
 (0)