Hello everyone. I’m looking for some troubleshooting help with an Eleventy starter project based on Archive of Your Own, a webpage template for fiction writers. So far @ArimaMary has tried the starter and ran into a layout error that neither of us have figured out, so I could use some more volunteers.
Note I have not released anything like this publicly before, so right now the code is on a private repository on git.32bit.cafe. If you log in there and let me know you’re interested, I can add you to the repository so you can see it.
I’m hoping that if I can get this project operational, then that could also help me move forward with designing an Eleventy starter specifically to go with converted Pillowfort exports.
I’d like to sign in there and try to help but the OpenID is failing (says my password is wrong, and if I try to reset it, no email comes — this is the same stored password I use to login here in Discourse without a problem). What’s the error you’re seeing?
Hi! I’m getting an error when I run the npx @11ty/eleventy --serve command.
Here’s some of the error message:
Problem writing Eleventy templates:
[11ty] 1. Problem creating an Eleventy Layout for the “./src/index.md” template file. (via EleventyBaseError)
[11ty] 2. You’re trying to use a layout that does not exist: _includes/archive-of-your-own.html (via `layout: archive-of-your-own.html`)
[11ty]
[11ty] Original error stack trace: Error: You’re trying to use a layout that does not exist: _includes/archive-of-your-own.html (via `layout: archive-of-your-own.html`)
@brn Have you tried clearing browsing data for 32bit.cafe? I’ve never used the Forgejo here before and was just getting Internal Server Error, but I can log in now after clearing it.
That’s what I thought at first, but that’s already where I put the file to begin with, and when I asked Mary about it they didn’t indicate that they had changed anything from the original download. That’s why I’m looking for more people to test it out, to see if other people get the same error.
@cypress-sap I’ve added you as a team member on git.32bit.cafe. If anyone else would like to try, login there first and then let me know. It only lets me add people if they’ve logged in to that part of the site at least once before.
I’m still getting the same “Invalid password” error even in an incognito window and with different browsers and I get no email when I try to reset it; pretty sure my account just isn’t registered there somehow. I’d be willing to help if I could.
If we run Eleventy on the root of the project, it really can’t find the layout file _includes/archive-of-your-own.html, because that’s actually at src/_includes/archive-of-your-own.html. If we run it on src/ instead, it works!
…well, it builds, but the CSS and icons don’t work. Eleventy also needs to be told to to copy assets/.
A small config file in the root folder (and running Eleventy there) should fix both issues:
I’m about to get ready for work, but I can make a PR later to add the config and update the instructions in the readme.
(Not directly related, but I’d also recommend including package.json, package-lock.json, and .gitignore in the starter. That way people can just npm install and go, and anyone using git won’t have to ignore _site/ and node_modules/ themselves.)
if you need the alt flavouring, this is my own from my 11ty sites, once you designate the input, then you should be able to just be like ‘hey use this template’ in the front matter of any page. mine was from petrapixel’s 11ty page, though it also has examples for passthrough copies you might generally use
module.exports = function (eleventyConfig) {
// Add passthrough copies
eleventyConfig.addPassthroughCopy("src/img");
eleventyConfig.addPassthroughCopy("src/css");
eleventyConfig.addPassthroughCopy("src/js");
eleventyConfig.addPassthroughCopy({ "src/robots.txt": "/robots.txt" });
eleventyConfig.addPassthroughCopy({ "src/favicon.ico": "/favicon.ico" });
// Tell Eleventy which file types to process as templates
eleventyConfig.setTemplateFormats(["html", "njk", "md"]);
// This makes the eleventy command quieter (with less detail)
eleventyConfig.setQuietMode(true);
// This will stop the default behaviour of foo.html being turned into foo/index.html
eleventyConfig.addGlobalData("permalink", "{{ page.filePathStem }}.html");
// This will make Eleventy not use your .gitignore file to ignore files
eleventyConfig.setUseGitIgnore(false);
// This defines the input and output directories
// Set njk template to be used on HTML and MD pages
return {
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
dir: {
input: "src",
output: "public"
}
};
};
i also may recommend turning the base into an .njk file? mine are at least–it usually will let you use nunjucks specific stuff like {{ title }} (ex like putting the name of a fic) and afterwards in the frontmatter of any file you should just be able to use layout: base.njk and not need to specify that it’s in _includes
brain kinda gooey to explain, but this is an example of one of my frontmatters dictating the page title, a subtitle, and scripts, which i have lil doodads in the njk template that’ll populate it
---
layout: base.njk
title: guestbook
subtitle: leave a kind message!
description: A guestbook!!
nesting: "./"
scripts: >
<script src="js/comment-widget.js"></script>
---
@cypress-sap@sylviegirly Thanks for the suggestions! I haven’t had the bandwidth to go back to monkeying with this lately but I appreciate these for when I get back to it.
Haven’t touched the project again but I’m glad further responses support what I was thinking of trying out. I have a base 11ty template that I’m positive if I apply it to this project should solve the issue.
@Coyote Also, my pronouns are they/them thank you very much!
@ArimaMary sorry about that. I’ve edited my other post.
Just tonight I finally had the right combination of time and energy to return to this project. When I saw @cypress-sap’s tips I remember being vaguely confused because it looked like it was a different way of writing the config file that I already had, but I just shrugged and decided I’d figure it out later. Well, it’s later, and here’s what I figured out:
Apparently I forgot to upload my config file to the repository in the first place.
So now that I’ve gone and added one of those, could I get some testers to confirm that it works? I used my original version just for recordkeeping’s sake, but if it still produces an error, try the cypress version and let me know if that makes a difference.
@brn I don’t have you listed for access to the repository, since last I heard, you weren’t able to log in to git.32bit.cafe. Which code are you looking at?
Oh, I was confused. I understood the code was live at https://osteophage.neocities.org/ but I realize now that’s just your signature link and it’s in neocities. I just opened the link and read and clicked through a few things. Sorry for the confusion!