Luciano Mammino 𝕏 Node.js Design Patterns Profile picture
#AWS #Serverless Hero & MVP. Senior Architect @fourTheorem, author of 📕 https://t.co/Vhhe4G4GCN & ✉️ https://t.co/XMK2BWythj #Nodejs, #JavaScript, #Rust 🦀 & #Cloud ☁️

Sep 17, 2020, 8 tweets

@eleven_ty micro tip: Give eleventy some credit by injecting a "generator" meta tag in your HTML! 🔥

Frontpage and Dreamweaver used to get credit this way, why shouldn't we give Eleventy some credit too? 😇

(a short thread in 3 steps 👇)

STEP 1. Create a data file in `_data/site.js` with the following content:

STEP 2. Create your base layout `_includes/layout.njk` and use the variable `{{ site.generator }}`:

STEP 3. Just the use the base layout in your templates:

Now, if you happen to update eleventy to a new version, the generator tag will automatically be updated accordingly (note we are reading the version from eleventy's own `package.json` file).

That's it 👏

BONUS: If you like eleventy. check out this article I wrote about generating sitemaps with eleventy: dev.to/loige/create-a…

Since it's also my first article on Dev, please upvote it, share it and follow me 🙏

If you prefer the blog post version of this... dev.to/loige/add-a-ge…

Or if you prefer to read this tip as a less "micro" tutorial: dev.to/loige/add-a-ge…

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling