eleventy
eleventy copied to clipboard
Template engine parses unexpected strings
Describe the bug The template engine prints some unexpected strings
To Reproduce Steps to reproduce the behavior:
- clone quitsocialmedia.club
- In
layouts/wrapper.htmllook at this function - In
includes/nav.htmlcheck this function using the results of the previous one - run
npm run start - Unexpectedly, in every page containing the rendered
nav.html, a bunch of<a>tags are added. For example, the output ofpages/Home.htmlis:
<li class="dropdown">
<label for="langtoggle" title="language selector">🌍</label>
<input aria-hidden="true" type="checkbox" id="langtoggle">
<ul class="lang-list">
<li><a rel="alternate" href="[/accueil/](view-source:http://localhost:8080/accueil/)" title="Accueil" hreflang="fr">🇫🇷</a></li><a rel="alternate" href="[/accueil/](view-source:http://localhost:8080/accueil/)" title="Accueil" hreflang="fr">
</a><li><a rel="alternate" href="[/accueil/](view-source:http://localhost:8080/accueil/)" title="Accueil" hreflang="fr"></a><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">🇮🇹</a></li><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
</a></ul><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
</a></li><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
</a></ul><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
</a></nav><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
</a></header><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
</a><div class="one column"><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
<div class="row">
<section class="page-header">
<h1>Quit Social Media</h1>
<p>All of the reasons why Social Media platforms are bad and possible solutions to live a happy life on the web without them</p>
</section>
</div>
</a><div class="row"><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
</a><section class="red box"><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
<h2 class="title">WTF is this website?</h2>
</a><p><a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">
- as you can see, there are many extra unexpected
<a rel="alternate" href="[/it/home/](view-source:http://localhost:8080/it/home/)" title="Home" hreflang="it">, definitely out of place. - Same goes for every other page, even in other languages (even if the string repeating is different)
Expected behavior
The correct behavior happens in another place, following the same logic. For example, in includes/head.html this function prints out the correct result, without any trash (output always from pages/Home.html):
<meta property="og:locale:alternate" content="fr">
<link rel="alternate" hreflang="fr" href="[/accueil/](view-source:http://localhost:8080/accueil/)">
<meta property="og:locale:alternate" content="it">
<link rel="alternate" hreflang="it" href="[/it/home/](view-source:http://localhost:8080/it/home/)">
Environment:
- OS and Version: MacOS 12.4
- Eleventy Version 1.0.1
Lookin’
ohhhhh dang the directory output plugin—a rare sighting!
I think this might be a plugin issue, not sure! I can’t reproduce it locally:

yours:

Can you go through your third-party plugins and comment them out one-by-one to see if one of them is causing the issue?
The issue still shows up when all plugins are removed. Please do not refer to the published version, it still relies on a broken Jekyll build. Please refer to this branch for further testing.
ohhhhh dang the directory output plugin—a rare sighting!
I take it as a compliment, thanks a lot!
Hello there, the problem still persists… I removed one-by-one each plugin: this is not a problem caused by a plugin.
What can I do?
(Note: I deployed the website to production, the content of the repo is deployed to quitsocialmedia.club)
@xplosionmind Which page(s) are showing unexpected strings in the output? I git cloned, npm installed, and then ran npm run watch:eleventy but didn't see anything obvious on the local dev server (or on your production site).