Title: Writing On GitHub
Author: litefeel
Published: <strong>21 de març de 2017</strong>
Last modified: 6 d'abril de 2020

---

Cerca extensions

Aquesta extensió **no s’ha provat en les darreres 3 versions majors del WordPress**.
Segurament no està mantinguda o suportada, i pot tenir problemes de compatibilitat
quan s’usa en versions recents del WordPress.

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

# Writing On GitHub

 Per [litefeel](https://profiles.wordpress.org/litefeel/)

[Baixa](https://downloads.wordpress.org/plugin/writing-on-github.zip)

 * [Detalls](https://ca.wordpress.org/plugins/writing-on-github/#description)
 * [Ressenyes](https://ca.wordpress.org/plugins/writing-on-github/#reviews)
 *  [Instal·lació](https://ca.wordpress.org/plugins/writing-on-github/#installation)
 * [Desenvolupament](https://ca.wordpress.org/plugins/writing-on-github/#developers)

 [Suport](https://wordpress.org/support/plugin/writing-on-github/)

## Descripció

_A WordPress plugin to allow you writing on GitHub (or Jekyll site)._

Some code for this plugin comes from [WordPress GitHub Sync](https://github.com/mAAdhaTTah/wordpress-github-sync),
thanks.

Ever wish you could collaboratively author content for your WordPress site (or expose
change history publicly and accept pull requests from your readers)?

Well, now you can! Introducing [Writing On GitHub](https://github.com/litefeel/writing-on-github)!

#### Writing On GitHub does three things:

 1. Allows content publishers to version their content in GitHub
 2. Allows readers to submit proposed improvements to WordPress-served content via 
    GitHub’s Pull Request model

#### Writing On GitHub might be able to do some other cool things:

 * Allow teams to collaboratively write and edit posts using GitHub (e.g., pull 
   requests, issues, comments)
 * Allow you to sync the content of two different WordPress installations via GitHub
 * Allow you to stage and preview content before “deploying” to your production 
   server

#### How it works

The sync action is based on two hooks:

 1. A per-post sync fired in response to WordPress’s `save_post` hook which pushes 
    content to GitHub
 2. A sync of all changed files triggered by GitHub’s `push` webhook (outbound API 
    call)

## Instal·lació

#### Using the WordPress Dashboard

 1. Navigate to the ‘Add New’ in the plugins dashboard
 2. Search for ‘Writing On GitHub’
 3. Click ‘Install Now’
 4. Activate the plugin on the Plugin dashboard

#### Uploading in WordPress Dashboard

 1. Download `writing-on-github.zip` from the WordPress plugins repository.
 2. Navigate to the ‘Add New’ in the plugins dashboard
 3. Navigate to the ‘Upload’ area
 4. Select `writing-on-github.zip` from your computer
 5. Click ‘Install Now’
 6. Activate the plugin in the Plugin dashboard

#### Using FTP

 1. Download `writing-on-github.zip`
 2. Extract the `writing-on-github` directory to your computer
 3. Upload the `writing-on-github` directory to the `/wp-content/plugins/` directory
 4. Activate the plugin in the Plugin dashboard

#### Configuring the plugin

 1. [Create a personal oauth token](https://github.com/settings/tokens/new) with the`
    public_repo` scope. If you’d prefer not to use your account, you can create another
    GitHub account for this.
 2. Configure your GitHub host, repository, secret (defined in the next step), and 
    OAuth Token on the Writing On GitHub settings page within WordPress’s administrative
    interface. Make sure the repository has an initial commit or the export will fail.
 3. Create a WebHook within your repository with the provided callback URL and callback
    secret, using `application/json` as the content type. To set up a webhook on GitHub,
    head over to the **Settings** page of your repository, and click on **Webhooks &
    services**. After that, click on **Add webhook**.
 4. Click `Export to GitHub`

## PMF

  Markdown Support

Writing On GitHub exports all posts as `.md` files for better display on GitHub,
but all content is exported and imported as its original HTML. To enable writing,
importing, and exporting in Markdown, please install and enable [WP-Markdown](https://wordpress.org/plugins/wp-markdown/),
and Writing On GitHub will use it to convert your posts to and from Markdown.

You can also activate the Markdown module from [Jetpack](https://wordpress.org/plugins/jetpack/)
or the standalone [JP Markdown](https://wordpress.org/plugins/jetpack-markdown/)
to save in Markdown and export that version to GitHub.

  GitHub directory structure

    ```
    .
    ├── _pages
    |   └── 2007-10-29-some-pages.md
    ├── _posts
    |   └── 2009-04-26-some-posts.md
    └── images
        └── some-images # copy all files (include subdirectory) to wordpress
    ```

  Importing from GitHub

Writing On GitHub is also capable of importing posts directly from GitHub, without
creating them in WordPress before hand. In order to have your post imported into
GitHub, add this YAML Frontmatter to the top of your .md document:

    ```
    ---
    post_title: 'Post Title'
    post_name: 'this is post name'
    post_date: '2018-03-07 15:21:26'
    layout: post_type_probably_post
    published: true_or_false
    author: author_name
    tags:
        - tag_a
        - tag_b
    categories:
        - category_a
        - category_b
    ---
    Post goes here.
    ```

and fill it out with the data related to the post you’re writing. Save the post 
and commit it directly to the repository. After the post is added to WordPress, 
an additional commit will be added to the repository, updating the new post with
the new information from the database.

Note that Writing On GitHub will import posts from the `master` branch by default.
Once set, do not change it.

If Writing On GitHub cannot find the author for a given import, it will fallback
to the default user as set on the settings page. **Make sure you set this user before
you begin importing posts from GitHub.** Without it set, Writing On GitHub will 
default to no user being set for the author as well as unknown-author revisions.

  Contributing

Found a bug? Want to take a stab at [one of the open issues](https://github.com/litefeel/writing-on-github/issues)?
We’d love your help!

See [the contributing documentation](https://ca.wordpress.org/plugins/writing-on-github/CONTRIBUTING.md?output_format=md)
for details.

  Prior Art

 * [WordPress Post Forking](https://github.com/post-forking/post-forking)
 * [WordPress to Jekyll exporter](https://github.com/benbalter/wordpress-to-jekyll-exporter)
 * [Writing in public, syncing with GitHub](https://konklone.com/post/writing-in-public-syncing-with-github)
 * [WordPress GitHub Sync](https://github.com/mAAdhaTTah/wordpress-github-sync)

## Ressenyes

![](https://secure.gravatar.com/avatar/22b4ccd690a97713a37d6c52f9f58d444d0e8aeb0afc581bb1c410c33606aa34?
s=60&d=retro&r=g)

### 󠀁[Useful for WordPress.org 5.8.1](https://wordpress.org/support/topic/useful-for-wordpress-org-5-8-1/)󠁿

 [shanshanwang](https://profiles.wordpress.org/shanshanwang/) 18 de setembre de 
2021

It is really helpful. I already tried many ways to sync our website to GitHub, but
due to the big size of backup files, failed many times. And some plugins cannot 
be used properly in our current version. The plugin ‘Writing On GitHub’ works for
me. Thank you so much.

![](https://secure.gravatar.com/avatar/1c7177da55ca14773a22d6351fd12fdb617c58b673f840ae00033cdc74b5b7db?
s=60&d=retro&r=g)

### 󠀁[Working plugin](https://wordpress.org/support/topic/working-plugin-4/)󠁿

 [paoloumali](https://profiles.wordpress.org/paoloumali/) 3 de maig de 2020

Although it’s a Writing on Github plugin, I didn’t expect that one loses the edit
function in WordPress. Plugins should be supplementary and not remove an existing
functionality. A new post created in WordPress syncs to the Github repo but again,
when one’s to edit the page, which is typical, one has to do edit Markdown now in
Github? This may be usable in use cases where you need WordPress to start something
but when is that the case. WordPress is a blogging tool not an init tool. My 2 cents.
It syncs at the least. Edit: I initially gave this a 3 star because I was frustrated.
I’m back and giving it now a 4. It’s for free and it works. Probably it’s simply
there to supplement a Markdown repo to be used with Jekyll perhaps and not the other
way around.

![](https://secure.gravatar.com/avatar/36f9fbcc226a8c08a1bbfe80a258f22f3dedf474a417c5b9423db7ceab2f3f5a?
s=60&d=retro&r=g)

### 󠀁[Awesome plugin](https://wordpress.org/support/topic/awesome-plugin-2992/)󠁿

 [litefeel](https://profiles.wordpress.org/litefeel/) 7 de març de 2020

Awesome plugin

 [ Llegiu totes les 3 ressenyes ](https://wordpress.org/support/plugin/writing-on-github/reviews/)

## Col·laboradors i desenvolupadors

«Writing On GitHub» és programari de codi obert. La següent gent ha col·laborat 
en aquesta extensió.

Col·laboradors

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

“Writing On GitHub” s’ha traduït a 1 configuració regional. Gràcies als [traductors](https://translate.wordpress.org/projects/wp-plugins/writing-on-github/contributors)
per les seves aportacions.

[Traduïu «Writing On GitHub» a la vostra llengua.](https://translate.wordpress.org/projects/wp-plugins/writing-on-github)

### Interessats en el desenvolupament?

[Navegueu pel codi](https://plugins.trac.wordpress.org/browser/writing-on-github/),
baixeu-vos el [repositori SVN](https://plugins.svn.wordpress.org/writing-on-github/),
o subscriviu-vos al [registre de desenvolupament](https://plugins.trac.wordpress.org/log/writing-on-github/)
per [fisl de subscripció RSS](https://plugins.trac.wordpress.org/log/writing-on-github/?limit=100&mode=stop_on_copy&format=rss).

## Registre de canvis

#### 1.11

 * Fixed correct the url of files in the images directory

#### 1.10

 * Fixed cannot publish post from github in _draffts
 * Fixed cannot delete post from github
 * Change github path to /_posts/$year/$postname

#### 1.9

 * Fixed webhook error on apache server

#### 1.8

 * Apply post_date from github
 * Friendly error message when validate webhook event
 * Friendly error message when can not import

#### 1.7

 * Add an option to force import from github

#### 1.6.1

 * Compatible with wordpress 4.8.1
 * Add index.php

#### 1.6

 * Add Settings link on plugins page
 * Add an option of “Don’t export content”
 * Fixed cannot auto export to github when change frontmatter from github
 * Don’t export to github when has not changed
 * Reduce memory when import from github
 * Refactor the code to enhance stability

#### 1.5.1

 * Compatible with PHP5.0

#### 1.5

 * Add an option to ignore the author
 * Add an option to force export to github
 * Change permalink to link in frontmatter
 * Change export github commit message

#### 1.4

 * Ignore custom post meta
 * copy image files from /images/* to wp-content/uploads/writing-on-github/images/*

#### 1.3

 * Fixed backslash loss

#### 1.2

 * Add post_name to post meta
 * Add ignore metas to setting

#### 1.1

 * Transfer ownership

#### 1.0

 * Initial version

## Meta

 *  Versió **1.11**
 *  Darrera actualització **fa 6 anys**
 *  Instal·lacions actives **10+**
 *  Versió del WordPress ** 3.9 o posterior **
 *  Provada fins a **5.4.19**
 *  Idiomes
 * [Chinese (China)](https://cn.wordpress.org/plugins/writing-on-github/) i [English (US)](https://wordpress.org/plugins/writing-on-github/).
 *  [Traduïu a la vostra llengua](https://translate.wordpress.org/projects/wp-plugins/writing-on-github)
 * Etiquetes
 * [collaboration](https://ca.wordpress.org/plugins/tags/collaboration/)[content](https://ca.wordpress.org/plugins/tags/content/)
   [git](https://ca.wordpress.org/plugins/tags/git/)[Github](https://ca.wordpress.org/plugins/tags/github/)
   [version control](https://ca.wordpress.org/plugins/tags/version-control/)
 *  [Vista avançada](https://ca.wordpress.org/plugins/writing-on-github/advanced/)

## Valoracions

 4.7 sobre 5 estrelles.

 *  [  2 valoracions de 5 estrelles     ](https://wordpress.org/support/plugin/writing-on-github/reviews/?filter=5)
 *  [  1 valoració de 4 estrelles     ](https://wordpress.org/support/plugin/writing-on-github/reviews/?filter=4)
 *  [  0 valoracions de 3 estrelles     ](https://wordpress.org/support/plugin/writing-on-github/reviews/?filter=3)
 *  [  0 valoracions de 2 estrelles     ](https://wordpress.org/support/plugin/writing-on-github/reviews/?filter=2)
 *  [  0 valoracions de 1 estrelles     ](https://wordpress.org/support/plugin/writing-on-github/reviews/?filter=1)

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

[Visualitzeu totes les ressenyes](https://wordpress.org/support/plugin/writing-on-github/reviews/)

## Col·laboradors

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

## Suport

Teniu quelcom a dir? Necessiteu ajuda?

 [Visualitza els fòrums de suport](https://wordpress.org/support/plugin/writing-on-github/)

## Feu una donació

Voleu ajudar a què l’extensió millori?

 [ Feu una donació a aquesta extensió ](https://www.paypal.me/litefeel)