Skip to content
leowebguyPublic

About

No description or website provided.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Git Info plugin for Craft CMS

Output git info over Twig.

Requirements

This plugin requires:

  • Craft CMS: ^5.0.0
  • PHP: ^8.2 || ^8.3 || ^8.4 || ^8.5

Installation

Shell

composer require leowebguy/git-info -w && php craft plugin/install git-info

DDEV

ddev composer require leowebguy/git-info -w && ddev exec php craft plugin/install git-info

Usage

  • {{ craft.git.branch }} → Current branch (e.g. main, staging)
  • {{ craft.git.remoteUrl }} → Remote URL (e.g. github.com:leowebguy/git-info.git)
  • {{ craft.git.lastTag }} → Latest git tag (e.g. 2.1.0)
  • {{ craft.git.commitHash }} → Last commit hash
  • {{ craft.git.commitAuthor }} → Last commit author name
  • {{ craft.git.commitDate }} → Last commit date (YYYY/MM/DD HH:MM:SS)

Example

{% if not craft.app.config.custom.isProd %}
    <div style="position: fixed; bottom: 1rem; right: 1rem; padding: 6px 10px; text-align: right; border: solid 1px #eee; z-index: 999; background: #fff;">
        {{ 'branch: ' ~ craft.git.branch }}<br>
        {{ 'remote url: ' ~ craft.git.remoteUrl }}<br>
        {{ 'last tag: ' ~ craft.git.lastTag }}<br>
        {{ 'commit hash: ' ~ craft.git.commitHash }}<br>
        {{ 'commit author: ' ~ craft.git.commitAuthor }}<br>
        {{ 'commit date: ' ~ craft.git.commitDate }}
    </div>
{% endif %}

Screenshot

Development

# Static analysis (PHPStan level 8)
composer phpstan

# Code style testing (Pint)
composer pint-test

# Code style formatting (Pint)
composer pint

About

No description or website provided.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages