💾 Archived View for jacksonchen666.com › posts › 2023-07-15 › 20-11-50 › index.gmi captured on 2023-07-22 at 16:23:16. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2023-11-04)

-=-=-=-=-=-=-

Idea: The Cat Templating Engine

2023-07-15T20:11:50Z

I setup a Gemini version on my website, then got really annoyed at something.

Long story short: WHY CAN'T HUGO JUST WORK GOSH DARN IT AAAAAAAAAAAAAA

You see, Hugo is the thing that makes my website. It's a static site generator (SSG for short).

So here's my idea: Instead of a super specific specialized static site generator made for HTML and the web specifically, you have what I would call the cat templating engine.

It has nothing to do with pet cats, just concatenating multiple files together to make a complete one.

So in your main files, you have... anything, except the special snippets that indicate that "something else will be inserted into here". Those will be replaced by a template file, or another normal file.

Here's a rough made up example:

Testing texting through the trouble
{{ include another.txt }}
And what did you expect from the trouble

The snippet `{{ include another.txt }}` will be replaced by the contents of the file named `another.txt`.

That's the idea. It's basically find and replace but automated and you specify files instead of the replacement string.

Is there anything like that?

Well, it seems like there's Server Side Includes. In fact, there's a `include` directive which seems to do what my idea is.

Service Side Includes

But for what I know, I don't know anything like that exist in a more general context, rather than only with HTML and... maybe some static site generators but with a lot of other things we don't care much about.

How would this be helpful? Well, let's say you write HTML by hand. You have a navigation bar thing that's the same on every page. How do you keep that up to date?

Well, you could put it in one central file, run the cat templating engine and out you get is HTML pages with the same navigation, instead of sometimes missing some navigation because it got out of date whatever.

(Fun fact: That was pretty much my scenario back in the day of this website. I had raw HTML, consistent across pages, and I would have to replace many of my navigation things because I updated the navigation.)

Is this a good idea? I don't know. I am dumping this on the internet and you do you now.

public inbox (comments and discussions)

public inbox archives

(mailing list etiquette for public inbox)