-
Notifications
You must be signed in to change notification settings - Fork 120
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
Feature Request: Add Alt Text to images #164
Comments
The library should support this. I'm planning to work on an NPF post creation method (#165). I suspect that will solve the issue as we should be able to add a content block like: {
type: "image",
alt_text: "The alternate text for the image block.",
//…
} |
I've added NPF support to tumblr.js. Media uploads as part of NPF post creation doesn't seem to work correctly right now. See tumblr/docs#88. There is a workaround I can propose, @nolanfilter. It involves uploading media by creating a legacy photo post, then using that media in an NPF post and adding tumblr.js/integration/write.mjs Lines 98 to 132 in 9d23608
This would look something like: const c = require('tumblr.js').createClient(CREDS);
const { id } = await c.createLegacyPost(MY_BLOG_ID, { ...params });
const {posts} = await c.blogPosts(MY_BLOG_ID, { id, npf: 'true' });
// Here we have our uploaded media object to use
const media = posts[0].content[0].media[0];
await c.editPost(MY_BLOG_ID, id, {content: [/* todo */]}) Note that this is for the 4.0 version that hasn't been released yet. |
Good news! This should be supported as of You can see a working example of how to post with the library in the integration test suite: tumblr.js/integration/write.mjs Lines 139 to 172 in 7845924
|
Hello! I'm using tumblr.js to upload a daily image post and would like to add alt text to the image. Currently I put the image description in the caption, but I'd like to match standard accessibility practices.
I'm using the createPhotoPost() method to post, but it doesn't allow for alt text in the options. I've also tried using the postRequest() method to post to the NPF endpoint, but the library isn't prepared to turn content blocks in the params object into a form (this is the issue I've run into).
Ideally the library would accept alt text as an option on post create methods. If that's not possible, is there a workaround you can suggest? Thank you!
The text was updated successfully, but these errors were encountered: