Open
Description
Most of the time I've been spending on 11ty this year was in this repo, manually approving all the awesome submissions by people.
My process for this up until now is to check whether either the <meta name="generator" content="Eleventy">
tag was present in the linked page or an Eleventy config file exists in the linked repo.
At the same time I have very little time to write a welcoming message as a response to the repo.
For this reason I propose the following steps to automate the approval process:
- Add two labels "bwe-config-exists" and "bwe-generator-exists" (bwe means built-with-eleventy)
- Create a GH action which checks for those two things and automatically applies these labels to all issues when created
- check validity by searching for collisions in existing data and/or best effort detect of unwanted content (e.g. what is our policy around NSFW or politically extremist content?)
- (optionally) automatically approve submissions if they have at least one or both labels.
- write a nice comment under the issue to welcome the submission
I'd be willing to implement at least step 1, 2, (4) and 5 as an Action which we could move under the GitHub 11ty Org.
The generator detection could work something like this:
const hasMetaGenerator11ty = async (url) => {
const resp = await fetch(url);
const html = await resp.text();
const metaGenerator = cssSelect.selectOne(
"meta[name='generator']",
htmlparser2.parseDocument(html)
);
return (
metaGenerator?.attribs?.content.toLowerCase().includes("eleventy") ||
metaGenerator?.attribs?.content.toLowerCase().includes("11ty") ||
false
);
};
Metadata
Assignees
Labels
No labels