Skip to content

Commit 10ee751

Browse files
committed
Fix #375, Add config option to add og:properties
1 parent 9d6cbf6 commit 10ee751

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

config/hyde.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,25 @@
7171
|--------------------------------------------------------------------------
7272
|
7373
| While you can add any number of meta tags in the meta.blade.php component,
74-
| this config setting allows you to easily customize some common metadata
75-
| tags so increase your SEO score. You can keep them to their defaults
76-
| or you can set a value to false or null to disable it completely.
74+
| these settings allow you to easily add tags for the meta component.
7775
|
78-
| Note that some tags may be overwritten on certain pages, for instance post pages.
79-
|
80-
| Tip: See https://www.w3schools.com/tags/att_meta_name.asp
81-
| for a list of tags and what they are for.
76+
| The `meta` array is for standard meta tags. See the examples below.
77+
| The `og` array is for Open Graph properties. Do not include the `og:` prefix.
8278
|
8379
*/
8480

8581
'meta' => [
8682
// 'author' => 'Mr. Hyde',
83+
// 'twitter:creator' => '@hyde_php',
8784
// 'description' => 'My Hyde Blog',
8885
// 'keywords' => 'Static Sites, Blogs, Documentation',
8986
'generator' => 'HydePHP '.Hyde\Framework\Hyde::version(),
9087
],
9188

89+
'ogProperties' => [
90+
'site_name' => $siteName,
91+
],
92+
9293
/*
9394
|--------------------------------------------------------------------------
9495
| Features
+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
{{-- Config Defined Tags --}}
1+
{{-- Config Defined Meta Tags --}}
22
@foreach (config('hyde.meta', []) as $name => $content)
33
<meta name="{{ $name }}" content="{{ $content }}">
44
@endforeach
55

6-
{{-- Add any extra tags to include in the <head> section --}}
7-
<meta property="og:site_name" content="{{ config('hyde.name', 'HydePHP') }}">
6+
@foreach (config('hyde.ogProperties', []) as $property => $content)
7+
<meta property="og:{{ $property }}" content="{{ $content }}">
8+
@endforeach
89

9-
{{-- Add any extra meta tags to include after the others --}}
10+
{{-- Add any extra tags to include in the <head> section --}}
1011
@stack('meta')
12+

0 commit comments

Comments
 (0)