robots.txt virtual template should allow site override

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
tooling

Research direction

Inspect how the plugin registers the virtual templates and compare that behavior with the mentioned local files src/robots.txt and src/robots.txt.njk. Check the corresponding handling for robots.txt, llms.txt, sitemap.njk, and feed.njk, then verify that a site-provided version takes precedence while the generated version remains available otherwise.

Written by the indexing model from the issue text.

Description

Problem

The robots.txt virtual template generates a reasonable robots.txt with AI crawler rules, but sites cannot override or extend it without conflicting with the virtual template.

The original dart_node site had an identical robots.txt to what the plugin generates, but other sites using the plugin may need custom rules (e.g., different disallow paths, custom crawl-delay settings, or site-specific comments).

Suggested Fix

If a site provides its own src/robots.txt or src/robots.txt.njk, the virtual template should not be registered. This follows the same pattern as layouts - local files take precedence over virtual templates.

This applies to all virtual template pages (robots.txt, llms.txt, sitemap.njk, feed.njk) - sites should be able to override any of them by providing their own version.

Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Nimblesite/eleventy-plugin-techdoc

All issues in Nimblesite/eleventy-plugin-techdoc

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.