geno7 / Rarebit

a template for webcomic hosting intended for use with NeoCities, but it can be used virtually anywhere. created to be as user-friendly and feature-rich as possible while staying vanilla.
GNU General Public License v3.0
44 stars 2 forks source link

Modifying Rarebit to display multimedia pages instead of only image files #6

Closed thrillschillskills closed 1 year ago

thrillschillskills commented 1 year ago

I'm mirroring a (solved) question I posted on StackOverflow in case it's useful to anyone here.

I needed to modify Rarebit to display a multimedia webcomic - where some pages may include text in HTML elements after or between images, some pages may include or be videos, etc. ( Like Homestuck/MSPA. )

User James posted this solution:

You can't specify more than one image extension as it is. In comic-settings.js there is a pgData object which defines some of the data for all the pages. You could add a new property to each object of pgData, "content", which would be a string containing the html content for that page. Then you would have to rewrite writePage to display "content" instead of the thing it's doing with images. Your images would then be tags inside the new content properties so you could specify whatever filenames/extensions you like.

This worked perfectly, although I mangled the code pretty aggressively in the process. Posting it here so others can use it.