A minimal blog theme using Tailwind CSS for ScissorHands.NET, inspired by astro-minimal-blog.
This is the overall structure of the theme.
.
└── src/
├── assets/
│ ├── css/
│ │ └── theme.css
│ ├── images/
│ │ ├── logo.png
│ │ ├── moon-icon.svg
│ │ └── sun-icon.svg
│ └── js/
│ └── theme.js
│
├── favicon.ico
│
├── theme.json
│
├── Components/
│ ├── Header.razor
│ ├── Footer.razor
│ ├── PostCard.razor
│ └── TagList.razor
├── _Imports.razor
├── MainLayout.razor
├── IndexView.razor
├── PostView.razor
└── PageView.razor
-
theme.jsondefines the metadata of the theme.You can have one or more CSS and JavaScript files. If you choose to do so, make sure to include them all in this
theme.json.
-
It defines the global namespace and using directives.
@using ScissorHands.Core.Manifests @using ScissorHands.Core.Models @using ScissorHands.Theme.MinimalBlog.Components.Footer @using ScissorHands.Theme.MinimalBlog.Components.Header @using ScissorHands.Theme.MinimalBlog.Components.PostCard @using ScissorHands.Theme.MinimalBlog.Components.TagList @using Theme = ScissorHands.Core.Manifests.ThemeManifest @namespace ScissorHands.Theme.MinimalBlog
- This is the overall HTML layout structure.
- It calls both UI components and plugin components.
- This is the landing page of your static website.
- This is the blog post page.
- This is the non-blog post page.
- The list of UI components used in this theme are:
- Header
- Footer
- PostCard
- TagList
-
Set environment variables for GitHub NuGet Package Registry.
# zsh/bash export GH_PACKAGE_USERNAME="<GITHUB_USERNAME>" export GH_PACKAGE_TOKEN="<GITHUB_TOKEN>"
# PowerShell $env:GH_PACKAGE_USERNAME = "<GITHUB_USERNAME>" $env:GH_PACKAGE_TOKEN = "<GITHUB_TOKEN>"
-
Add a NuGet package for the theme.
dotnet add package ScissorHands.Theme --prerelease
-
Create a symbolic link under the
themesdirectory.# zsh/bash REPOSITORY_ROOT=$(git rev-parse --show-toplevel) ln -s $REPOSITORY_ROOT/src $REPOSITORY_ROOT/preview/ScissorHands/themes/minimal-blog
# PowerShell $REPOSITORY_ROOT = git rev-parse --show-toplevel New-Item -ItemType SymbolicLink -Path "$REPOSITORY_ROOT/preview/ScissorHands/themes/minimal-blog" -Target "$REPOSITORY_ROOT/src"
-
Run the app.
dotnet run --project ./preview/ScissorHands -- --preview
-
Verify the generated HTML properly renders your theme.
{ "name": "Minimal Blog", "version": "1.0.0", "description": "A minimal blog theme using Tailwind CSS for ScissorHands.NET, inspired by [astro-minimal-blog](https://github.com/alexanderhodes/astro-minimal-blog).", "slug": "minimal-blog", "stylesheets": [ "/assets/css/theme.css" ], "scripts": [ "/assets/js/theme.js" ] }