mAAdhaTTah / wordpress-github-sync

A WordPress plugin to sync content with a GitHub repository (or Jekyll site)
https://wordpress.org/plugins/wp-github-sync/
GNU General Public License v3.0
613 stars 99 forks source link

Import from github doesn't update but creates a new page #197

Closed MaxVMH closed 6 years ago

MaxVMH commented 6 years ago

Hi,

First of all, thanks for this plugin. It's exactly what I have been looking for and I'm looking forward to contribute in whatever way I can.

I'm importing this file in my WordPress installation. Everytime I press import in WordPress, it creates a new page instead of updating the current one. I couldn't find anything about updating existing pages in the Wiki.

Is this a bug? Is it expected behavior? Am I missing something in my file?

MaxVMH commented 6 years ago

@mAAdhaTTah I found your writing repository and looked at the header, looks like I needed to set an ID.

Looks like this can close :)

mAAdhaTTah commented 6 years ago

Glad you ever able to solve it! Let me know if you have other problems.

MaxVMH commented 6 years ago

Well, I was wondering if is possible to disable comments for a post or page in GitHub before syncing to WordPress, or is it something I should do in WordPress?

Also, should I keep track of ID's myself or is there another way to automatically assign them?

If there is a more appropriate way of asking about these things (support forum?), let me know ;)

mAAdhaTTah commented 6 years ago

Well, I was wondering if is possible to disable comments for a post or page in GitHub before syncing to WordPress, or is it something I should do in WordPress?

GitHub has issues, which you can disable. You don't really comment on "files" on GitHub, but you can comment on commits. Obviously, you can disable comments in WordPress, but that has no impact on GitHub.

Also, should I keep track of ID's myself or is there another way to automatically assign them?

When you publish a new post on WordPress and export it, it will be exported with the post id. If you create the post in the repo and commit it to GitHub, the syncing process should import the post the update the file with the post ID.

If there is a more appropriate way of asking about these things (support forum?), let me know ;)

This is fine, I don't have a specific support forum or anything :).

MaxVMH commented 6 years ago

GitHub has issues, which you can disable. You don't really comment on "files" on GitHub, but you can comment on commits. Obviously, you can disable comments in WordPress, but that has no impact on GitHub.

What I mean if there is something like allow_comments: false to set in the header of a GitHub file so that when it syncs to WordPress, comments are disabled in WordPress.

When you publish a new post on WordPress and export it, it will be exported with the post id. If you create the post in the repo and commit it to GitHub, the syncing process should import the post the update the file with the post ID.

OK, I figured out what went wrong on my side: the access token didn't have control of the repo which meant that there was no sync going on (I only imported the GitHub repo into WordPress).