An open API service indexing awesome lists of open source software.

https://github.com/leowebguy/git-info


https://github.com/leowebguy/git-info

craft-cms craft-cms-plugin craft4 craft5 craftcms craftcms-plugin

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

Git Info plugin for Craft
===

Output git info over twig

### Installation

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

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

### Usage

`{{ craft.git.branch }}` >> current branch, i.e: stage

`{{ craft.git.remoteUrl }}` >> i.e: github.com:leowebguy/git-info.git

`{{ craft.git.lastTag }}` >> i.e: 3.1.2

`{{ craft.git.commitHash }}` >> last commit hash

`{{ craft.git.commitAuthor }}` >> last commit author (name)

`{{ craft.git.commitDate }}` >> last commit date

```twig
{% if not craft.app.config.custom.isProd %}


{{ 'branch: ' ~ craft.git.branch }}

{{ 'remote url: ' ~ craft.git.remoteUrl }}

{{ 'last tag: ' ~ craft.git.lastTag }}

{{ 'commit hash: ' ~ craft.git.commitHash }}

{{ 'commit author: ' ~ craft.git.commitAuthor }}

{{ 'commit date: ' ~ craft.git.commitDate }}

{% endif %}
```

![Screenshot](resources/ss1.png)