Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send photo(s) in photo property, not as part of content property #69

Open
paulrobertlloyd opened this issue Sep 5, 2020 · 0 comments
Open

Comments

@paulrobertlloyd
Copy link

When posting a note with a photo, Icro sends the following request to a Micropub endpoint:

h = "entry"
name = ""
content = "Martello tower.\n" +  "![96053175-02F9-4950-86D7-F960971FE008.jpg(https://getindiekit.github.io/sandbox/media/photos/2020/09/05/6q5e4.jpg)"

However, if a post contains a photo, the photo(s) should be sent using the photo property. So in the above case, the following would be sent instead:

h = "entry"
name = ""
content = "Martello tower"
photo[] = "https://getindiekit.github.io/sandbox/media/photos/2020/09/05/6q5e4.jpg"
mp-photo-alt[] = "96053175-02F9-4950-86D7-F960971FE008.jpg"

This structured format has many benefits. First, it means a server can identify the type of post (note or photo) and potentially process it differently; perhaps using a different permalink format.

It also means authors can work with the content and photo(s) data individually. For example, with the current data provided, it’s not possible to output the following HTML:

<p>Martello tower</p>

<figure>
  <img src="https://getindiekit.github.io/sandbox/media/photos/2020/09/05/6q5e4.jpg" alt="">
  <figcaption><p>96053175-02F9-4950-86D7-F960971FE008.jpg</p></figcaption>
</figure>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant