Content Licensing in XenT: A Complete Guide
XenT includes a powerful content licensing system that displays license information in your post footers. Whether you want Creative Commons licensing, custom restrictions, or per-post flexibility, XenT has you covered.
Quick Start
Set your global default license in your configuration:
// user.config.ts
defaults: {
license: 'CC-BY-4.0', // Your default license
}
That’s it! All your posts will now display this license unless overridden.
Creative Commons Badges
XenT automatically detects Creative Commons licenses and displays official CC badges for instant recognition:
Supported CC licenses:
CC-BY-4.0- AttributionCC-BY-SA-4.0- Attribution-ShareAlikeCC-BY-NC-4.0- Attribution-NonCommercialCC-BY-NC-SA-4.0- Attribution-NonCommercial-ShareAlikeCC-BY-ND-4.0- Attribution-NoDerivativesCC0orPublic Domain- No rights reserved
Visual Features:
- Official Creative Commons badge graphics
- Centered display for clean visual balance
- Clickable links to license details on creativecommons.org
- Badge-only display (no redundant text) for cleaner design
Per-Post License Override
Override the global default for specific posts using frontmatter:
---
title: 'My Special Post'
license: 'All Rights Reserved' # Override global default
---
Common override examples:
license: "MIT" # For code/technical content
license: "All Rights Reserved" # Restrict usage
license: "CC-BY-NC-4.0" # Non-commercial only
license: "Public Domain" # No restrictions
license: "" # Hide license entirely
Hiding License Information
Sometimes you don’t want license info displayed:
Hide globally:
defaults: {
license: '', // Empty string = no license display
}
Hide for specific posts:
---
title: 'Corporate Post'
license: '' # Override to hide just this post
---
Common use cases for hiding:
- Corporate/client work
- Guest posts with different policies
- Portfolio showcases
- Legal/sensitive content
Custom License Text
XenT supports completely custom license text for maximum flexibility:
license: "Available under Creative Commons with attribution to Example Blog"
license: "Free to share with credit and link back"
license: "Contact author for commercial usage rights"
license: "Licensed for educational use only"
Configuration Examples
Open Content Blog:
defaults: {
license: 'CC-BY-4.0', // Encourage sharing with attribution
}
Mixed Commercial/Open:
defaults: {
license: 'All Rights Reserved', // Conservative default
}
# Override per post
license: 'CC-BY-4.0' # Make specific posts open
Portfolio Site:
defaults: {
license: '', // No licensing by default
}
Best Practices
Choose Appropriate Defaults
- Personal blog:
CC-BY-4.0encourages sharing - Business blog:
All Rights Reservedprotects content - Technical blog: Consider
CC-BY-SA-4.0for knowledge sharing - Portfolio: Often no licensing needed
Be Consistent
- Avoid mixing too many license types
- Use frontmatter overrides sparingly
- Document your licensing policy on an About page
Consider Your Audience
- Creative Commons for educators/researchers
- Custom text for clear, human-readable terms
- No license for purely personal content
Technical Details
The licensing system uses Astro’s content collection schema with automatic defaults:
// Automatic schema behavior
license: z.string().default(config.defaults.license);
This means:
- No
license:field → uses global default license: ""→ hides license displaylicense: "Custom"→ shows custom text
Display Location
License information appears in the post footer, after tags but before comments. This placement follows web conventions and doesn’t interfere with reading flow.
Troubleshooting
License not showing?
- Check that
defaults.licenseis set and not empty - Verify the post isn’t overriding with an empty string
CC badge not appearing?
- Ensure exact hyphen format:
CC-BY-4.0notCC BY 4.0 - Check for typos in license text
- Badge displays only for supported CC license formats
Want to hide all licensing?
- Set
defaults.license: ''in your config - This affects all posts unless individually overridden
Migration from Other Themes
From themes with footer copyright: XenT deliberately avoids site-wide “All Rights Reserved” footers to prevent confusion between site licensing and content licensing. Content licensing is more specific and user-friendly.
From themes without licensing:
Start with a permissive default like CC-BY-4.0 and restrict specific posts as needed rather than the reverse.
The XenT licensing system balances flexibility with simplicity, giving you granular control while maintaining clean, professional presentation. Whether you’re running an open knowledge blog or protecting commercial content, XenT adapts to your licensing needs.