-
Notifications
You must be signed in to change notification settings - Fork 59
Sandra.Snow v2: Complete modernization with .NET 10, single-file publish, and full v1 compatibility #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
phillip-haydon
wants to merge
13
commits into
master
Choose a base branch
from
upgrade-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Major changes: - Replaced RazorLight with RazorEngineCore to resolve single-file publish issues - Implemented RazorTemplateRenderer with full Razor syntax support - Created SnowTemplateBase for v1 Nancy-compatible @html helpers - Added SnowHtmlHelpers with Raw(), CanonicalUrl(), RenderSeries(), etc. - Updated NancyRazorViewBase shim to inherit from SnowTemplateBase - Re-enabled single-file publish in Snow.Cli.csproj (compression disabled for .NET 10) V1 template compatibility: - Added PostsGroupedByYearThenMonth and GetMonth() for archive pages - Added v1-compatible ContentViewModel, PostViewModel, PageViewModel - Fixed <!--excerpt--> marker handling in MarkdownFileParser - Added MonthYearList, Keywords, GeneratedDate to view models Dev server fixes: - Fixed SPA-style fallback that was serving root index.html for all routes - Added clean URL rewriting for static sites (/path -> /path/index.html) Other improvements: - Added processors: Atom, RSS, Sitemap, Categories, Drafts, StaticFile - Updated test expectations to match actual graceful degradation behavior - All 111 tests passing
- Remove v1 codebase (src/, SnowSite/, _sample-deployment/) - Remove old documentation and planning files - Move v2 contents to repository root - Rename Sandra.Snow.v2.sln to Sandra.Snow.sln - Update README to reference .NET 10 and add v1 tag link - Update .gitignore for modern .NET development - Replace old GitHub workflows with v2 CI workflow v1 code is preserved at tag v1.0.0 for reference.
- Restore SnowSite test site from v1 - Remove unnecessary documentation (stage reports, implementation docs) - Remove extra files (CHANGELOG, CONTRIBUTING, etc.) - Remove GitHub issue templates - Replace ci.yml with build-snow.yml and publish-website.yml - Build for Windows, Linux, and macOS with self-contained executables
- Fix .NET version in workflows (9 -> 10) - Add PublishReadyToRun for faster startup - Add partial trimming for smaller binaries - Add JSON source generators for AOT/trim compatibility - Add TrimmerRootAssembly for RazorEngineCore to preserve reflection - Update description to .NET 10 - Simplify publish command (settings now in csproj)
…ot trim-compatible
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Sandra.Snow v2
A complete modernization of Sandra.Snow - the beloved static site generator for .NET developers. This release brings the project into the modern .NET era while maintaining full backwards compatibility with existing v1 sites.
✨ Highlights
🏗️ Architecture
Project Structure
Key Technologies
🔧 Template System
RazorEngineCore Integration
Replaced RazorLight with RazorEngineCore to enable single-file publish:
RazorTemplateRenderer- Full Razor syntax with template cachingSnowTemplateBase<T>- Base class with layout support (@{ Layout = "default"; })SnowHtmlHelpers- v1-compatible@Html.*methodsV1 Compatibility Shims
Existing templates work unchanged:
Supported helpers:
@Html.Raw(),@Html.CanonicalUrl()@Html.RenderSeries(),@Html.RenderSeries(post)@Html.RenderGoogleAnalytics(trackingCode)@Html.RenderDisqusComments(shortName)@Html.RenderGravatarImage(email, size)View Models
Full v1-compatible view models:
PostViewModel- Single post pagesPageViewModel- Static pagesContentViewModel- Index/listing pages with paginationBaseViewModel- Common properties (Posts, Pages, Categories, MonthYearList)📦 Content Processing
Processors
Excerpt Support
Both v1 and v2 excerpt formats supported:
Content before the marker appears in listings... <!--excerpt--> Content after only appears on the full post page.🖥️ CLI Commands
📊 Performance
✅ Testing
🔄 Migration from v1
Most sites work without changes:
What Works Unchanged
_posts,_layouts,themes)@inherits NancyRazorViewBase<T>)@Html.*helpers<!--excerpt-->markers📝 Breaking Changes
None - v1 sites work without modification.
🛠️ Build Instructions