How to embed a large number of AVIF images in a single post for online book reading?

I rarely say this, but I’m not sure that Discourse is a good tool for your problem.

If you want to anyway, I’d probably do something like create a topic per book and maybe a post per chapter, if that makes any sense (maybe there are no chapters?).

Then you could use an import script that would read the directory name and create a topic and then do something like

files.each do |f|
   u=uploader.create_upload(1, f.path, f.filename)
   raw += uploader.html_for_upload(u, f.filename)
end

And then you would use that raw to create a topic.

You’d need to look in the import scripts directory to find some examples of creating topics, but that’s a rough idea.

And that would then put all the images in a single topic/post. And then there are some tools that will let you scroll through a bunch up images, I think. Perhaps someone else has paid more attention to those than I have.

1 Like