
內容簡介
使用自定義的 Github Commit 插件來顯示庫中最新更新的列表。此外,您可以使用短碼來添加提交列表或嵌入任何 Gist。
該插件將在一定的時間內緩存 GitHub 回應。您可以將此值更改為您已安裝的任何 WordPress 計劃(默認值:每小時,半天,每天)。要獲得更多時間框架,您需要一個擴展 cron 計劃的其他插件。
短碼
[gist id=’gist_id‘ ]
在您的文章中嵌入 gist。參數:
id(必填)要嵌入的 gist 的 ID。
[commits repository=’your-repository’ count=’max-count’ title=’your-title’]
顯示來自庫的最新提交。參數:
repository(必填)要獲取的庫的名稱。
count(可選)要檢索的提交數(按日期排序)。默認值:5
title(可選)列表前顯示的標題(h2)。默認值:無
[releases repository=’your-repository’ count=’max-count’ title=’your-title’]
顯示來自庫的最新發布。參數:
repository(必填)要獲取的庫的名稱。
count(可選)要檢索的發布數(按日期排序)。默認值:5
title(可選)列表前顯示的標題(h2)。默認值:無
[chart repository=’your-repository’ width=’chart-width’ height=’chart-height’ class=’additional-css-classes’ color=’bar-color’ background=’chart-background’ count=’commit-count’ title=’your-title’]
為指定的庫顯示活動圖表。參數:
repository(必填)要獲取的庫的名稱。
width(可選)圖表寬度。默認值:自動
height(可選)圖表高度。默認值:自動
class(可選)要添加到圖表元素的額外 CSS 類。默認值:“”
color(可選)圖表條形顏色。必須為有效的顏色字符串(rgb、hex 或名稱)。默認值:‘#f17f49’
background(可選)圖表背景顏色。必須為有效的顏色字符串(rgb、hex 或名稱)。默認值:‘transparent’
count(可選)要檢索的提交數(按日期排序)。默認值:30
title(可選)列表前顯示的標題(h2)。默認值:無
PHP 函數
請隨意在您的主題或插件開發中使用 Gihub 助手類。
<?php WP_Github_Tools_API::get_repos($user, $access_token); ?>
<?php WP_Github_Tools_API::get_user($user, $access_token); ?>
<?php WP_Github_Tools_API::get_commits($repo, $user, $access_token); ?>
<?php WP_Github_Tools_API::get_releases($repo, $user, $access_token); ?>
<?php WP_Github_Tools_API::get_gists($user, $access_token); ?>
貢獻!
如果您對新附加功能有建議,請隨時在 Twitter 上聯繫我。或者,您可以從 Gihub 上 fork 插件。
外掛標籤
開發者團隊
原文外掛簡介
Use the custom GitHub Commit widget to display a list of the latest updates from a repository. Additionally, you can use shortcodes to add commit lists or embed any gist.
The plugin will cache the GitHub response for a certain time period. You can change this value to any wordpress schedules you have isntalled (default: hourly, half-day, daily). To get more time frames you will need an additional plugin that extends the cron schedules.
Shortcodes
[gist id=’gist_id‘ ]
Embeds a gist in your post. Parameters:
id (required) The id of the gist you want to embed.
[commits repository=’your-repository’ count=’max-count’ title=’your-title’]
Displays the latest commits from your repository. Parameters:
repository (required) The name of the repository you wish to get.
count (optional) The number of commits to retrieve (order by date). Default: 5
title (optional) A title to display before the list (h2). Default: none
[releases repository=’your-repository’ count=’max-count’ title=’your-title’]
Displays the latest releases from your repository. Parameters:
repository (required) The name of the repository you wish to get.
count (optional) The number of releases to retrieve (order by date). Default: 5
title (optional) A title to display before the list (h2). Default: none
[chart repository=’your-repository’ width=’chart-width’ height=’chart-height’ class=’additional-css-classes’ color=’bar-color’ background=’chart-background’ count=’commit-count’ title=’your-title’]
Displays an activity chart for the given repository. Parameters:
repository (required) The name of the repository you wish to get.
width (optional) The width of the chart. Default: auto
height (optional) The height of the chart. Default: auto
class (optional) Additional CSS classes to add to the chart element. Default: ”
color (optional) The chart bar colors. Must be a valid color string (rgb, hex or name). Default: ‘#f17f49’
background (optional) The chart background color. Must be a valid color string (rgb, hex or name). Default: ‘transparent’
count (optional) The number of commits to retrieve (order by date). Default: 30
title (optional) A title to display before the list (h2). Default: none
PHP functions
Feel free to use the Gihub helper class in your theme or plugin development.
Contribute!
If you have suggestions for a new add-on, feel free to contact me on Twitter. Alternatively, you can fork the plugin from Gihub
