Skip to content

Commit 2ec5db2

Browse files
1st version
1 parent 4e9cb8e commit 2ec5db2

23 files changed

+16148
-0
lines changed

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
js/src export-ignore
2+
.git* export-ignore
3+
4+
js/dist/*.js -diff

.npmignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/vendor
2+
composer.lock
3+
composer.phar
4+
node_modules
5+
.DS_Store
6+
Thumbs.db
7+
tests/.phpunit.result.cache
8+
/tests/integration/tmp
9+
.vagrant
10+
.idea/*
11+
.vscode

LICENSE.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) <year> <copyright holders>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Og Meta Tag
2+
3+
![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/justoverclock/og-meta-tag.svg)](https://packagist.org/packages/justoverclock/og-meta-tag) [![Total Downloads](https://img.shields.io/packagist/dt/justoverclock/og-meta-tag.svg)](https://packagist.org/packages/justoverclock/og-meta-tag)
4+
5+
A [Flarum](http://flarum.org) extension. Add Open Graph Meta Tag to Flarum
6+
7+
### Installation
8+
9+
Install with composer:
10+
11+
```sh
12+
composer require justoverclock/og-meta-tag:"*"
13+
```
14+
15+
### Updating
16+
17+
```sh
18+
composer update justoverclock/og-meta-tag:"*"
19+
php flarum migrate
20+
php flarum cache:clear
21+
```
22+
23+
### Links
24+
25+
- [Packagist](https://packagist.org/packages/justoverclock/og-meta-tag)
26+
- [GitHub](https://github.com/justoverclock/og-meta-tag)
27+
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)

composer.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "justoverclock/og-meta-tag",
3+
"description": "Add Open Graph Meta Tag to Flarum",
4+
"keywords": [
5+
"open graph",
6+
"meta tag"
7+
],
8+
"type": "flarum-extension",
9+
"license": "MIT",
10+
"require": {
11+
"flarum/core": "^1.0"
12+
},
13+
"require-dev": {
14+
"flarum/testing": "^1.0"
15+
},
16+
"authors": [
17+
{
18+
"name": "Marco Colia",
19+
"email": "[email protected]",
20+
"role": "Developer",
21+
"homepage": "https://flarum.it"
22+
}
23+
],
24+
"autoload": {
25+
"psr-4": {
26+
"Justoverclock\\OgMetaTag\\": "src/"
27+
}
28+
},
29+
"extra": {
30+
"flarum-extension": {
31+
"title": "Og Meta Tag",
32+
"category": "",
33+
"icon": {
34+
"name": "fas fa-code",
35+
"backgroundColor": "green",
36+
"color": "white"
37+
}
38+
},
39+
"flagrow": {
40+
"discuss": ""
41+
}
42+
}
43+
}

extend.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/*
4+
* This file is part of justoverclock/og-meta-tag.
5+
*
6+
* Copyright (c) 2021 Marco Colia.
7+
* https://flarum.it
8+
*
9+
* For the full copyright and license information, please view the LICENSE.md
10+
* file that was distributed with this source code.
11+
*/
12+
13+
namespace Justoverclock\OgMetaTag;
14+
15+
use Flarum\Extend;
16+
use Flarum\Frontend\Document;
17+
18+
return [
19+
(new Extend\Frontend('forum'))
20+
->js(__DIR__ . '/js/dist/forum.js')
21+
->css(__DIR__ . '/resources/less/forum.less')
22+
->content(function (Document $document) {
23+
$SiteName = resolve(\Flarum\Settings\SettingsRepositoryInterface::class)->get('justoverclock-og-meta-tag.SiteName');
24+
$OgImage = resolve(\Flarum\Settings\SettingsRepositoryInterface::class)->get('justoverclock-og-meta-tag.OgImage');
25+
$OgDescription = resolve(\Flarum\Settings\SettingsRepositoryInterface::class)->get('justoverclock-og-meta-tag.OgDescription');
26+
$OgTitle = resolve(\Flarum\Settings\SettingsRepositoryInterface::class)->get('justoverclock-og-meta-tag.OgTitle');
27+
$OgUrl = resolve(\Flarum\Settings\SettingsRepositoryInterface::class)->get('justoverclock-og-meta-tag.OgUrl');
28+
$document->head[] = '<meta property="og:site_name" content="' . $SiteName . '">
29+
<meta property="og:type" content="website">
30+
<meta property="og:image" content="' . $OgImage . '">
31+
<meta property="og:description" content="' . $OgDescription . '">
32+
<meta property="og:title" content="' . $OgTitle . '">
33+
<meta property="og:url" content="' . $OgUrl . '">';
34+
}),
35+
(new Extend\Frontend('admin'))
36+
->js(__DIR__ . '/js/dist/admin.js')
37+
->css(__DIR__ . '/resources/less/admin.less'),
38+
new Extend\Locales(__DIR__ . '/resources/locale'),
39+
];
40+

js/.prettierrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 150,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5"
6+
}

js/admin.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src/admin';

js/dist/admin.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/admin.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/forum.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)