diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.github/workflows/publish-to-gh-pages.yml b/.github/workflows/publish-to-gh-pages.yml new file mode 100644 index 0000000..4c0a91f --- /dev/null +++ b/.github/workflows/publish-to-gh-pages.yml @@ -0,0 +1,42 @@ + +name: Build and publish to gh pages + +on: + push: + branches: [ "*" ] +env: + ASPNETCORE_ENVIRONMENT: Production + WEBAPP_PATH: ./ + WEBAPP_CSPROJ: BlazorStaticMinimalBlog.csproj + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Remove launchSettings.json (to not override ASPNETCORE_ENVIRONMENT) + run: rm ${{ env.WEBAPP_PATH }}Properties/launchSettings.json + + - name: Change in App.razor to match GitHub repo name + run: | + REPO_NAME=$(echo "${{ github.repository }}" | awk -F '/' '{print $NF}') + if [[ "$REPO_NAME" != *.github.io ]]; then + sed -i 's|||g' ${{ env.WEBAPP_PATH }}/Components/App.razor + fi + + - name: Run webapp and generate static files + run: | + dotnet run --project ${{ env.WEBAPP_PATH }}${{env.WEBAPP_CSPROJ}} --configuration Release + + - run: touch ${{ env.WEBAPP_PATH }}/output/.nojekyll #folder starting with _ are handled as jekyll. This file will prevent that. + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ${{ env.WEBAPP_PATH }}output + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf37086 --- /dev/null +++ b/.gitignore @@ -0,0 +1,367 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +/.idea/ + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd +/output/ +/.idea/ diff --git a/BlazorStaticMinimalBlog.csproj b/BlazorStaticMinimalBlog.csproj new file mode 100644 index 0000000..a6cd22e --- /dev/null +++ b/BlazorStaticMinimalBlog.csproj @@ -0,0 +1,34 @@ + + + + net8.0 + enable + enable + + + + + + + 1.0.0-beta.13 + + + + + + + + + + PreserveNewest + + + + + + + + + + + diff --git a/BlazorStaticMinimalBlog.sln b/BlazorStaticMinimalBlog.sln new file mode 100644 index 0000000..2fc86b4 --- /dev/null +++ b/BlazorStaticMinimalBlog.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34309.116 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStaticMinimalBlog", "BlazorStaticMinimalBlog.csproj", "{97F44AF6-5AF6-4FD8-AE15-96648E0CA921}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {97F44AF6-5AF6-4FD8-AE15-96648E0CA921}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97F44AF6-5AF6-4FD8-AE15-96648E0CA921}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97F44AF6-5AF6-4FD8-AE15-96648E0CA921}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97F44AF6-5AF6-4FD8-AE15-96648E0CA921}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {11C0E4EA-03B1-4426-AA27-ADFAF57D3327} + EndGlobalSection +EndGlobal diff --git a/Components/App.razor b/Components/App.razor new file mode 100644 index 0000000..dd18d62 --- /dev/null +++ b/Components/App.razor @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Components/Layout/MainLayout.razor b/Components/Layout/MainLayout.razor new file mode 100644 index 0000000..6704a09 --- /dev/null +++ b/Components/Layout/MainLayout.razor @@ -0,0 +1,32 @@ +@inherits LayoutComponentBase + +
+
+ + + +
+ @Body +
+ + +
+
diff --git a/Components/Layout/NavMenu.razor b/Components/Layout/NavMenu.razor new file mode 100644 index 0000000..e471833 --- /dev/null +++ b/Components/Layout/NavMenu.razor @@ -0,0 +1,69 @@ +@inject NavigationManager Nm + +
+
+ +
+
@WebsiteKeys.Title
+
+
+
+
+ @foreach(var item in menuItems) + { + + + @* *@ + } + +
+
+ +
+ +
+
+
+ + + +@code +{ + List menuItems = + [ + new("Home", ""), + new("Tags", "tags"), + new("", WebsiteKeys.GitHubRepo, Svg.Icons.Github) + ]; + + + record MenuItem(string Name, string Link, Svg.Icons? Icon = null); +} diff --git a/Components/Pages/Blog.razor b/Components/Pages/Blog.razor new file mode 100644 index 0000000..7a43105 --- /dev/null +++ b/Components/Pages/Blog.razor @@ -0,0 +1,122 @@ +@page "/" +@page "/blog/{fileName}" +@using System.Globalization +@using BlazorStatic +@using BlazorStatic.Services +@inject BlazorStaticContentService blazorStaticContentService + + +@* No filename -> show latest posts *@ +@if (string.IsNullOrWhiteSpace(FileName)) +{ +
+
+

Latest

+

@WebsiteKeys.BlogLead

+
+ + +
+ return; +} + +@* Show specific post by filename param *@ +@if (post == null) +{ +
Post not found 🤷
+ return; +} +
+
+
+
+
+
+
Published on
+
+ +
+
+
+
+

@post.FrontMatter.Title

+
+
+
+
+ +
+
Authors
+
+
    + @foreach (var author in post.FrontMatter.Authors) + { +
  • + @* avatar *@ +
    + @if (!string.IsNullOrWhiteSpace(author.Name)) + { +
    Name
    +
    + @author.Name + @if (!string.IsNullOrWhiteSpace(author.XUserName)) + { + + + + } + @if (!string.IsNullOrWhiteSpace(author.GitHubUserName)) + { + + + + } +
    + } +
    +
  • + } +
+
+
+
+
+ @((MarkupString)post.HtmlContent) +
+ +
+ +
+
+
+ + +@code{ + [Parameter] public string? FileName { get; set; } + Post? post; + + protected override void OnInitialized() + { + if (string.IsNullOrWhiteSpace(FileName)) return; + post = blazorStaticContentService.Posts.FirstOrDefault(x => x.Url == FileName); + } +} \ No newline at end of file diff --git a/Components/Pages/Tags.razor b/Components/Pages/Tags.razor new file mode 100644 index 0000000..b31766a --- /dev/null +++ b/Components/Pages/Tags.razor @@ -0,0 +1,50 @@ +@page "/tags/{tagName}" +@page "/tags" +@using BlazorStatic +@using BlazorStatic.Services +@using System.Net +@inject BlazorStaticContentService blazorStaticContentService + +@if (TagName == null) +{ +
+ @{ + var tagsWithCount = blazorStaticContentService.Posts + .SelectMany(x => x.FrontMatter.Tags) + .GroupBy(x => x) + .Select(group => new { Tag = group.Key, Count = group.Count() }) + .OrderByDescending(x => x.Count); + + foreach (var tag in tagsWithCount) + { + @tag.Tag (@tag.Count) + } + } +
+ return; +} + + +
+
+

@TagName

+

Blog posts tagged by + @TagName +

+
+ +
+ +@code { + + [Parameter] public string? TagName { get; set; } + + List>? posts; + + protected override void OnInitialized() + { + if (string.IsNullOrWhiteSpace(TagName)) return; + posts = blazorStaticContentService.Posts.Where(x => x.FrontMatter.Tags.Contains(TagName)).ToList(); + } + +} \ No newline at end of file diff --git a/Components/PostsList.razor b/Components/PostsList.razor new file mode 100644 index 0000000..a4bd441 --- /dev/null +++ b/Components/PostsList.razor @@ -0,0 +1,61 @@ +@using System.Globalization +@using BlazorStatic +@using BlazorStatic.Services +@inject BlazorStaticContentService blazorStaticContentService +@inject BlazorStaticService blazorStaticService + +
    + @foreach (var post in posts.OrderByDescending(x => x.FrontMatter.Published)) + { +
  • +
    +
    +
    +
    Published on
    +
    + + + +
    +
    +
    +
    +
    +

    + @post.FrontMatter.Title +

    +
    + @foreach (var tag in post.FrontMatter.Tags) + { + @tag + } +
    +
    +
    + @((MarkupString)post.FrontMatter.Lead) +
    +
    + +
    +
    +
    +
  • + } +
+ + +@code { + List> posts = new(); + + + [Parameter] public List>? Posts { get; set; } + protected override void OnInitialized() + { + posts = Posts != null ? Posts.OrderBy(x => x.FrontMatter.Published).ToList() : blazorStaticContentService.Posts; + base.OnInitialized(); + } +} \ No newline at end of file diff --git a/Components/Routes.razor b/Components/Routes.razor new file mode 100644 index 0000000..d0df781 --- /dev/null +++ b/Components/Routes.razor @@ -0,0 +1,6 @@ + + + + + + diff --git a/Components/Svg.razor b/Components/Svg.razor new file mode 100644 index 0000000..916c2f2 --- /dev/null +++ b/Components/Svg.razor @@ -0,0 +1,30 @@ +@if (Icon == null) + return; + + @switch (Icon) + { + case Icons.X: + + break; + case Icons.Github: + + break; + } + + + +@code { + [Parameter, EditorRequired] public Icons? Icon { get; set; } + [Parameter] public string SizeClasses { get; set; } = "h-6 w-6"; + public enum Icons{ + X, + Github + } + + string IconToViewBox(Icons? icon) => icon switch + { + Icons.X => "0 0 50 50", + Icons.Github => "0 0 24 24", + _ => "0 0 24 24" + }; +} \ No newline at end of file diff --git a/Components/_Imports.razor b/Components/_Imports.razor new file mode 100644 index 0000000..33dbdfc --- /dev/null +++ b/Components/_Imports.razor @@ -0,0 +1,10 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using BlazorStaticMinimalBlog +@using BlazorStaticMinimalBlog.Components diff --git a/Content/Blog/first-post.md b/Content/Blog/first-post.md new file mode 100644 index 0000000..30e9cca --- /dev/null +++ b/Content/Blog/first-post.md @@ -0,0 +1,17 @@ +--- +title: First post +lead: Sample post so you can see how it works +published: 2023-11-04 +tags: [tag-001, another-sample-tag] +authors: + - name: "Jan Tesař" + gitHubUserName: "tesar-tech" + xUserName: "tesar_tech" +--- + +Hi, this is a sample post with front matter (YAML) metadata. You can use Markdown to write your content. +Also here is a sample image: + +![programming bug](media/programming_bug.jpg) + + diff --git a/Content/Blog/media/programming_bug.jpg b/Content/Blog/media/programming_bug.jpg new file mode 100644 index 0000000..0a48e91 Binary files /dev/null and b/Content/Blog/media/programming_bug.jpg differ diff --git a/Content/Blog/second-post.md b/Content/Blog/second-post.md new file mode 100644 index 0000000..c7d4a37 --- /dev/null +++ b/Content/Blog/second-post.md @@ -0,0 +1,16 @@ +--- +title: Second post +lead: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. +published: 2023-11-05 +tags: [tag-001, another-sample-tag] +authors: + - name: "Jan Tesař" + gitHubUserName: "tesar-tech" + xUserName: "tesar_tech" +--- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo. Fusce malesuada vulputate faucibus. Integer in hendrerit nisi. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet. +Vestibulum quis lacinia eros. Fusce ac metus non purus sollicitudin laoreet. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + + diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..7d93ca8 --- /dev/null +++ b/Program.cs @@ -0,0 +1,44 @@ +using BlazorStatic; +using BlazorStaticMinimalBlog.Components; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseStaticWebAssets(); + +builder.Services.AddBlazorStaticService(opt => { + //opt. //check to change the defaults +} +).AddBlazorStaticContentService(); + +builder.Services.AddRazorComponents(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Error", createScopeForErrors: true); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); + +app.UseStaticFiles(); +app.UseAntiforgery(); + +app.MapRazorComponents(); + +app.UseBlazorStaticGenerator(shutdownApp: !app.Environment.IsDevelopment()); + +app.Run(); + +public static class WebsiteKeys +{ + public const string GitHubRepo = "https://github.com/tesar-tech/blazorStaticMinimalBlog"; + public const string X = "https://x.com/"; + public const string Title = "BlazorStatic Minimal Blog"; + public const string BlogPostStorageAddress = $"{GitHubRepo}/tree/main/Content/Blog"; + public const string BlogLead = "Sample blog created with BlazorStatic and TailwindCSS"; + +} diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..db096cb --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:6196", + "sslPort": 44359 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5062", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7202;http://localhost:5062", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } + } diff --git a/README.md b/README.md new file mode 100644 index 0000000..6779738 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# BlazorStatic Minimal Blog + +A minimalistic blog template designed to get your Blazor-based blog up and running in no time. This project leverages the [BlazorStatic](https://github.com/tesar-tech/BlazorStatic) library to convert a Blazor app into a static site generator + + + +## Features + +- **Quick Setup**: Deploy your blog within minutes using this template. +- **BlazorStatic Integration**: Harness the power of Blazor and BlazorStatic library for generating static sites +- **Customizable**: Easy to edit content, update styling, and tweak configurations to suit your blogging needs. +- **GitHub Actions Workflow**: Includes setup for automatic publishing using GitHub Actions, facilitating seamless deployment. + +## Getting Started + +1. **Fork or Clone**: Start by forking or cloning this repository. +2. **Enable GitHub Pages**: Configure GitHub Pages in your repository settings for quick deployment. +3. **Personalize**: Update the content, modify styling, and adjust configurations to personalize your blog. +4. **Deploy**: Push your changes, and GitHub Actions will take care of the deployment process. + +## Acknowledgements + +The theme for BlazorStaticMinimalBlog was heavily inspired by [Tailwind Next.js Starter Blog](https://github.com/timlrx/tailwind-nextjs-starter-blog). diff --git a/appsettings.Development.json b/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}