Eleventy Embedded Demo Plugin

Welcome to the example site!

Here we have a couple of embedded demos as an example.

Here we have one that is just HTML:

HTML
<h1>Welcome to demo 1!</h1>
<p>This is a plain HTML page, no styles or JavaScript</p>
Result

This is one that includes CSS:

HTML
<h1>Welcome to demo 2!</h1>
<p class="red">This text is red</p>
<p class="blue">This text is blue</p>
CSS
.red {
color: red;
}

.blue {
color: blue;
}
Result

And this is one that includes both CSS and JavaScript:

HTML
<h1>Welcome to demo 3!</h1>
<p>
The current time is:
<span class="time"></span>
</p>
CSS
.time {
font-weight: bold;
background-color: black;
padding: 0.5em;
color: limegreen;
font-family: "Courier New", Courier, monospace;
}
JavaScript
const timeElement = document.querySelector(".time");

function setTime() {
const now = new Date();
timeElement.innerHTML = `${now.getHours()}:${now
.getMinutes()
.toString()
.padStart(2, "0")}
:${now.getSeconds().toString().padStart(2, "0")}`
;
}

setInterval(setTime, 1000);
setTime();
Result