CodeWF
CodeWF 是 dotnet9.com / codewf.com 的网站源码仓库,当前站点基于 ASP.NET Core Razor Pages 构建。它把同级的 Assets.Dotnet9 作为文件型内容仓库使用,运行时读取文章、项目文档、工具元数据、时间线、友情链接和站点级 Markdown 页面。
Suitable for attention
- 想了解
dotnet9.com网站如何组织 Razor Pages、内容服务、搜索和站点地图。 - I want to detach Markdown, JSON and image resources from the application source code to form a lightweight CMS-style maintenance process.
- I want to refer to a website project that is mainly based on. NET and contains blogs, project centers and online tools.
core responsibilities
| module | description |
|---|---|
src/WebApp/Pages |
Razor Pages page, including home page, article, project center, tool page, search page, etc. |
src/WebApp/Services/AppService.cs |
Load resource warehouse content uniformly and maintain memory caches, search indexes and site maps. |
src/WebApp/Models |
Content models such as articles, categories, topics, projects, tools, search results, etc. |
tests/WebApp.Tests |
Minimum test set covering Front Matter, Markdown rendering, and search keyword interception. |
Collaborate with resource warehouses
站点通过 Site:LocalAssetsDir 指向本地 Assets.Dotnet9 目录。开发环境下,文件监听会在 Markdown、JSON、图片或 SVG 变化时清空内容缓存,所以维护资源仓库后刷新页面即可看到结果。
Common inputs include:
site/doc/navigation.jsonsite/tools/tools.jsonsite/categories.jsonsite/albums.jsonsite/timelines.jsonsite/about.md2019/到当前年份的文章目录
run locally
dotnet run --project src/WebApp/WebApp.csproj
If the resource warehouse is not in the default path, you can override it with an environment variable:
$env:Site__LocalAssetsDir = "D:\github\owner\Assets.Dotnet9"
dotnet run --project src/WebApp/WebApp.csproj