Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Add support for providing alt text #4

Open
wants to merge 3 commits into
base: glitch
Choose a base branch
from

Conversation

jamietanna
Copy link

To make published GIFs, via Micropub, more accessible, we should allow
alt text to be added to the images.

As per conversation on #3, this can't be reliably done through the
Gfycat API, so we should instead allow the user to provide this
information.

As we're using a JSON post, we need to construct an object for the
photo property as per https://micropub.spec.indieweb.org/#json-syntax

Closes #3.


I've not been able to test it as I've not gone through the process to set up with a Gfycat OAuth2 consumer, would you prefer that before we merge?

@martymcguire
Copy link
Owner

@jamietanna thanks for the patch! love that it is short and readable.

I would definitely appreciate it if you could test it out before merging. it would bring me great joy to know that at least one other person in the world has been able to get it up and running. 😅

It looks like we've been using JSON encoded requests, which is the
default method for the micropub-helper library.

Form-encoded is generally easier for servers to implement, and as we've
advertised on the /preview/ page, so we should try and use that instead
of JSON.

This requires a slightly different interface to use, so we need to
restructure how we send the request.
We can validate that it is both present, and has non-zero length to
prevent false positives.
To make published GIFs, via Micropub, more accessible, we should allow
alt text to be added to the images.

As per conversation on martymcguire#3, this can't be reliably done through the
Gfycat API, so we should instead allow the user to provide this
information.

As we're using a JSON post, we need to construct an object for the
photo property as per https://micropub.spec.indieweb.org/#json-syntax

Closes martymcguire#3.
@jamietanna
Copy link
Author

Sure thing! Check out https://pie-mesquite-environment.glitch.me/ for the updates. It looks like we're advertising we're using form-encoded requests, although we're sending JSON, so I've amended that - let me know if you'd prefer to stick with JSON.

The other thing that we should think about is the "Plumbing Details" section, which currently doesn't include the alt text - I think we'd have to do it via client-side JS, which I'm happy doing, just want to see your thoughts

@martymcguire
Copy link
Owner

@jamietanna wowow good find that the micropub client was actually sending JSON all along! 😅

Totally agree that the "Plumbing Details" section should be updated whenever the alt text entry is updated. As should the 'copy-and-paste-this' textarea that shows up for people who aren't signed in!

It's fun that so far Kapowski doesn't require any client-side JavaScript, so I'd love your thoughts on these options:

  • strongly encourage adding alt text by making it a fully separate step before preview is allowed
  • let them get on with it with client-side JS

@martymcguire
Copy link
Owner

martymcguire commented Jan 17, 2021

Thinking harder on this, I am wondering if it would be more widely-supported to resume sending JSON as before and update the Plumbing Details to reflect that.

For example, none of the micropub endpoints that I run have support for doing anything with mp-photo-alt... 🤔

@jamietanna
Copy link
Author

Hmm that's interesting. I've always assumed that form-encoded endpoints are more widespread 🤔 Happy to move it to back to JSON though, and see about inserting another page in the journey

@martymcguire
Copy link
Owner

@jamietanna haha i am not surprised that we have different assumptions! it may be the case that form-encoded-accepting endpoints are more common than json-accepting ones. however, mp-photo-alt is still marked as experimental, and i have a feeling that there are more JSON-accepting endpoints than there are 'form-encoded-and-mp-photo-alt-accepting' ones. 🤔

i'm definitely open to discussion on this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alt text for GIFs
2 participants