11ty

11ty

548 bookmarks
Newest
How to add syntax highlighting to code as a user types in realtime with vanilla JavaScript
How to add syntax highlighting to code as a user types in realtime with vanilla JavaScript
On Monday, I shared a new interactive Code Sandbox I had built using vanilla JavaScript, and explained how I live render code into an iframe. Today, I wanted to share how I syntax highlight code as the user types in real time. Let’s dig in! The one simple trick that makes this work! I tried a bunch of things to get this to work, but the trick that made it happen ended up being stupidly simple.
·gomakethings.com·
How to add syntax highlighting to code as a user types in realtime with vanilla JavaScript
Nested Nunjucks For Loop
Nested Nunjucks For Loop
I am trying to write a nunjucks template that loops through an outer array and populates columns, then loops through a nested array to make rows in each column. So, my data structure looks something
·stackoverflow.com·
Nested Nunjucks For Loop
Loop.index - select 2 images/photos per element rendered - Support - Grav Community Forum
Loop.index - select 2 images/photos per element rendered - Support - Grav Community Forum
I am trying to select 2 media elements per div rendered using the receptar theme in each rendering of blog_item element. In other words, I need to display a container that holds divs, where each div displays two images. The first div would have image1 and image2, the second dive would have image3 and image4, etc… My blog_item.html.twig looks like this: div id="post-{{ loop.index }}" class="post-{{ loop.index }} post type-post status-publish format-standard has-post-thumbnail hentry category-ca...
·discourse.getgrav.org·
Loop.index - select 2 images/photos per element rendered - Support - Grav Community Forum
Eleventy Photo Gallery
Eleventy Photo Gallery
I design and build websites, web applications, and data visualizations. I’ve been known to play fiddle from time to time and board games.
·darthmall.net·
Eleventy Photo Gallery