file structure of big node js projects
Solution 1:
For my application, I am making a new ejs file for every blog article that I write. I am doing this because each blog article that I write has a different amount of pictures, different headings, etc. However, I am realizing that there are a lot of files building up.
Is there a better way of doing this?
You should be able to use the same EJS template for each blog entry, so "yes" there is a better way of doing it. For us to help more specifically, we would need to see how you're storing and naming your images and how you know which images go with which blog post. Shouldn't headings be part of the content itself which is unique for each blog post and not part of the EJS template?
Yes, the headings would be part of the content which is unique.. you are right. Now my question is... if every article should use the same ejs template, what do I do when articles have images in different places within the article? Or, how would I handle article one containing a list of steps while article two does not contain that list?
Can't your unique content for each blog contain EJS and insert it in a way that it gets processed as part of the template? So, you could use EJS commands in your content. Or, you could make your own simple tags in the content that your JS processes and inserts the right things (but it would be better to just let EJS do that work).