A flexible, configuration-driven robots.txt solution for Umbraco v13, v14, v15, v16 & v17
This repository contains:
- Crumpled.RobotsTxt - Main Umbraco package for managing robots.txt configuration (README)
- Crumpled.RobotsTxt.Core - Internal ASP.NET Core robots.txt middleware implementation
- Crumpled.RobotsTxt.TestSite - Test Umbraco site for development (Umbraco v17.*)
- Crumpled.RobotsTxt.TestSite13 - Test Umbraco site for v13 compatibility
dotnet add package Crumpled.RobotsTxt📖 View Full Documentation & Configuration Guide
- 🛡️ Safe by Default - Blocks all bots by default to prevent accidental indexing
- 🌍 Multi-Site & Environment-Aware - Different rules per domain/environment
- 📝 Flexible Configuration - Reusable rulesets via appsettings.json
- 🤖 Content Signals Support - Control AI training and content usage (v3.1.0+, currently in beta)
- 🗺️ Sitemap Integration - Automatic sitemap URL generation
- ⚙️ Zero Code Setup - Auto-registration via Umbraco Composer
Crumpled.RobotsTxt.TestSite - Umbraco v17 test site with unattended installation. Credentials (not that you really need them) are set in appsettings.Development.json
Crumpled.RobotsTxt.TestSite13 - Umbraco v13 test site for backward compatibility testing
The main test site includes three launch profiles:
1. Crumpled.RobotsTxt.TestSite (Development Profile)
- Tests multi-site robots.txt functionality
- Listens on three ports simultaneously:
https://localhost:44389- "Stage" site (Development ruleset)https://localhost:44390- "Prod" site (Production ruleset)https://localhost:44391- Unmatched domain (tests fallback behavior)
- Each URL serves different robots.txt content based on hostname configuration
2. Crumpled.RobotsTxt.TestSiteLiveCloud (Umbraco Cloud Live Simulation)
- Tests Umbraco Cloud live environment detection
- Sets
UMBRACO__CLOUD__DEPLOY__ENVIRONMENTNAME=live - Single URL:
https://localhost:44392 - Environment:
CloudTest - Demonstrates Cloud-specific default behavior (allows all bots when no sites configured)
3. Crumpled.RobotsTxt.TestSiteDevCloud (Umbraco Cloud Dev Simulation)
- Tests Umbraco Cloud development environment detection
- Sets
UMBRACO__CLOUD__DEPLOY__ENVIRONMENTNAME=development - Single URL:
https://localhost:44393 - Environment:
CloudTest - Demonstrates Cloud dev environment behavior (blocks all bots by default)
Run with the default profile:
dotnet run --project src/Crumpled.RobotsTxt.TestSiteOr specify a launch profile:
dotnet run --project src/Crumpled.RobotsTxt.TestSite --launch-profile Crumpled.RobotsTxt.TestSiteLiveCloud
dotnet run --project src/Crumpled.RobotsTxt.TestSite --launch-profile Crumpled.RobotsTxt.TestSiteDevCloudRun the Umbraco v13 test site:
dotnet run --project src/Crumpled.RobotsTxt.TestSite13To test semantic-release configuration locally without actually publishing:
# First-time setup - install dependencies
npm install
# Test what version would be released
npx semantic-release --dry-run --no-ciThis will:
- Analyze commits since the last release
- Determine the next version number based on commit messages
- Show what would be released without actually creating tags or publishing
Note: Requires conventional commit format (feat:, fix:, etc.) for version determination.
This project uses semantic-release for automated versioning and publishing based on conventional commits.
| Branch Pattern | Prerelease Tag | Version Example | Purpose |
|---|---|---|---|
release/v3 |
None | 3.1.0 |
Stable production releases |
develop/v3 |
alpha |
3.1.0-alpha.1 |
Integration branch for next release |
feature/v3/** |
feature.alpha |
3.1.0-feature.alpha.1 |
New features in development |
hotfix/v3/** |
hotfix.alpha |
3.1.0-hotfix.alpha.1 |
Bug fixes for next release |
Use Conventional Commits format for all commits:
<type>: <description>
[optional body]
[optional footer]
Common types:
feat:- New feature (triggers minor version bump)fix:- Bug fix (triggers patch version bump)docs:- Documentation only changesrefactor:- Code refactoring without behavior changesperf:- Performance improvementstest:- Adding or updating testsci:- CI/CD pipeline changeschore:- Maintenance tasks
Breaking changes: Add BREAKING CHANGE: in the commit footer or ! after type (triggers major version bump)
Examples:
feat: implement Content Signals support
fix: ensure Cloud Live environment allows all bots
docs: update README with branching strategy
feat!: change configuration schema (breaking change)-
Feature Development
- Branch from:
develop/v3 - Create branch:
feature/v3/my-feature - Make commits using conventional format
- Push to trigger CI - creates feature prerelease (e.g.,
3.1.0-feature.alpha.1) - Merge back to:
develop/v3
- Branch from:
-
Hotfixes
- Branch from:
release/v3 - Create branch:
hotfix/v3/fix-description - Make commits using conventional format
- Push to trigger CI - creates hotfix prerelease (e.g.,
3.1.0-hotfix.alpha.1) - Merge to:
release/v3anddevelop/v3
- Branch from:
-
Integration
- Merge feature/hotfix branches into
develop/v3 - Creates alpha prerelease (e.g.,
3.1.0-alpha.1) - Use for testing integrated features
- Merge feature/hotfix branches into
-
Stable Release
- Merge
develop/v3intorelease/v3 - Creates stable version (e.g.,
3.1.0)
- Merge
All branches trigger the CI workflow which:
- Builds the solution
- Runs integration tests (net8.0 and net10.0)
- Determines version using semantic-release
- Packs NuGet package with calculated version
- Publishes to NuGet (on successful build)