-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
19 changed files
with
1,360 additions
and
97 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
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
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
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,22 @@ | ||
<?php | ||
|
||
namespace Grav\Plugin\Shortcodes; | ||
|
||
use Grav\Plugin\PageInjectPlugin; | ||
use Thunder\Shortcode\Shortcode\ShortcodeInterface; | ||
|
||
class PageInjectShortcode extends Shortcode | ||
{ | ||
public function init() | ||
{ | ||
$this->shortcode->getHandlers()->add('page-inject', function(ShortcodeInterface $sc) { | ||
$path = $sc->getParameter('path') ?? $sc->getBbCode(); | ||
return PageInjectPlugin::getInjectedPageContent('page-inject', $path); | ||
}); | ||
|
||
$this->shortcode->getHandlers()->add('content-inject', function(ShortcodeInterface $sc) { | ||
$path = $sc->getParameter('path') ?? $sc->getBbCode(); | ||
return PageInjectPlugin::getInjectedPageContent('content-inject', $path); | ||
}); | ||
} | ||
} |
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,30 @@ | ||
{ | ||
"name": "getgrav/page-inject", | ||
"type": "grav-plugin", | ||
"description": "Page & Content Injection for Grav", | ||
"keywords": ["shortcode"], | ||
"homepage": "https://github.com/getgrav/grav-plugin-content-inject/", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Team Grav", | ||
"email": "devs@getgrav.org", | ||
"homepage": "http://getgrav.org", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.1.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Grav\\Plugin\\PageInject\\": "classes" | ||
}, | ||
"classmap": ["page-inject.php"] | ||
}, | ||
"config": { | ||
"platform": { | ||
"php": "7.1.3" | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.