Title: Embed GitHub Gist
Author: dflydev
Published: <strong>2010 年 8 月 24 日</strong>
Last modified: 2012 年 12 月 13 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/embed-github-gist.svg)

# Embed GitHub Gist

 由 [dflydev](https://profiles.wordpress.org/dflydev/) 開發

[下載](https://downloads.wordpress.org/plugin/embed-github-gist.0.13.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/embed-github-gist/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/embed-github-gist/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/embed-github-gist/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/embed-github-gist/#developers)

 [技術支援](https://wordpress.org/support/plugin/embed-github-gist/)

## 外掛說明

This project is available for forking on GitHub:

 * https://github.com/dflydev/embed-github-gist

Embed [GitHub](http://github.com/) [Gists](http://gist.github.com) into
 WordPress.
Provides a shortcode for posts and pages but also has the ability to embed by hand
in the event that a Gist needs to be embedded somewhere in the page that does not
pass through the shortcode filters.

Examples:

    ```
    [gist id=546764]
    [gist id=546764 file=file.txt]
    [gist id=546764 file=file.txt bump=1]
    [gist]http://gist.github.com/546764[/gist]
    ```

Cache is implemented with the Transients API to minimize delay on loading
 content.
Default TTL (time to live) is 86400 seconds or one day.

#### Upcoming features:

 * Option for setting default TTL
 * Option to bypass cache entirely
 * Implement admin interface to control options

## 安裝方式

 1. Download the plugin zip file
 2. Unzip contents of plugin zip file
 3. Upload the embed-github-gist directory to the `/wp-content/plugins/` directory
 4. Activate the plugin through the ‘Plugins’ menu in WordPress
 5. Start using the plugin by adding Gists to posts!

## 常見問題集

  How can I fix rate limit exceded errors?

Define EMBED_GISTHUB_USERNAME and EMBED_GISTHUB_PASSWORD in wp-settings.php.

  Can the cache be broken?

Yes. Use a unique bump value to force cache to update. For instance, if you have

the following:

    ```
    [gist id=546764]
    ```

The cache can be broken by specifying a bump value:

    ```
    [gist id=546764 bump=1]
    ```

To break the cache again later, change to a new unique bump value:

    ```
    [gist id=546764 bump=2]
    ```

  Can I change the TTL on a Gist-by-Gist basis?

Yes. Specify a TTL (in seconds) like this:

    ```
    [gist id=546764 ttl=3600]
    ```

  Can I embed a Gist outside of a post or a page?

Yes.

    ```
    <?php echo embed_github_gist(546764); ?>
    ```

  Can I display a specific file from my gist?

Ues. You can use the `file` parameter:

    ```
    [gist id=546764 file=file.txt]
    ```

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Embed GitHub Gist〉的開發相關工作。

參與者

 *   [ dflydev ](https://profiles.wordpress.org/dflydev/)

[將〈Embed GitHub Gist〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/embed-github-gist)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/embed-github-gist/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/embed-github-gist/)，或透過 
[RSS](https://plugins.trac.wordpress.org/log/embed-github-gist/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/embed-github-gist/)。

## 變更記錄

#### 0.13

 * Looks at EMBED_GISTHUB_USERNAME and EMBED_GISTHUB_PASSWORD for API requests

#### 0.12

 * Bump release (“same as 0.11”)
 * Added upgrade notes

#### 0.11

 * Updated to account for recent changes to Gist.

#### 0.10

 * Bump release (“same as 0.9”)

#### 0.9

 * Fix js link bug. Thanks to wrightlabs.

#### 0.8

 * Better handle SSL errors. Thanks to gabesumner and CaioProiete.

#### 0.7

 * Edit to also include $file in cache key (thanks https://github.com/troufster)

#### 0.6

 * Embed stylesheet is now cached locally by default
 * Fixed small file-bug when using json

#### 0.5

 * Updates from oncletom (change default settings, works with new HTTPS URL from
   Gist)

#### 0.4

 * Bump release (“same as 0.2”)

#### 0.3

 * Bump release (“same as 0.2”)

#### 0.2

 * Added to support passing a Gist URL as the content of the [gist] shortcode.

#### 0.1

 * First release.

## 中繼資料

 *  版本 **0.13**
 *  最後更新 **14 年前**
 *  啟用安裝數 **100+**
 *  WordPress 版本需求 ** 2.8.6 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.5.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/embed-github-gist/)
 * 標籤:
 * [Gist](https://tw.wordpress.org/plugins/tags/gist/)[Github](https://tw.wordpress.org/plugins/tags/github/)
   [Highlight](https://tw.wordpress.org/plugins/tags/highlight/)[source](https://tw.wordpress.org/plugins/tags/source/)
   [syntax](https://tw.wordpress.org/plugins/tags/syntax/)
 *  [進階檢視](https://tw.wordpress.org/plugins/embed-github-gist/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  4 個 5 星使用者評論     ](https://wordpress.org/support/plugin/embed-github-gist/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/embed-github-gist/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/embed-github-gist/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/embed-github-gist/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/embed-github-gist/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/embed-github-gist/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/embed-github-gist/reviews/)

## 參與者

 *   [ dflydev ](https://profiles.wordpress.org/dflydev/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/embed-github-gist/)