Ссылка на коммит в подвале
Требует установку гит-хуков
This commit is contained in:
@@ -13,6 +13,7 @@ class TwigFunctions extends AbstractExtension
|
||||
{
|
||||
return [
|
||||
new TwigFunction('config', [$this, 'config']),
|
||||
new TwigFunction('commit', [$this, 'commit']),
|
||||
new TwigFunction('is_file', [$this, 'is_file']),
|
||||
new TwigFunction('base_url', [$this, 'base_url']),
|
||||
];
|
||||
@@ -23,6 +24,11 @@ class TwigFunctions extends AbstractExtension
|
||||
return config($key, $default);
|
||||
}
|
||||
|
||||
public function commit(): string
|
||||
{
|
||||
return file_get_contents(root_path('commit'));
|
||||
}
|
||||
|
||||
public function base_url(string $path = ''): string
|
||||
{
|
||||
return base_url($path);
|
||||
|
||||
@@ -62,7 +62,12 @@
|
||||
<a href="{{ base_url('faq') }}">FAQ</a> | <a
|
||||
href="https://github.com/anthonyaxenov/iptv">GitHub</a> | <a
|
||||
href="https://git.axenov.dev/anthony/iptv">Gitea</a> | <a
|
||||
href="https://axenov.dev">axenov.dev</a>
|
||||
href="https://axenov.dev">axenov.dev</a><br>
|
||||
<span class="small text-muted">
|
||||
commit <a class="text-muted" target="_blank"
|
||||
href="https://github.com/anthonyaxenov/iptv/commit/{{ commit() }}"
|
||||
>{{ commit()[:8] }}</a>
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
{% if is_file("custom/custom.twig") %}
|
||||
|
||||
Reference in New Issue
Block a user