forked from imorland/html-head
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8100160
Showing
37 changed files
with
6,667 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
js/src export-ignore | ||
.git* export-ignore | ||
|
||
js/dist/*.js -diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Build JavaScript assets | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- uses: flarum/action-build@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
vendor | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MIT License Copyright (c) 2021 Ian Morland | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# HTML Head | ||
|
||
![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/ianm/htmlhead.svg)](https://packagist.org/packages/ianm/htmlhead) | ||
|
||
A [Flarum](http://flarum.org) extension. Add custom items to the <head> array | ||
|
||
### Installation | ||
|
||
Install manually with composer: | ||
|
||
```sh | ||
composer require ianm/htmlhead | ||
``` | ||
|
||
### Updating | ||
|
||
```sh | ||
composer update ianm/htmlhead | ||
``` | ||
|
||
### Links | ||
|
||
- [Packagist](https://packagist.org/packages/ianm/htmlhead) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "ianm/html-head", | ||
"description": "Add custom items to the HTML <head> attributes", | ||
"keywords": [ | ||
"flarum", "headers", "html", "head", "custom" | ||
], | ||
"type": "flarum-extension", | ||
"license": "MIT", | ||
"support": { | ||
"issues": "https://github.com/imorland/html-head/issues", | ||
"source": "https://github.com/imorland/html-head", | ||
"forum": "https://discuss.flarum.org" | ||
}, | ||
"require": { | ||
"flarum/core": "^0.1.0-beta.15" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "IanM", | ||
"homepage": "https://discuss.flarum.org/u/ianm" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"IanM\\HtmlHead\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"flarum-extension": { | ||
"title": "HTML Head Items", | ||
"category": "other", | ||
"icon": { | ||
"name": "fas fa-heading", | ||
"backgroundColor": "#008000", | ||
"color": "#fff" | ||
} | ||
}, | ||
"flagrow": { | ||
"discuss": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of ianm/htmlhead. | ||
* | ||
* Copyright (c) 2021 IanM. | ||
* | ||
* For the full copyright and license information, please view the LICENSE.md | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace IanM\HtmlHead; | ||
|
||
use Flarum\Extend; | ||
use Flarum\Frontend\Document; | ||
use IanM\HtmlHead\Api\Controllers; | ||
use Illuminate\Database\Eloquent\Collection; | ||
|
||
return [ | ||
|
||
(new Extend\Frontend('admin')) | ||
->js(__DIR__.'/js/dist/admin.js') | ||
->css(__DIR__.'/resources/less/admin.less'), | ||
|
||
new Extend\Locales(__DIR__ . '/resources/locale'), | ||
|
||
(new Extend\Frontend('forum')) | ||
->content(function (Document $document) { | ||
/** @var Collection */ | ||
$headCollection = Header::where('active', 1)->get(); | ||
|
||
/** @var Header $headItem */ | ||
foreach ($headCollection as $headItem) { | ||
$document->head[] = $headItem->header; | ||
} | ||
}), | ||
|
||
(new Extend\Routes('api')) | ||
->get('/html-headers', 'ianm.html-headers.index', Controllers\ListHeadersController::class) | ||
->post('/html-headers', 'ianm.html-headers.create', Controllers\CreateHeaderItemController::class) | ||
->patch('/html-headers/{id}', 'ianm.html-headers.update', Controllers\UpdateHeaderItemController::class) | ||
->delete('/html-headers/{id}', 'ianm.html-headers.delete', Controllers\DeleteHeaderItemController::class), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/admin'; |
Oops, something went wrong.