I made a Ruby on Rails web app in the past. Using RoR, there was a standard \"te
ID: 658361 • Letter: I
Question
I made a Ruby on Rails web app in the past. Using RoR, there was a standard "template" that was used for each page, and the content that was inserted into the "template" was all handled on the server side. For example, I defined a standard header and footer, and when a request was made for a specific page, the content for that page would get inserted inbetween the header and footer and then served to the client.
Currently, I'm using Firebase as the back-end database, real-time update engine (pub/sub), and tool for hosting a different web-app. Firebase hosting simply serves up static HTML/JS files, and the clients perform all of the heavy lifting (unlike RoR) for authentication, DOM-manipulation based on user, etc.
In this app, I have a standard header and footer that is used on every page, but my issue is that any change to the header/footer has to be made manually to each page.
So, my question is, is there a standard method (or tool, perhaps) that essentially would let one build in a template fashion, and then automatically "compile" to the separate HTML files that I could then let Firebase host? I'm not necessarily looking to use something like AngularJS, although I think it inherently addresses the issue.
An app with a few pages is easy to manage, but as the app grows things get hairy quickly and ensuring consistency becomes a cumbersome task.
The question: Static site generator with GUI, I believe is close to what I'm asking, but not quite the same. I'm not looking for a tool to generate a static site, but a tool for editing HTML in a templated fashion (and not necessarily with a slick GUI, I was thinking more of a text-based solution like some sort of plugin for Notepad++). Jekyll was recommended as an answer to the linked question, and seems to be a potential good solution, but I thought I'd see if there were others.
Explanation / Answer
I think a static site generator is what you need.
They are typically (but not necessarily) command-line tools:
You place template and content files in specific folders.
You run the tool.
You get the static HTML files.
You can now simply take all the generated HTML files and upload them.
There are so many solutions (see, for example, the lists on http://staticsitegenerators.net/ and https://www.staticgen.com/ to get an idea) that it
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.