Code Monkey home page Code Monkey logo

git-it-write's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

git-it-write's Issues

Use of .html files, without conversion

Hi. What do you think about the possibility to upload also ".html" files where there is no Markdown->HTML conversion.

I have post content with more than just Markdown text, as it contains more complex HTML/WordPress content, such as:

[sc name="shorturl"][/sc]

<p class="article_description">[icon name="chevron-right" prefix="fas"] Demo text 1234.<p>

<img class="article-image" src="/media/demo/picture1.gif" alt="" />

<h2>Characteristics</h2>

EDIT: I just see in the FAQ that it is already being planned. I would be very happy if the feature was developed in the future. Actually, everything necessary has already been programmed. I need it for a complex multilingual documentation setup.

Github Webhook generate a 401 error

I defined a Github Webhook with a secret that has been also defined in the Git-it-write setting section.
But the webhook notifications doesn't seem to work:
Request:

Request URL: https://myserver.com/wp-json/giw/v1/publish
Request method: POST
Accept: */*
content-type: application/json
User-Agent: GitHub-Hookshot/xxxxxxx
X-GitHub-Delivery: xxxxxxxxx
X-GitHub-Event: push
X-GitHub-Hook-ID: xxxxxxxxxxxxx
X-GitHub-Hook-Installation-Target-ID: xxxxxxxx
X-GitHub-Hook-Installation-Target-Type: repository
X-Hub-Signature: sha1=xxxxxxxxxxxxxxxxx
X-Hub-Signature-256: sha256=xxxxxxxxxxxxx

Response: 401

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you are authorized to access the document
requested.  Either you supplied the wrong credentials (e.g., bad password), or your
browser doesn't understand how to supply the credentials required.</p>
<p>Additionally, a 401 Unauthorized error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

I didn't define Authentication settings (Github Username and Github Access token)
and the manual Pull Post works as expected.

Any idea what could be the issue ?
Thanks
Yann

Post property "post_status" doesn't work properly

When I make a git push to my repository I have an HTTP Error 500 in the webhook log due to the Yaml post_status: draft configuration in the .md post file. I tried the other values to post_status and doesn't work. The only ones that works right is post_status: publish

---

title: Title of this post
menu_order: 1
post_status: draft  # <-- it does not work!! (HTTP Error 500)
post_excerpt: Excerpt of this post.
taxonomy:
    category:
        - Javascript
    post_tag:
        - Javascript-config
        - VSCode

---

# Title post

The rest of the content...

webhook bug

[13-Apr-2022 07:32:51 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function download_url() in /www/wwwroot/multisite/wp-admin/includes/media.php:1026
Stack trace:
#0 /www/wwwroot/multisite/wp-content/plugins/git-it-write/includes/publisher.php(294): media_sideload_image()
#1 /www/wwwroot/multisite/wp-content/plugins/git-it-write/includes/publisher.php(346): GIW_Publisher->upload_images()
#2 /www/wwwroot/multisite/wp-content/plugins/git-it-write/includes/publish-handler.php(36): GIW_Publisher->publish()
#3 /www/wwwroot/multisite/wp-content/plugins/git-it-write/includes/publish-handler.php(67): GIW_Publish_Handler::publish_by_id()
#4 /www/wwwroot/multisite/wp-content/plugins/git-it-write/includes/webhook.php(74): GIW_Publish_Handler::publish_by_repo_full_name()
#5 /www/wwwroot/multisite/wp-includes/rest-api/class-wp-rest-server.php(1141): GIW_Webhook::handle_webhook()
#6 /www/wwwroot/multisite/wp-includes/rest-api/class-wp-rest-server.php(988): WP_REST_Server->respond_to_request()
#7 /www/wwwroot/multisite/wp-includes/rest-api/class-wp-rest-se in /www/wwwroot/multisite/wp-admin/includes/media.php on line 1026

When webhook is called, WordPress makes an error.

ability to upload images from sub folders

Images have to present only in _images folder in the repository root.
It would be very convenient to accept images from subfolders containing an _images folder so that images in the git repo containing several dirs are not mixed with others (useful in the blog post usecase for instance)

Featured image

Hello vaakesh thank you for this interesting project. Can I ask how to set the featured image in a post?

Add a post property for featured image, please

It would be cool if anybody could add a feature image directly from post properties into the Yaml configguration of the post .md file. Something like this:

---

title: Title of this post
menu_order: 1
post_status: draft
post_excerpt: Excerpt of this post.
post_featured_image: /_images/featured_image.jpg  # <-- featured image URL in a new yaml post property
taxonomy:
    category:
        - Javascript
    post_tag:
        - Javascript-config
        - VSCode

---

# Title post

The rest of the content...

Images not uploaded with private Github repo

Hello,
I configured the plugin (Git-it-write 1.6) to use a private Github repo.
So I configured the Github username + Access token
but the images (located in the _images directory) are not uploaded
And I get the following error: " Image upload failed for some reason"

11/27/2022 08:28 - Starting image chain
11/27/2022 08:28 - Uploading image chain
11/27/2022 08:28 - {"type":"file","raw_url":"https:\/\/raw.githubusercontent.com\/sokube\/blogs-private\/main\/_images\/chain.png","github_url":"https:\/\/github.com\/sokube\/blogs-private\/blob\/main\/_images\/chain.png","sha":"3793f048d95239d3ddadc9d1f48ca3727e417f65","file_type":"png"}
11/27/2022 08:28 - Image upload failed for some reason

I noticed that the access token is not appended to the query (https://raw.githubusercontent.com/....?token=XXX)

Switching to a public repo make it works...

Integrate with utterances

Would be nice to see an integration example with utterances comments where the comments created with utterances reference the files properly

Can't find my repository

Hello!

I am having problems with the plugin, and i don't know what is happening...

image

Since my repo is public, i don't need any creedentials but the repo was not found. I dont know if the problem is the URL. Could you help me?

special characters not supported in post properties

special characters like single quote (') or colon (:) in post properties (Title, post_excerpt, ...)
Generate error when synchronizing articles:

Fatal error: Uncaught Symfony\Component\Yaml\Exception\ParseException: Unable to parse at line 6 (near "Il s'intègre particulièrement..."

Get GitHub info

Is there a way to retrieve the github credentials in php? I am working on a news aggregator theme and it requires git-it-write so it would be better if I could just retrieve the github credentials programmatically instead of asking the user to enter them into a separate settings page.

HTML/CSS is bugging

Hello,

I really like your plugin and use it frequently.

However, I'm experiencing an issue with CSS code.

When I use the following code in my Github .md file:

<style> h1 { color: red; } </style>

Only this part seems to be applied:

h1 {
color: red;
}

I have no idea where the <style> tag has gone.

Support Posts

Currently, the git-it-write plugin works with Pages well but not the same with Posts. Default Posts are not hierarchical but chronological. For example, all folders will be posted as empty posts. And "pull changes only" create new posts with the same name instead of apply changes to the older ones. Setting the names of parent folder of .md files as their "categories" would be reasonable.

Error when pushing md file with image

Hi,

I am trying to push to Wordpress a md file that contains text and one image but I get the error reported in the log below.
Both the md file and the image are located on the main branch, the md file in a folder called "post/en/travels/" and the image in a folder called "_images/".
Wordpress is configured to pull from the folder "post" only and to publish according to the format "post".
In the md file, I tried to reference the image by using the relative path or the absolute path, but none of the two worked.

Any hints what could be the reason and how to fix it?

Thank you very much for your help.

log.txt

Custom taxonomy

How do i add a custom taxonomy to a post.

For example, my post has one to many tags, one to many categories, and one publisher. The custom taxonomy publisher is a clone of the category type.

require_once missing, and paths not working.

Hi there,

you've an awesome plugin there. I blogged about it here: http://www.mnott.de/obsidian-for-wordpress/. I had to do some modifications, as I wrote on that blog - I had to require_once media.php, file.php and image.php, and also I had to do some changes in parsedown.php so that I could make the image paths work.

Also, updating a post sometimes seems not to happen at all - I don't know how long to wait for it to actually appear on the page. I think it will do it eventually, but sometimes it is instantaneous, sometimes not really. Look at the Caveats at the bottom of the page.

But regardless; I use it together with Obsidian, which has a huge community. I think your plugin is really great. Thanks!

All posts duplicate

Every time I write a new post, and commit/push, all the old posts are duplicated.

  • Using webhook
  • There should be a configuration to allow only new posts to be published

Thanks

ability to configure the slug through post properties

As mentionned in the doc:

Git it write considers the file name as the post slug i.e if the name of the file is getting-started.md then the post slug is getting-started.

Would it be possible to configure the slug through post properties
So that it is explicit and make it possible to have 2 files in the same dir with the same slug
usecase with multi-lang where the slang is the same and the lang is in the url of the link:

  • my-domain.com/en/blog/my-blog-post
  • my-domain.com/fr/blog/my-blog-post

Export wordpress posts to markdown

This might be a bit much to ask for, as this plugin already does a lot. However, I think this plugin could be a lot more popular if there is an ability to export existing wordpress posts into the markdown format used by the plugin. What do you think?

Plugin cannot be activated due to missing files (composer instructions in README missing)

The 'vendor' directory is included in git ignore, which makes sense.

Checked v1.5 and v1.6. The released ZIPs do not include the generated composer files.
Option A: include vendor directory in released packages

In addition, the README does not mention to run composer after unpacking the files and before activating the plugin in WordPress.
Option B: amend installation section in README

Unable to pull files that have multiple "." in the filename

I have a bunch of release notes that have filenames in the format of "Server-12.3.0.md" where the version in the file name uses "." as the separator between the major, minor and patch numbers. These files are not imported by git-it-write. If I change the filename to use "_" as the separator then the file imports.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.