Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Zonelets (Starter Files)

A simple, free blogging engine for everyone! · By Zonelets

Question about editing the script.js

A topic by RobotLeanne created Aug 04, 2023 Views: 204 Replies: 3
Viewing posts 1 to 2
(+1)

Hello! Thank you so much for Zonelets. It's been so much fun playing around with html, something I've not done much of.

Here is my question and before that an explanation:

I want to make separate versions of my blog section, since I am planning on posting multiple different stories and I want to easily link to next and previous chapters without encountering the chapters from other stories. So my idea was to make a copy of the standard script.js, give it another name and also edit that name into the html pages to replace the standard script for the specific chapter pages.

So far I have everything working: the chapters link nicely and the page is fully functional, except for one thing: the title conversion is not working. So instead of a nice title and date based on the file name, I'm just getting the file name in the title, and writing the date and title in the html itself is not overwriting that.

I have replaced every "posts/" in the script with the title of the folder that my chapters are in, since it said in the file that that was something you can do, but is there perhaps something else I need to adjust?

Thank you so much for your time and help!

Developer

Hi, thanks for using Zonelets!

I have replaced every "posts/" in the script with the title of the folder that my chapters are in, since it said in the file that that was something you can do

Could you possibly point me to where you're reading this? This won't work by default, so I may need to rephrase anywhere I have implied this!

With the default Zonelets script as of version 1.52, you can't easily rename the posts folder without breaking the title/date parsing. This is because it looks for the date information an exact number of characters into the url string. Also, for example, the script relies on there being only one posts folder called "posts" to make the header links work. So I think those links might break if there was a single blog with posts in multiple different folders.

The neatest and most stable method to approximate what you're trying to do is, I think, to make multiple completely separate blogs. So each story has a fresh copy of the full Zonelets folder structure. Depending on how many stories you have, it might start to feel like a silly number of blogs, but I do think it would work! You could add header links to the other stories, or back to your home page on each story's blog. On my site, for instance, there is a Zonelet within a Zonelet (see the link "Puzzle Corner" in the header)

Otherwise, it might be worth looking into other options besides Zonelets or learning some Javascript to change Zonelets to suit your needs better!

Ah, thank you so much for your advice! I think I misinterpreted part of the explanation for the posts array.

*Each time you make a new post, add the filepath here at the top of postsArray.   This will cause all the right links to appear and work.
NOTE: It's important to follow this exact naming convention, because the scripts below are expecting it ( 'posts/YYYY-MM-DD-Title-of-Your-Post.html', ). You can alter the scripts if you want to use a different naming convention*/

I thought this meant "use a different naming convention" also applied to the "posts/" part.

I will look into your proposed solutions! Thank you so much for your time and have a nice day :)

Developer (1 edit)

I see! Thanks for the feedback! I'll have to change that confusing wording. I think I meant that you'd have to greatly change the code with a deeper understanding of Javascript if you wanted to achieve that effect.