Personal website

Blazor rewrite!! (-in-progress)

i <3 components
nothing really works apart from the home page and /random-splash,
but it's in progress!

helpimnotdrowning.net e2cd2153 2f60442e

verified
+941 -1223
+30
.gitignore
··· 1 + bin/ 2 + obj/ 3 + /packages/ 4 + riderModule.iml 5 + /_ReSharper.Caches/ 6 + 7 + *.DotSettings.user 8 + 9 + # https://github.com/github/gitignore/blob/53fee13f20a05efc93ef4edcad0c62863520e268/Global/JetBrains.gitignore 10 + # Covers JetBrains IDEs: IntelliJ, GoLand, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 11 + # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 12 + 13 + # User-specific stuff 14 + .idea/**/workspace.xml 15 + .idea/**/tasks.xml 16 + .idea/**/usage.statistics.xml 17 + .idea/**/dictionaries 18 + .idea/**/shelf 19 + 20 + # Generated files 21 + .idea/**/contentModel.xml 22 + 23 + # Sensitive or high-churn files 24 + .idea/**/dataSources/ 25 + .idea/**/dataSources.ids 26 + .idea/**/dataSources.local.xml 27 + .idea/**/sqlDataSources.xml 28 + .idea/**/dynamic.xml 29 + .idea/**/uiDesigner.xml 30 + .idea/**/dbnavigator.xml
+15
.idea/.idea.NKK.sln/.idea/.gitignore
··· 1 + # Default ignored files 2 + /shelf/ 3 + /workspace.xml 4 + # Rider ignored files 5 + /contentModel.xml 6 + /modules.xml 7 + /.idea.NKK.sln.iml 8 + /projectSettingsUpdater.xml 9 + # Ignored default folder with query files 10 + /queries/ 11 + # Datasource local storage ignored files 12 + /dataSources/ 13 + /dataSources.local.xml 14 + # Editor-based HTTP Client requests 15 + /httpRequests/
+1
.idea/.idea.NKK.sln/.idea/.name
··· 1 + NKK.sln
+4
.idea/.idea.NKK.sln/.idea/encodings.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> 4 + </project>
+8
.idea/.idea.NKK.sln/.idea/indexLayout.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="UserContentModel"> 4 + <attachedFolders /> 5 + <explicitIncludes /> 6 + <explicitExcludes /> 7 + </component> 8 + </project>
+6
.idea/.idea.NKK.sln/.idea/vcs.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="VcsDirectoryMappings"> 4 + <mapping directory="" vcs="Git" /> 5 + </component> 6 + </project>
+15
.idea/.idea.NKK/.idea/.gitignore
··· 1 + # Default ignored files 2 + /shelf/ 3 + /workspace.xml 4 + # Rider ignored files 5 + /projectSettingsUpdater.xml 6 + /.idea.NKK.iml 7 + /modules.xml 8 + /contentModel.xml 9 + # Ignored default folder with query files 10 + /queries/ 11 + # Datasource local storage ignored files 12 + /dataSources/ 13 + /dataSources.local.xml 14 + # Editor-based HTTP Client requests 15 + /httpRequests/
+5
.idea/.idea.NKK/.idea/codeStyles/codeStyleConfig.xml
··· 1 + <component name="ProjectCodeStyleConfiguration"> 2 + <state> 3 + <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> 4 + </state> 5 + </component>
+4
.idea/.idea.NKK/.idea/encodings.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> 4 + </project>
+8
.idea/.idea.NKK/.idea/indexLayout.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="UserContentModel"> 4 + <attachedFolders /> 5 + <explicitIncludes /> 6 + <explicitExcludes /> 7 + </component> 8 + </project>
+6
.idea/.idea.NKK/.idea/vcs.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="VcsDirectoryMappings"> 4 + <mapping directory="$PROJECT_DIR$" vcs="Git" /> 5 + </component> 6 + </project>
+19
Components/App.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @* see Layout/MainLayout.razor for the <html>... *@ 19 + <Routes />
+23
Components/AppTitle.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + <PageTitle>@( ChildContent == null ? "<somewhere???>" : ChildContent.RenderString() ) :: helpimnotdrowning.net</PageTitle> 19 + 20 + @code { 21 + [Parameter] 22 + public RenderFragment? ChildContent { get; set; } 23 + }
+27
Components/Header.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + <header class="n-box clear-n-box flex flex-row! items-center mb-1!"> 19 + <img class="rounded-md pfp" src="/user.webp" alt="Profile picture" width="70"/> 20 + 21 + <div class="ms-6"> 22 + <span class="text-4xl">helpimnotdrowning</span> 23 + <div id="splash" hx-get="/random-splash" hx-swap="innerText" hx-trigger="load,click"> 24 + <p>missingno</p> 25 + </div> 26 + </div> 27 + </header>
+45
Components/Layout/MainLayout.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @inherits LayoutComponentBase 19 + 20 + <!DOCTYPE html> 21 + <html lang="en"> 22 + <head> 23 + <meta charset="utf-8" /> 24 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 25 + 26 + <link rel="stylesheet" type="text/css" href="@Assets["/style.css"]" /> 27 + 28 + <script src="@Assets["/htmx.js"]"></script> 29 + <meta name="htmx-config" content='{"scrollIntoViewOnBoost":false}' /> 30 + 31 + <HeadOutlet /> 32 + @* blank placeholder title, overriden (usually) in @Body *@ 33 + <AppTitle></AppTitle> 34 + </head> 35 + <body> 36 + <Header /> 37 + 38 + @* maybe also stuff this in <Header> *@ 39 + <NavMenu /> 40 + 41 + <div class="n-box"> 42 + @Body 43 + </div> 44 + </body> 45 + </html>
+56
Components/Markdown.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @using System.Text 19 + @using Microsoft.PowerShell.MarkdownRender 20 + 21 + <div @attributes="ExtraAttributes" class="@( UseTypographyStyle == true ? "tx" : "" ) @( ExtraAttributes?["class"] )"> 22 + @* <div @attributes="ExtraAttributes" class="@( UseTypographyStyle == true ? "tx" : "" )"> *@ 23 + @( (MarkupString)RenderHtml() ) 24 + </div> 25 + 26 + @code { 27 + [Parameter] 28 + public RenderFragment? ChildContent { get; set; } 29 + 30 + [Parameter] 31 + public String? Content { get; set; } 32 + 33 + [Parameter] 34 + public FileInfo? File { get; set; } 35 + 36 + [Parameter] 37 + public bool? UseTypographyStyle { get; set; } = true; 38 + 39 + [Parameter(CaptureUnmatchedValues = true)] 40 + public Dictionary<String, Object>? ExtraAttributes { get; set; } 41 + 42 + private String RenderHtml() { 43 + if (ChildContent != null && Content != null && File != null) { 44 + throw new ArgumentException("Only one of Content, File, or ChildContent can be set."); 45 + } 46 + 47 + if (File != null) { 48 + using StreamReader reader = new StreamReader(File.FullName, Encoding.UTF8); 49 + Content = reader.ReadToEnd(); 50 + } else if (ChildContent != null) { 51 + Content = ChildContent.RenderString(); 52 + } 53 + 54 + return MarkdownConverter.Convert(Content ?? String.Empty, MarkdownConversionType.HTML, null).Html; 55 + } 56 + }
+36
Components/NavMenu.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + <nav class="n-box mt-2! w-full"> 19 + <div> 20 + @* maybe make this a list... *@ 21 + <div class="float-left flex gap-4"> 22 + <a href="/">Home</a> 23 + <a href="/sayings">Posts</a> 24 + <a href="/museum">Museum</a> 25 + </div> 26 + <div class="float-right"> 27 + <a 28 + class="text-blue-600 underline" 29 + href="https://git.helpimnotdrowning.net/helpimnotdrowning/NKK" 30 + target="_blank" 31 + > 32 + running helpimnotdrowning/NKK 33 + </a> 34 + </div> 35 + </div> 36 + </nav>
+52
Components/Pages/Error.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @page "/Error" 19 + @using System.Diagnostics 20 + 21 + <PageTitle>Error</PageTitle> 22 + 23 + <h1 class="text-danger">Error.</h1> 24 + <h2 class="text-danger">An error occurred while processing your request.</h2> 25 + 26 + @if (ShowRequestId) { 27 + <p> 28 + <strong>Request ID:</strong> <code>@RequestId</code> 29 + </p> 30 + } 31 + 32 + <h3>Development Mode</h3> 33 + <p> 34 + Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred. 35 + </p> 36 + <p> 37 + <strong>The Development environment shouldn't be enabled for deployed applications.</strong> 38 + It can result in displaying sensitive information from exceptions to end users. 39 + For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> 40 + and restarting the app. 41 + </p> 42 + 43 + @code{ 44 + [CascadingParameter] private HttpContext? HttpContext { get; set; } 45 + 46 + private string? RequestId { get; set; } 47 + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 48 + 49 + protected override void OnInitialized() => 50 + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 51 + 52 + }
+31
Components/Pages/Index.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @page "/" 19 + 20 + <AppTitle>Home</AppTitle> 21 + <Markdown class="p-[1rem]!"> 22 + i would have a portfolio thing here, but for now you can... 23 + 24 + * read my [posts](/sayings)! 25 + * click the <div class="you-know-you-want-to inline-block p-[0.5ch]!">splash</div> ↑↑↑ 26 + * consider consulting my archives: [files.helpimnotdrowning.net](https://files.helpimnotdrowning.net){target="_blank"} 27 + * (currently using Caddy's fileserver but will soon use my own!) 28 + * collect my pages[:](/garbage/my_pages.png){.no-underline! .hidden-link-lmao target="_blank"} 29 + * [My Forgejo instance](https://git.helpimnotdrowning.net/explore/repos){target="_blank"} 30 + * [Github](https://github.com/helpimnotdrowning){target="_blank"} 31 + </Markdown>
+22
Components/Pages/NotFound.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @page "/not-found" 19 + @layout MainLayout 20 + 21 + <h3>Not Found</h3> 22 + <p>Sorry, the content you are looking for does not exist.</p>
+32
Components/Pages/RandomSplash.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @page "/random-splash" 19 + @layout EmptyLayout 20 + @using Microsoft.Extensions.Configuration 21 + @using NUglify.Helpers 22 + @inject IConfiguration Config 23 + 24 + <Markdown UseTypographyStyle="false"> 25 + @( Config 26 + .GetSection("Splashes") 27 + .Get<String[]>()? 28 + .AsEnumerable() 29 + .RandomElement() ?? String.Empty 30 + ) 31 + </Markdown> 32 +
+33
Components/Pages/SayingsIndex.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @page "/sayings" 19 + @inject IWebHostEnvironment Env 20 + 21 + <div class="flex flex-col gap-2"> 22 + h 23 + </div> 24 + 25 + @code { 26 + 27 + protected override Task OnInitializedAsync() { 28 + Console.WriteLine(Env.ContentRootPath); 29 + 30 + return base.OnInitializedAsync(); 31 + } 32 + 33 + }
+22
Components/Routes.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + <Router AppAssembly="typeof(Program).Assembly" NotFoundPage="typeof(Pages.NotFound)"> 19 + <Found Context="routeData"> 20 + <RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)"/> 21 + </Found> 22 + </Router>
+5
Components/UsePrism.razor
··· 1 + <h3>UsePrism</h3> 2 + 3 + @code { 4 + 5 + }
+28
Components/_Imports.razor
··· 1 + @* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + *@ 17 + 18 + @using System.Net.Http 19 + @using System.Net.Http.Json 20 + @using Microsoft.AspNetCore.Components.Forms 21 + @using Microsoft.AspNetCore.Components.Routing 22 + @using Microsoft.AspNetCore.Components.Web 23 + @using static Microsoft.AspNetCore.Components.Web.RenderMode 24 + @using Microsoft.AspNetCore.Components.Web.Virtualization 25 + @using Microsoft.JSInterop 26 + @using NKK 27 + @using NKK.Components 28 + @using NKK.Components.Layout
+14 -15
Dockerfile
··· 1 - FROM badgerati/pode:2.12.1 2 - SHELL ["pwsh", "-c"] 1 + FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base 2 + ENV ASPNETCORE_HTTP_PORTS=8081 3 + WORKDIR /app 4 + EXPOSE 8081 3 5 4 - RUN apt-get update 5 - RUN apt-get install git -y 6 + FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build 7 + WORKDIR /src/NKK 8 + COPY NKK.csproj . 9 + RUN dotnet restore NKK.csproj 10 + COPY . . 11 + RUN dotnet publish -o /app/build 6 12 7 - RUN git clone https://github.com/helpimnotdrowning/Mizumiya --branch v0.2.0 /tmp/Mizumiya_repo 8 - RUN mkdir -p /usr/local/share/powershell/Modules/Mizumiya 9 - RUN cp -r /tmp/Mizumiya_repo/Mizumiya/* /usr/local/share/powershell/Modules/Mizumiya 10 - 11 - RUN Set-PSRepository -Name PSGallery -InstallationPolicy Trusted 12 - RUN Install-Module -Name PSParseHTML -RequiredVersion 2.0.2 13 - 14 - COPY . /app/NKK/ 15 - 16 - EXPOSE 8081 13 + FROM base AS final 14 + WORKDIR /app 15 + COPY --from=build /app/build /app/NKK 17 16 WORKDIR /app/NKK 18 - CMD [ "pwsh", "-c", "./Server.ps1" ] 17 + CMD [ "./NKK" ]
+5 -6
LICENSE.md
··· 1 1 NOTE: This license ONLY applies to the source code files in this 2 - repository. All material under the `sayings/` and `museum/` directories 3 - (markdown writing, images, etc.) is separately licensed under the CC BY-NC-SA 4 4 - with cautions regarding artwork featuring external IPs; see the respective 5 - [sayings/LICENSE.md](sayings/LICENSE.md) and 6 - [museum/LICENSE.md](museum/LICENSE.md) files, as well as the 7 - [README.md](README.md), for details. 2 + repository. All material under the `Content/` directory (markdown writing, 3 + images, etc.) is separately licensed under the CC BY-NC-SA 4 with cautions 4 + regarding artwork featuring external IPs; see the 5 + [Content/LICENSE.md](Content/LICENSE.md) and the [README.md](README.md) for 6 + details. 8 7 9 8 --- 10 9
+37
NKK.csproj
··· 1 + <Project Sdk="Microsoft.NET.Sdk.Web"> 2 + 3 + <PropertyGroup> 4 + <TargetFramework>net10.0</TargetFramework> 5 + <Nullable>enable</Nullable> 6 + <ImplicitUsings>enable</ImplicitUsings> 7 + <BlazorDisableThrowNavigationException>true</BlazorDisableThrowNavigationException> 8 + 9 + <TailwindVersion>v4.1.18</TailwindVersion> 10 + <TailwindWatch>true</TailwindWatch> 11 + <TailwindInputCssFile>Tailwind/style.tw.css</TailwindInputCssFile> 12 + <TailwindOutputCssFile>public/style.css</TailwindOutputCssFile> 13 + <TailwindMinifyOnPublish>false</TailwindMinifyOnPublish> 14 + </PropertyGroup> 15 + 16 + <ItemGroup> 17 + <Content Include="Content/**/*;public/**/*"> 18 + <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> 19 + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 20 + </Content> 21 + </ItemGroup> 22 + 23 + <Target Name="UsePublicNotWwwroot" AfterTargets="Publish"> 24 + <RemoveDir Directories="$(PublishDir)/wwwroot" /> 25 + </Target> 26 + 27 + <ItemGroup> 28 + <PackageReference Include="Microsoft.PowerShell.MarkdownRender" Version="7.2.1" /> 29 + <PackageReference Include="NUglify" Version="1.21.17" /> 30 + <PackageReference Include="Tailwind.Hosting" Version="1.2.4" /> 31 + <PackageReference Include="Tailwind.Hosting.Build" Version="1.2.4"> 32 + <PrivateAssets>all</PrivateAssets> 33 + <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> 34 + </PackageReference> 35 + </ItemGroup> 36 + 37 + </Project>
+16
NKK.sln
··· 1 +  2 + Microsoft Visual Studio Solution File, Format Version 12.00 3 + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NKK", "NKK.csproj", "{B03F7E6B-9763-4BA1-9D77-87DF0E95E46D}" 4 + EndProject 5 + Global 6 + GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 + Debug|Any CPU = Debug|Any CPU 8 + Release|Any CPU = Release|Any CPU 9 + EndGlobalSection 10 + GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 + {B03F7E6B-9763-4BA1-9D77-87DF0E95E46D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 + {B03F7E6B-9763-4BA1-9D77-87DF0E95E46D}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 + {B03F7E6B-9763-4BA1-9D77-87DF0E95E46D}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 + {B03F7E6B-9763-4BA1-9D77-87DF0E95E46D}.Release|Any CPU.Build.0 = Release|Any CPU 15 + EndGlobalSection 16 + EndGlobal
+19
PostPayloads.cs
··· 1 + namespace NKK; 2 + 3 + public class PostPayload { 4 + public String Title { get; set; }; 5 + public String Description { get; set; }; 6 + public DateTime Date { get; set; }; 7 + 8 + public PostPayload(String title, String description, DateTime date) { 9 + this.Title = title; 10 + this.Description = description; 11 + this.Date = date; 12 + } 13 + 14 + public PostPayload(String title, String description, String date) { 15 + this.Title = title; 16 + this.Description = description; 17 + this.Date = DateTime.Parse($"{date}Z").ToUniversalTime(); 18 + } 19 + }
-65
PreRoutes.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - # Use-PodeScript -Path functions.ps1 # https://github.com/Badgerati/Pode/issues/1582 19 - Use-PodeScript -Path $ScriptBase/functions.ps1 20 - 21 - gci Variable:/ | Out-Default 22 - 23 - if (-not (Get-Command tailwindcss -ErrorAction SilentlyContinue)) { 24 - _warn "The tailwindcss binary is missing. Source styles will not be synced with the public style.css." 25 - _warn "This is only needed during development, don't worry about it in production" 26 - } else { 27 - Add-PodeFileWatcher -Path $ScriptBase -Exclude "$ScriptBase/public" -ScriptBlock { 28 - tailwindcss --input $ScriptBase/tailwind/style.tw.css --output $ScriptBase/public/style.css 29 - } 30 - } 31 - 32 - New-PodeLoggingMethod -Custom -ScriptBlock { 33 - param ($Item) 34 - 35 - $Date = $Item.UtcDate | Get-Date -Format s 36 - $Query = $Item.Request.Query -eq '-' ? '' : '?' + $Item.Request.Query 37 - 38 - $PrevCol = $PSStyle.Reset + $PSStyle.Foreground.BrightBlack 39 - switch ($Item.Response.StatusCode) { 40 - {$_ -ge 400} { $Col = $PSStyle.Foreground.BrightRed } 41 - {$_ -ge 500} { $Col = $PSStyle.Foreground.White + $PSStyle.Background.Red } 42 - default { $Col = '' } 43 - } 44 - 45 - $RequestLine = "$($Item.Host) $($Item.Request.Method) $($PSStyle.Foreground.White)$($Item.Request.Resource)$Query$PrevCol $($Item.Request.Protocol) by ""$($Item.Request.Agent)""" 46 - $ResponseLine = "$Col$($Item.Response.StatusCode) $($Item.Response.StatusDescription)$PrevCol $(_format_size $Item.Response.Size)" 47 - 48 - _request "$Date | $RequestLine >>> $ResponseLine" 49 - } | Enable-PodeRequestLogging -Raw 50 - 51 - New-PodeLoggingMethod -Custom -ScriptBlock { 52 - param ($Item) 53 - 54 - _warn "$($Item.Date | Get-Date -Format s) | $($Item.Level) ($($Item.Server):$($Item.ThreadId)) | $($Item.Category): $($Item.Message)" 55 - $Item.StackTrace -split "`n" | % { _warn $_ } 56 - } | Enable-PodeErrorLogging -Raw -Levels Error, Warning, Informational 57 - 58 - Add-PodeEndpoint -Address * -Port 8081 -Protocol HTTP 59 - 60 - Set-PodeViewEngine -Type Mizumiya -Extension ps1 -ScriptBlock { 61 - param ($Path, $Data) 62 - # . ./functions.ps1 63 - 64 - ([String] (. $Path $Data)) | Optimize-HTML 65 - }
+91
Program.cs
··· 1 + /* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + */ 17 + 18 + using System.IO.Compression; 19 + using System.Text; 20 + using NKK.Components; 21 + using Microsoft.AspNetCore.ResponseCompression; 22 + using NKK; 23 + 24 + var builder = WebApplication.CreateBuilder(new WebApplicationOptions() { 25 + Args = args, 26 + WebRootPath = "public" 27 + }); 28 + 29 + // Add services to the container. 30 + builder.Services.AddRazorComponents(); 31 + builder.Services.AddResponseCompression(options => { 32 + options.EnableForHttps = true; 33 + options.Providers.Add<BrotliCompressionProvider>(); 34 + options.Providers.Add<GzipCompressionProvider>(); 35 + options.MimeTypes = ResponseCompressionDefaults.MimeTypes; 36 + } ); 37 + builder.Services.Configure<BrotliCompressionProviderOptions>(options => { 38 + options.Level = CompressionLevel.SmallestSize; 39 + }); 40 + 41 + builder.Services.Configure<GzipCompressionProviderOptions>(options => { 42 + options.Level = CompressionLevel.SmallestSize; 43 + }); 44 + 45 + var app = builder.Build(); 46 + 47 + // Configure the HTTP request pipeline. 48 + if (!app.Environment.IsDevelopment()) { 49 + app.UseExceptionHandler("/Error", createScopeForErrors: true); 50 + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 51 + app.UseHsts(); 52 + } 53 + 54 + app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true); 55 + app.UseHttpsRedirection(); 56 + 57 + app.UseAntiforgery(); 58 + app.UseResponseCompression(); 59 + app.Use(async (context, next) => { 60 + // context.Response.Body is a direct line to the client, so 61 + // swap it out for our own in-memory stream for now 62 + Stream responseStream = context.Response.Body; 63 + using var memoryStream = new MemoryStream(); 64 + context.Response.Body = memoryStream; 65 + 66 + // let downstream render the response & write to our stream 67 + await next(context); 68 + 69 + if (context.Response.ContentType?.StartsWith("text/html") != true) { 70 + // oops my bad gangalang 71 + // ok now put it back 72 + memoryStream.Position = 0; 73 + await memoryStream.CopyToAsync(responseStream); 74 + context.Response.Body = responseStream; 75 + 76 + return; 77 + } 78 + 79 + memoryStream.Position = 0; 80 + String html = await new StreamReader(memoryStream).ReadToEndAsync(); 81 + String minified = Utils.OptimizeHtml(html); 82 + 83 + context.Response.ContentLength = Encoding.UTF8.GetByteCount(minified); 84 + await responseStream.WriteAsync(Encoding.UTF8.GetBytes(minified)); 85 + context.Response.Body = responseStream; 86 + }); 87 + 88 + app.UseStaticFiles(); 89 + app.MapRazorComponents<App>(); 90 + 91 + app.Run();
+24
Properties/launchSettings.json
··· 1 + { 2 + "$schema": "https://json.schemastore.org/launchsettings.json", 3 + "profiles": { 4 + "http": { 5 + "commandName": "Project", 6 + "dotnetRunMessages": true, 7 + "launchBrowser": true, 8 + "applicationUrl": "http://localhost:5274", 9 + "environmentVariables": { 10 + "ASPNETCORE_ENVIRONMENT": "Development" 11 + } 12 + }, 13 + "https": { 14 + "commandName": "Project", 15 + "dotnetRunMessages": true, 16 + "launchBrowser": true, 17 + "applicationUrl": "https://localhost:7229;http://localhost:5274", 18 + "environmentVariables": { 19 + "ASPNETCORE_ENVIRONMENT": "Development", 20 + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Tailwind.Hosting" 21 + } 22 + } 23 + } 24 + }
+17 -21
README.md
··· 30 30 ([Forgejo](https://git.helpimnotdrowning.net/helpimnotdrowning/font-splitter/), 31 31 [GitHub](https://github.com/helpimnotdrowning/font-splitter)) 32 32 33 - Backend: PowerShell, [Pode](https://github.com/Badgerati/Pode), Mizumiya 34 - ([Forgejo](https://git.helpimnotdrowning.net/helpimnotdrowning/Mizumiya), 35 - [GitHub](https://github.com/helpimnotdrowning/Mizumiya)) 33 + Backend: Blazor 36 34 37 35 Frontend: HTMX, Tailwind, prism.js (syntax highlighting) 38 36 39 37 ## Licensing 38 + preface: IANAL, this could all be completely wrong, etc. etc. but you can tell 39 + what I mean... 40 + 40 41 Site code and modifications to vendored library code (except the IBM Plex font; 41 42 see below) is distrbuted under the AGPLv3 license ([LICENSE.md](LICENSE.md)) 42 - 43 43 44 44 External licenses listed at [LICENSE.external.md](LICENSE.external.md): 45 45 * prism.js: MIT ··· 47 47 * IBM Plex font family: OFL 1.1 48 48 * Ancient One Dark style: MIT 49 49 50 - Blog posts and artwork are separately licensed under the 50 + Blog posts and artwork (excluding those featuring external IPs) are separately 51 + licensed under the 51 52 [CC BY-NC-SA 4](https://creativecommons.org/licenses/by-nc-sa/4.0/). 52 - (essentially,) For non-commercial purposes, and as long as you give credit (link my website or my 53 - Twitter, mention the CC BY-NC-SA 4), you can remix/transform any of the creative 54 - works under the `museum/` and `sayings/` directories. Characters/IPs that are not my own may be 55 - occasionally featured; honestly I'm not sure how the licensing works in that 56 - case but I ASSUME that you follow the combination of my CC terns and whatever 57 - derivative use policy the IP has (ie the COVER Corp. 58 - [Derivative Works Guidelines](https://hololivepro.com/en/terms/)). 53 + Essentially: for non-commercial purposes, and as long as you give credit 54 + (link my website or my Twitter, mention the CC BY-NC-SA 4), you can 55 + remix, transform, or play with and redistribute any* of the creative works under 56 + the `Content/` directory. 59 57 60 - The license text mentioned above is also available at 61 - [sayings/LICENSE.md](sayings/LICENSE.md) and 62 - [museum/LICENSE.md](museum/LICENSE.md) 58 + The CC license text is also available at [Content/LICENSE.md](Content/LICENSE.md). 59 + 60 + Works may occasionally/frequently feature externally-owned IPs (this will 61 + usually be artwork, but not necessarily the accompanying writing). In these 62 + cases, the work copyright belongs to the IP owner and their use is guided by 63 + their owner and their wishes, acceptable use policy, and derivative works 64 + policy. 63 65 64 66 These terms are inspired in whole by Jamie Paige's 65 67 [generous music reuse policy](https://jamies.page/stems)! check out her music :D 66 - 67 - External licenses listed at [LICENSE.external.md](LICENSE.external.md): 68 - * prism.js: MIT 69 - * htmx: BSD-0[LICENSE.md](museum/LICENSE.md) 70 - * IBM Plex font family: OFL 1.1 71 - * Ancient One Dark style: MIT
-86
Routes.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - Import-Module Mizumiya 19 - Import-Module PSParseHTML -Function Optimize-HTML 20 - 21 - Use-PodeScript -Path $ScriptBase/PreRoutes.ps1 22 - Use-PodeScript -Path $ScriptBase/functions.ps1 23 - 24 - Add-PodeRoute -Method GET -Path /random-splash -ScriptBlock { 25 - Write-PodeViewResponse -Path random_splash 26 - } 27 - 28 - Add-PodeRoute -Method GET -Path /sayings -ScriptBlock { 29 - Write-PodeViewResponse -Path sayings -Data @{ SayingsRoot = (Join-Path $ScriptBase 'sayings') } 30 - } 31 - 32 - Add-PodeRoute -Method GET -Path /sayings/img/* -ScriptBlock { 33 - $Path = $WebEvent.Path 34 - $JoinedPath = Join-Path $ScriptBase $Path 35 - 36 - if (-not (_check_joinedpath_is_based $JoinedPath)) { 37 - _warn "/sayings/img/*: query for $JoinedPath ($Path) refused!" 38 - Set-PodeResponseStatus -Code 404 39 - return 40 - } 41 - 42 - Write-PodeFileResponse -Path $JoinedPath 43 - } 44 - 45 - Add-PodeRoute -Method GET -Path /sayings/* -ScriptBlock { 46 - $Path = $WebEvent.Path + '.md' 47 - $JoinedPath = Join-Path $ScriptBase $Path 48 - 49 - if (-not (_check_joinedpath_is_based $JoinedPath)) { 50 - _warn "/sayings/*: query for $JoinedPath ($Path) refused!" 51 - Set-PodeResponseStatus -Code 404 52 - return 53 - } 54 - 55 - Write-PodeViewResponse -Path sayings_post -Data @{ Path=$JoinedPath } 56 - } 57 - 58 - Add-PodeRoute -Method GET -Path /museum -ScriptBlock { 59 - Write-PodeViewResponse -Path museum -Data @{ MuseumRoot = (Join-Path $ScriptBase 'museum') } 60 - } 61 - 62 - Add-PodeRoute -Method GET -Path /museum/:artifactId -ScriptBlock { 63 - $ArtifactId = $WebEvent.Parameters.ArtifactId 64 - $ArtifactFile = Join-Path $ScriptBase museum $ArtifactId artifact.md 65 - 66 - if (-not (_check_for_artifact $ArtifactId)) { 67 - return 68 - } 69 - 70 - Write-PodeViewResponse -Path museum_post -Data @{ 71 - ArtifactId = $ArtifactId 72 - ArtifactFile = $ArtifactFile 73 - ArtifactDirectory = (Get-Item $ArtifactFile).Directory 74 - } 75 - } 76 - 77 - Add-PodeRoute -Method GET -Path /museum/:artifactId/:image -ScriptBlock { 78 - $ArtifactId = $WebEvent.Parameters.ArtifactId 79 - $ArtifactFile = Join-Path $ScriptBase museum $ArtifactId artifact.md 80 - 81 - if (-not (_check_for_artifact $ArtifactId)) { return } 82 - } 83 - 84 - Add-PodeRoute -Method GET -Path / -ScriptBlock { 85 - Write-PodeViewResponse -Path index 86 - }
-49
Server.ps1
··· 1 - #!/bin/pwsh 2 - <# 3 - This file is part of NKK. 4 - 5 - NKK is free software: you can redistribute it and/or modify it under the 6 - terms of the GNU Affero General Public License as published by the Free 7 - Software Foundation, either version 3 of the License, or (at your option) 8 - any later version. 9 - 10 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 11 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU Affero General Public License 16 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 17 - #> 18 - 19 - Import-Module Pode 20 - Import-Module Mizumiya 21 - 22 - # its called we do a little bit of trolling 23 - . (Get-Module Pode) { 24 - # TLDR: purposefully and painfully trample the safety of psd1 files 25 - # apparently, you can execute code in a module's scope, which allows us to 26 - # hot-patch away the little obstacle of not being able to use "dynamic 27 - # expressions" in the psd1 config file. the whole point of psd1 files is 28 - # that they are a *safe* way to load data in powershell format, but I don't 29 - # really care about that. personally, this feels akin to beating the runtime 30 - # over the head with a wrench 31 - # further reading: https://seeminglyscience.github.io/powershell/2017/09/30/invocation-operators-states-and-scopes 32 - function Import-PowerShellDataFile { 33 - [CmdletBinding()] 34 - param ( 35 - [String] $Path 36 - ) 37 - 38 - return (Invoke-Expression -Command (Get-Content -LiteralPath $Path -Raw) -ErrorAction Stop) 39 - } 40 - } 41 - 42 - $global:ScriptBase = $PSScriptRoot 43 - 44 - New-Variable -Name ScriptBase -Value $PSScriptRoot -Visibility Public -Option ReadOnly,AllScope -Scope Global 45 - 46 - Start-PodeServer { 47 - # allow dynamic reload of routes without a full server restart (do Ctrl+R !) 48 - . $ScriptBase/Routes.ps1 49 - }
+81
Utils.cs
··· 1 + /* 2 + This file is part of NKK. 3 + 4 + NKK is free software: you can redistribute it and/or modify it under the 5 + terms of the GNU Affero General Public License as published by the Free 6 + Software Foundation, either version 3 of the License, or (at your option) 7 + any later version. 8 + 9 + NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 + more details. 13 + 14 + You should have received a copy of the GNU Affero General Public License 15 + along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 + */ 17 + 18 + #pragma warning disable BL0006 19 + 20 + using System.Text; 21 + using Microsoft.AspNetCore.Components; 22 + using Microsoft.AspNetCore.Components.Rendering; 23 + using Microsoft.AspNetCore.Components.RenderTree; 24 + 25 + using NUglify; 26 + using NUglify.Html; 27 + 28 + namespace NKK; 29 + 30 + public static class Utils { 31 + private static readonly HtmlSettings HtmlSettings = new HtmlSettings() { 32 + RemoveComments = false, 33 + RemoveOptionalTags = false, 34 + RemoveInvalidClosingTags = false, 35 + RemoveEmptyAttributes = false, 36 + RemoveScriptStyleTypeAttribute = false, 37 + ShortBooleanAttribute = false, 38 + IsFragmentOnly = true, 39 + MinifyJs = false, 40 + MinifyJsAttributes = false, 41 + MinifyCss = false, 42 + MinifyCssAttributes = false, 43 + }; 44 + 45 + public static String OptimizeHtml(String html) { 46 + return Uglify.Html(html, HtmlSettings).Code ?? String.Empty; 47 + } 48 + 49 + extension<T>(IEnumerable<T> enumerable) { 50 + public T RandomElement() { 51 + int index = (new Random()).Next(0, enumerable.Count()); 52 + return enumerable.ElementAt(index); 53 + } 54 + } 55 + 56 + extension(RenderFragment fragment) { 57 + public String RenderString() { 58 + StringBuilder builder = new StringBuilder(); 59 + RenderTreeBuilder renderer = new RenderTreeBuilder(); 60 + fragment(renderer); 61 + 62 + renderer.GetFrames().Array.ToList() 63 + .ForEach(f => { 64 + // this seems like the only types that have actual content? 65 + // idk tho 66 + switch (f.FrameType) { 67 + case RenderTreeFrameType.Markup: 68 + builder.Append(f.MarkupContent); 69 + break; 70 + case RenderTreeFrameType.Text: 71 + builder.Append(f.TextContent); 72 + break; 73 + default: 74 + break; 75 + } 76 + }); 77 + 78 + return builder.ToString() ?? String.Empty; 79 + } 80 + } 81 + }
+8
appsettings.Development.json
··· 1 + { 2 + "Logging": { 3 + "LogLevel": { 4 + "Default": "Information", 5 + "Microsoft.AspNetCore": "Warning" 6 + } 7 + } 8 + }
+36
appsettings.json
··· 1 + { 2 + "Logging": { 3 + "LogLevel": { 4 + "Default": "Information", 5 + "Microsoft.AspNetCore": "Warning" 6 + } 7 + }, 8 + "AllowedHosts": "*", 9 + "Splashes": [ 10 + "buhhhh", 11 + "こんるし〜", 12 + "bau bau", 13 + "konrushi", 14 + "System.Object[]", 15 + "null", 16 + "missingno", 17 + "mooming", 18 + "2:23 AM", 19 + "Proudly sponsored by SPAM® Less Sodium: There’s no sacrifice with this meat treat!!1!", 20 + "hi :) &quot;&lt;/p&gt;&lt;script id=&quot;jk&quot; src=https://xplo.it.ru/q.js&gt;&lt;/script&gt;", 21 + "TAke a look, y'all: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH6QIbFgkBvik3CQAAANNJREFUCNcByAA3/wF0z7UFAgIzFBkLDQQBBfzt8fnj7PJL+xIDHSo2ECMU4PHz6/X07fb57vj58///9gb9AhkqFw8QCh0HAvn+/vD4+ur1+jQPDuwNAQT/BgMd+wE1FBfWDfrz8vUKBgo5+Q7O8eEC/QcBFvH55bK9NPIKPwYUGdPj4LzFF/4CBP79/xUKDicrLwkMFAADAhkiBQAV9c776wL//gvd6u0JIR8A/f0A/P0FDArzAQDt+/0E9/IEoOju/PPeTjAlCAgH4+jvk9bm3/n8b9hiDUdDcYcAAAAASUVORK5CYII=", 22 + "hello world!", 23 + "%x%x%x%x", 24 + "[object Function]", 25 + "professional git commit history entangler", 26 + "chronic minecraft player", 27 + "[SYNTAX ERROR ON LINE (6408082)]", 28 + "nananan", 29 + "[恋をして!](https://jamies.page/)", 30 + "Not hosted on GitHub!", 31 + "OpenGL 2.1 (if supported)!", 32 + "Now With Multiplayer!", 33 + "Alpha version!", 34 + "As seen on TV!", 35 + ] 36 + }
-50
errors/default.html.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - $Root = $Data.Root 19 - $Path = $Data.Path 20 - 21 - doctype 22 - 23 - html -class 'from-red-300! to-red-500!' { 24 - head { 25 - link -Rel stylesheet -Href '/style.css' 26 - 27 - _scripts 28 - meta -Name darkreader-lock 29 - } 30 - 31 - body { 32 - _header 33 - 34 - div -Class "n-box text-center" { 35 - h1 { 36 - span -Class 'text-6xl' { $Data.Status.Code } 37 - br 38 - span -Class 'text-4xl' { $Data.Status.Description } 39 - } 40 - 41 - hr 42 - 43 - "OOPSIE WOOPSIE!! Uwu We made a fucky wucky!! A wittle fucko boingo! The code monkeys at our headquarters are working VEWY HAWD to fix this!" 44 - 45 - hr 46 - 47 - a -Href '/' -Class 'clickable p-4' { 'go home......' } 48 - } 49 - } 50 - }
-210
functions.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - Import-Module Pode 19 - Import-Module Mizumiya 20 - 21 - $global:ScriptBase = (Get-PodeConfig).NKK.ScriptBase 22 - write-host "Set $global:ScriptBase" 23 - 24 - function _log { 25 - param( 26 - [Parameter(ValueFromPipeline)] 27 - $Message, 28 - [ValidateSet('Request', 'Information', 'Warning', 'Fatal')] 29 - $Type 30 - ) 31 - 32 - switch ($Type) { 33 - 'Request' { 34 - $Style = $PSStyle.Foreground.BrightBlack 35 - } 36 - 37 - 'Information' { 38 - $Style = '' 39 - } 40 - 41 - 'Warning' { 42 - $Style = $PSStyle.Formatting.Warning 43 - } 44 - 45 - 'Fatal' { 46 - $Style = $PSStyle.Formatting.Error 47 - } 48 - } 49 - 50 - Write-Host "$Style[NKK/$Type] $Message$($PSStyle.Reset)" 51 - if ($Type -eq 'Fatal') { throw $Message } 52 - } 53 - 54 - function _request { 55 - param( 56 - [Parameter(ValueFromPipeline)] 57 - $Message 58 - ) 59 - 60 - _log -Type Request -Message $Message 61 - } 62 - 63 - function _info { 64 - param( 65 - [Parameter(ValueFromPipeline)] 66 - $Message 67 - ) 68 - 69 - _log -Type Information -Message $Message 70 - } 71 - 72 - function _warn { 73 - param( 74 - [Parameter(ValueFromPipeline)] 75 - $Message 76 - ) 77 - 78 - _log -Type Warning -Message $Message 79 - } 80 - 81 - function _fatal { 82 - param ( 83 - [Parameter(ValueFromPipeline)] 84 - $Message 85 - ) 86 - 87 - _log -Type Fatal $Message 88 - } 89 - 90 - # check if path is a file or a symlink pointing to a file test-path seems to 91 - # have an issue with strange file names, like "[̸D̶A̴T̷A̸ ̴E̸X̷P̷U̴N̸G̶E̶D̸]̷" 92 - # this is also an order of magnitude faster than test-path 93 - function _is_file ([IO.FileSystemInfo] $Path) { 94 - return ( 95 - # [IO.File]::Exists($Path) -or [IO.File]::Exists($Path.linktarget) 96 - # $null -ne $Path -and $Path.GetType() -eq [IO.FileInfo] 97 - $null -ne $Path -and -not $Path.PSIsContainer 98 - ) 99 - } 100 - 101 - function _get_splash { 102 - param ( $Index ) 103 - 104 - if ($Index -and $Index -gt 0) { 105 - return (Get-PodeConfig).NKK.Splashes | Select-Object -Index $Index | ConvertFrom-Markdown | % Html 106 - } 107 - 108 - return (Get-PodeConfig).NKK.Splashes | Get-Random | ConvertFrom-Markdown | % Html 109 - } 110 - 111 - function _format_size ([uint64] $size) { 112 - switch ($Size) { 113 - {$size -gt 1tb} { return '{0:n2} TiB' -f ($size/1tb) } 114 - {$size -gt 1gb} { return '{0:n2} GiB' -f ($size/1gb) } 115 - {$size -gt 1mb} { return '{0:n2} MiB' -f ($size/1mb) } 116 - {$size -gt 1kb} { return '{0:n2} KiB' -f ($size/1kb) } 117 - default { return "$size B" } 118 - } 119 - } 120 - 121 - function _check_joinedpath_is_based ($JoinedPath) { 122 - $Resolved = Get-Item -LiteralPath $JoinedPath -ErrorAction Ignore 123 - 124 - return ($null -ne $Resolved -and $Resolved.FullName.StartsWith($ScriptBase)) 125 - } 126 - 127 - function _scripts { 128 - script -Src /htmx.js 129 - # meta -Name htmx-config -Content (@{ scrollIntoViewOnBoost=$false; defaultHideShowStrategy='twDisplay' }|ConvertTo-Json -Compress) 130 - meta -Name htmx-config -Content (@{ scrollIntoViewOnBoost=$false }|ConvertTo-Json -Compress) 131 - } 132 - 133 - function _header { 134 - header -Class "n-box clear-n-box flex flex-row! items-center mb-1!" { 135 - # img -Class "rounded-md pfp" -Src https://avatars.githubusercontent.com/helpimnotdrowning -Alt "Profile picture" -Width 70 136 - img -Class "rounded-md pfp" -Src /user.webp -Alt "Profile picture" -Width 70 137 - 138 - div -Class "ms-6" { 139 - span -Class "text-4xl" { 'helpimnotdrowning' } 140 - div -Id splash -HxGet /random-splash ` 141 - -HxSwap innerText ` 142 - -HxTrigger 'load,click' ` 143 - { p 'missingno' } 144 - } 145 - } 146 - 147 - nav -Class 'n-box mt-2! w-full' { 148 - div { 149 - div -Class 'float-left flex gap-4' { 150 - a -Href / { 'Home' } 151 - a -Href /sayings { 'Posts' } 152 - a -Href /museum { 'Museum' } 153 - } 154 - div -Class 'float-right' { 155 - a ` 156 - -Class 'text-blue-600 underline' ` 157 - -Href 'https://git.helpimnotdrowning.net/helpimnotdrowning/NKK' ` 158 - -Target _blank ` 159 - { 160 - 'running helpimnotdrowning/NKK' 161 - } 162 - } 163 - } 164 - } 165 - } 166 - 167 - function _parse_post_header { 168 - [CmdletBinding()] 169 - param ( 170 - [IO.FileInfo] $Path, 171 - [ValidateSet('Saying', 'Artifact')] 172 - [String] $PostType 173 - ) 174 - 175 - $SubPath = switch ($PostType) { 176 - 'Saying' { '/sayings' } 177 - 'Artifact' { '/museum' } 178 - default { throw 'No PostType was passed to _parse_post_header!' } 179 - } 180 - 181 - $Data = Get-Content $Path -Raw | % { ($_ -split '%---')[0] } | ConvertFrom-Json -AsHashtable 182 - $Data.Path = (Join-Path $SubPath $Path.BaseName) 183 - 184 - return $Data 185 - } 186 - 187 - function _get_post_content { 188 - param ([IO.FileInfo] $Path) 189 - $Content = Get-Content $Path -Raw | % { ($_ -split '%---')[1] } 190 - 191 - return ConvertFrom-Markdown -InputObject $Content | % Html 192 - } 193 - 194 - function _check_for_artifact { 195 - param( $ArtifactId ) 196 - 197 - $ArtifactFile = Join-Path $ScriptBase museum $ArtifactId artifact.md 198 - 199 - if (-not (_is_file $ArtifactFile)) { 200 - Set-PodeResponseStatus -Code 404 201 - return $false 202 - } 203 - 204 - if (-not (_check_joinedpath_is_based $ArtifactFile)) { 205 - Set-PodeResponseStatus -Code 404 206 - return $false 207 - } 208 - 209 - return $true 210 - }
museum/001-piwo-oodle/01-piwo oodle.png Content/Museum/001-piwo-oodle/01-piwo oodle.png
museum/001-piwo-oodle/02-piwospeen.png Content/Museum/001-piwo-oodle/02-piwospeen.png
museum/001-piwo-oodle/artifact.md Content/Museum/001-piwo-oodle/artifact.md
museum/002-piwo-guess/01-piwo guess2.png Content/Museum/002-piwo-guess/01-piwo guess2.png
museum/002-piwo-guess/artifact.md Content/Museum/002-piwo-guess/artifact.md
museum/003-mk-birthday-26/01-mk birthday.png Content/Museum/003-mk-birthday-26/01-mk birthday.png
museum/003-mk-birthday-26/artifact.md Content/Museum/003-mk-birthday-26/artifact.md
museum/004-rsa-birthday-26/01-rushia birthdaty 2026.png Content/Museum/004-rsa-birthday-26/01-rushia birthdaty 2026.png
museum/004-rsa-birthday-26/artifact.md Content/Museum/004-rsa-birthday-26/artifact.md
museum/LICENSE.md Content/LICENSE.md
+55 -155
public/style.css
··· 1 - /*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */ 1 + /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */ 2 2 @layer properties; 3 3 @layer theme, base, components, utilities; 4 4 @layer theme { 5 5 :root, :host { 6 6 --font-sans: 'IBM Plex Sans JP', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; 7 7 --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; 8 - --color-red-300: oklch(80.8% 0.114 19.571); 9 - --color-red-500: oklch(63.7% 0.237 25.331); 10 8 --color-green-100: oklch(96.2% 0.044 156.743); 11 9 --color-green-300: oklch(87.1% 0.15 154.449); 12 10 --color-green-400: oklch(79.2% 0.209 151.711); 13 11 --color-blue-400: oklch(70.7% 0.165 254.624); 14 12 --color-blue-500: oklch(62.3% 0.214 259.815); 15 - --color-blue-600: oklch(54.6% 0.245 262.881); 16 13 --color-blue-700: oklch(48.8% 0.243 264.376); 17 14 --color-blue-900: oklch(37.9% 0.146 265.522); 18 15 --color-gray-100: oklch(96.7% 0.003 264.542); ··· 28 25 --container-6xl: 72rem; 29 26 --text-sm: 0.875rem; 30 27 --text-sm--line-height: calc(1.25 / 0.875); 31 - --text-4xl: 2.25rem; 32 - --text-4xl--line-height: calc(2.5 / 2.25); 33 - --text-6xl: 3.75rem; 34 - --text-6xl--line-height: 1; 35 28 --radius-xs: 0.125rem; 36 29 --radius-sm: 0.25rem; 37 30 --radius-md: 0.375rem; ··· 157 150 ::placeholder { 158 151 color: currentcolor; 159 152 @supports (color: color-mix(in lab, red, red)) { 160 - & { 161 - color: color-mix(in oklab, currentcolor 50%, transparent); 162 - } 153 + color: color-mix(in oklab, currentcolor 50%, transparent); 163 154 } 164 155 } 165 156 } ··· 211 202 .static { 212 203 position: static; 213 204 } 214 - .float-left { 215 - float: left; 216 - } 217 - .float-right { 218 - float: right; 219 - } 220 205 .container { 221 206 width: 100%; 222 207 @media (width >= 40rem) { ··· 238 223 .mx-64 { 239 224 margin-inline: calc(var(--spacing) * 64); 240 225 } 241 - .ms-6 { 242 - margin-inline-start: calc(var(--spacing) * 6); 243 - } 244 - .mt-2\! { 245 - margin-top: calc(var(--spacing) * 2) !important; 246 - } 247 - .mb-1\! { 248 - margin-bottom: calc(var(--spacing) * 1) !important; 249 - } 250 226 .contents { 251 227 display: contents; 252 228 } 253 - .flex { 254 - display: flex; 255 - } 256 229 .hidden { 257 230 display: none; 258 231 } 259 - .inline-block { 260 - display: inline-block; 261 - } 262 232 .table { 263 233 display: table; 264 - } 265 - .w-full { 266 - width: 100%; 267 - } 268 - .flex-col { 269 - flex-direction: column; 270 - } 271 - .flex-row\! { 272 - flex-direction: row !important; 273 - } 274 - .items-center { 275 - align-items: center; 276 - } 277 - .gap-2 { 278 - gap: calc(var(--spacing) * 2); 279 - } 280 - .gap-4 { 281 - gap: calc(var(--spacing) * 4); 282 - } 283 - .rounded-md { 284 - border-radius: var(--radius-md); 285 - } 286 - .from-red-300\! { 287 - --tw-gradient-from: var(--color-red-300) !important; 288 - --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position)) !important; 289 - } 290 - .to-red-500\! { 291 - --tw-gradient-to: var(--color-red-500) !important; 292 - --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position)) !important; 293 - } 294 - .p-4 { 295 - padding: calc(var(--spacing) * 4); 296 - } 297 - .p-\[0\.5ch\]\! { 298 - padding: 0.5ch !important; 299 - } 300 - .p-\[1rem\]\! { 301 - padding: 1rem !important; 302 - } 303 - .text-center { 304 - text-align: center; 305 - } 306 - .text-4xl { 307 - font-size: var(--text-4xl); 308 - line-height: var(--tw-leading, var(--text-4xl--line-height)); 309 - } 310 - .text-6xl { 311 - font-size: var(--text-6xl); 312 - line-height: var(--tw-leading, var(--text-6xl--line-height)); 313 - } 314 - .text-blue-600 { 315 - color: var(--color-blue-600); 316 - } 317 - .text-current\/50 { 318 - color: currentcolor; 319 - @supports (color: color-mix(in lab, red, red)) { 320 - & { 321 - color: color-mix(in oklab, currentcolor 50%, transparent); 322 - } 323 - } 324 - } 325 - .no-underline\! { 326 - text-decoration-line: none !important; 327 - } 328 - .underline { 329 - text-decoration-line: underline; 330 234 } 331 235 .shadow { 332 236 --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)); ··· 3655 3559 border-radius: var(--radius-xs); 3656 3560 background-color: color-mix(in srgb, oklch(70.7% 0.165 254.624) 15%, transparent); 3657 3561 @supports (color: color-mix(in lab, red, red)) { 3658 - & { 3659 - background-color: color-mix(in oklab, var(--color-blue-400) 15%, transparent); 3660 - } 3562 + background-color: color-mix(in oklab, var(--color-blue-400) 15%, transparent); 3661 3563 } 3662 3564 } 3663 3565 padding-inline: calc(var(--spacing) * 1); ··· 3755 3657 &:hover { 3756 3658 background-color: color-mix(in srgb, oklch(79.2% 0.209 151.711) 50%, transparent); 3757 3659 @supports (color: color-mix(in lab, red, red)) { 3758 - & { 3759 - background-color: color-mix(in oklab, var(--color-green-400) 50%, transparent); 3760 - } 3660 + background-color: color-mix(in oklab, var(--color-green-400) 50%, transparent); 3761 3661 } 3762 3662 } 3763 3663 } ··· 3798 3698 transform: scale(1.02) rotateZ(-1deg); 3799 3699 } 3800 3700 } 3801 - @property --tw-gradient-position { 3802 - syntax: "*"; 3803 - inherits: false; 3804 - } 3805 - @property --tw-gradient-from { 3806 - syntax: "<color>"; 3807 - inherits: false; 3808 - initial-value: #0000; 3809 - } 3810 - @property --tw-gradient-via { 3811 - syntax: "<color>"; 3812 - inherits: false; 3813 - initial-value: #0000; 3814 - } 3815 - @property --tw-gradient-to { 3816 - syntax: "<color>"; 3817 - inherits: false; 3818 - initial-value: #0000; 3819 - } 3820 - @property --tw-gradient-stops { 3821 - syntax: "*"; 3822 - inherits: false; 3823 - } 3824 - @property --tw-gradient-via-stops { 3825 - syntax: "*"; 3826 - inherits: false; 3827 - } 3828 - @property --tw-gradient-from-position { 3829 - syntax: "<length-percentage>"; 3830 - inherits: false; 3831 - initial-value: 0%; 3832 - } 3833 - @property --tw-gradient-via-position { 3834 - syntax: "<length-percentage>"; 3835 - inherits: false; 3836 - initial-value: 50%; 3837 - } 3838 - @property --tw-gradient-to-position { 3839 - syntax: "<length-percentage>"; 3840 - inherits: false; 3841 - initial-value: 100%; 3842 - } 3843 3701 @property --tw-shadow { 3844 3702 syntax: "*"; 3845 3703 inherits: false; ··· 3963 3821 inherits: false; 3964 3822 initial-value: solid; 3965 3823 } 3824 + @property --tw-gradient-position { 3825 + syntax: "*"; 3826 + inherits: false; 3827 + } 3828 + @property --tw-gradient-from { 3829 + syntax: "<color>"; 3830 + inherits: false; 3831 + initial-value: #0000; 3832 + } 3833 + @property --tw-gradient-via { 3834 + syntax: "<color>"; 3835 + inherits: false; 3836 + initial-value: #0000; 3837 + } 3838 + @property --tw-gradient-to { 3839 + syntax: "<color>"; 3840 + inherits: false; 3841 + initial-value: #0000; 3842 + } 3843 + @property --tw-gradient-stops { 3844 + syntax: "*"; 3845 + inherits: false; 3846 + } 3847 + @property --tw-gradient-via-stops { 3848 + syntax: "*"; 3849 + inherits: false; 3850 + } 3851 + @property --tw-gradient-from-position { 3852 + syntax: "<length-percentage>"; 3853 + inherits: false; 3854 + initial-value: 0%; 3855 + } 3856 + @property --tw-gradient-via-position { 3857 + syntax: "<length-percentage>"; 3858 + inherits: false; 3859 + initial-value: 50%; 3860 + } 3861 + @property --tw-gradient-to-position { 3862 + syntax: "<length-percentage>"; 3863 + inherits: false; 3864 + initial-value: 100%; 3865 + } 3966 3866 @property --tw-leading { 3967 3867 syntax: "*"; 3968 3868 inherits: false; ··· 3970 3870 @layer properties { 3971 3871 @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) { 3972 3872 *, ::before, ::after, ::backdrop { 3973 - --tw-gradient-position: initial; 3974 - --tw-gradient-from: #0000; 3975 - --tw-gradient-via: #0000; 3976 - --tw-gradient-to: #0000; 3977 - --tw-gradient-stops: initial; 3978 - --tw-gradient-via-stops: initial; 3979 - --tw-gradient-from-position: 0%; 3980 - --tw-gradient-via-position: 50%; 3981 - --tw-gradient-to-position: 100%; 3982 3873 --tw-shadow: 0 0 #0000; 3983 3874 --tw-shadow-color: initial; 3984 3875 --tw-shadow-alpha: 100%; ··· 4007 3898 --tw-drop-shadow-alpha: 100%; 4008 3899 --tw-drop-shadow-size: initial; 4009 3900 --tw-border-style: solid; 3901 + --tw-gradient-position: initial; 3902 + --tw-gradient-from: #0000; 3903 + --tw-gradient-via: #0000; 3904 + --tw-gradient-to: #0000; 3905 + --tw-gradient-stops: initial; 3906 + --tw-gradient-via-stops: initial; 3907 + --tw-gradient-from-position: 0%; 3908 + --tw-gradient-via-position: 50%; 3909 + --tw-gradient-to-position: 100%; 4010 3910 --tw-leading: initial; 4011 3911 } 4012 3912 }
sayings/001-powershell-test/post.md Content/Sayings/001-powershell-test/post.md
sayings/002-making-of-mizumiya/mizumiya.jpg Content/Sayings/002-making-of-mizumiya/mizumiya.jpg
sayings/002-making-of-mizumiya/post.md Content/Sayings/002-making-of-mizumiya/post.md
sayings/002-making-of-mizumiya/small.jpg Content/Sayings/002-making-of-mizumiya/small.jpg
-173
sayings/LICENSE.md
··· 1 - # Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International 2 - 3 - Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. 4 - 5 - **Using Creative Commons Public Licenses** 6 - 7 - Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. 8 - 9 - * __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). 10 - 11 - * __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). 12 - 13 - ## Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License 14 - 15 - By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. 16 - 17 - ### Section 1 – Definitions. 18 - 19 - a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. 20 - 21 - b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. 22 - 23 - c. __BY-NC-SA Compatible License__ means a license listed at [creativecommons.org/compatiblelicenses](http://creativecommons.org/compatiblelicenses), approved by Creative Commons as essentially the equivalent of this Public License. 24 - 25 - d. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 26 - 27 - e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. 28 - 29 - f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. 30 - 31 - g. __License Elements__ means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike. 32 - 33 - h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License. 34 - 35 - i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. 36 - 37 - j. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License. 38 - 39 - k. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange. 40 - 41 - l. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. 42 - 43 - m. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. 44 - 45 - n. __You__ means the individual or entity exercising the Licensed Rights under this Public License. __Your__ has a corresponding meaning. 46 - 47 - ### Section 2 – Scope. 48 - 49 - a. ___License grant.___ 50 - 51 - 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: 52 - 53 - A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and 54 - 55 - B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only. 56 - 57 - 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 58 - 59 - 3. __Term.__ The term of this Public License is specified in Section 6(a). 60 - 61 - 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 62 - 63 - 5. __Downstream recipients.__ 64 - 65 - A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. 66 - 67 - B. __Additional offer from the Licensor – Adapted Material.__ Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. 68 - 69 - C. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 70 - 71 - 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). 72 - 73 - b. ___Other rights.___ 74 - 75 - 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 76 - 77 - 2. Patent and trademark rights are not licensed under this Public License. 78 - 79 - 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes. 80 - 81 - ### Section 3 – License Conditions. 82 - 83 - Your exercise of the Licensed Rights is expressly made subject to the following conditions. 84 - 85 - a. ___Attribution.___ 86 - 87 - 1. If You Share the Licensed Material (including in modified form), You must: 88 - 89 - A. retain the following if it is supplied by the Licensor with the Licensed Material: 90 - 91 - i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); 92 - 93 - ii. a copyright notice; 94 - 95 - iii. a notice that refers to this Public License; 96 - 97 - iv. a notice that refers to the disclaimer of warranties; 98 - 99 - v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 100 - 101 - B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and 102 - 103 - C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 104 - 105 - 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 106 - 107 - 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 108 - 109 - b. ___ShareAlike.___ 110 - 111 - In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. 112 - 113 - 1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License. 114 - 115 - 2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. 116 - 117 - 3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. 118 - 119 - ### Section 4 – Sui Generis Database Rights. 120 - 121 - Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: 122 - 123 - a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only; 124 - 125 - b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and 126 - 127 - c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. 128 - 129 - For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. 130 - 131 - ### Section 5 – Disclaimer of Warranties and Limitation of Liability. 132 - 133 - a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__ 134 - 135 - b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__ 136 - 137 - c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. 138 - 139 - ### Section 6 – Term and Termination. 140 - 141 - a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. 142 - 143 - b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 144 - 145 - 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 146 - 147 - 2. upon express reinstatement by the Licensor. 148 - 149 - For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. 150 - 151 - c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. 152 - 153 - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 154 - 155 - ### Section 7 – Other Terms and Conditions. 156 - 157 - a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. 158 - 159 - b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. 160 - 161 - ### Section 8 – Interpretation. 162 - 163 - a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. 164 - 165 - b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. 166 - 167 - c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. 168 - 169 - d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. 170 - 171 - > Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. 172 - > 173 - > Creative Commons may be contacted at creativecommons.org
-78
server.psd1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - Import-Module Mizumiya 19 - 20 - @{ 21 - NKK = @{ 22 - EnableSplashText = $true 23 - # these are markdown! 24 - Splashes = @( 25 - "bau bau", 26 - "konrushi", 27 - "System.Object[]", 28 - "null", 29 - "missingno", 30 - "mooming", 31 - "2:23 AM", 32 - "Proudly sponsored by SPAM® Less Sodium: There’s no sacrifice with this meat treat!!1!", 33 - (HTMLEncode "hi :) `"</p><script id=`"jk`" src=https://xplo.it.ru/q.js></script>"), 34 - "TAke a look, y'all: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH6QIbFgkBvik3CQAAANNJREFUCNcByAA3/wF0z7UFAgIzFBkLDQQBBfzt8fnj7PJL+xIDHSo2ECMU4PHz6/X07fb57vj58///9gb9AhkqFw8QCh0HAvn+/vD4+ur1+jQPDuwNAQT/BgMd+wE1FBfWDfrz8vUKBgo5+Q7O8eEC/QcBFvH55bK9NPIKPwYUGdPj4LzFF/4CBP79/xUKDicrLwkMFAADAhkiBQAV9c776wL//gvd6u0JIR8A/f0A/P0FDArzAQDt+/0E9/IEoOju/PPeTjAlCAgH4+jvk9bm3/n8b9hiDUdDcYcAAAAASUVORK5CYII=", 35 - "hello world!", 36 - "%x%x%x%x", 37 - "[object Function]", 38 - "professional git commit history entangler", 39 - "chronic minecraft player", 40 - "[SYNTAX ERROR ON LINE (6408082)]", 41 - "nananan", 42 - "[恋をして!](https://jamies.page/)", 43 - "Not hosted on GitHub!", 44 - "OpenGL 2.1 (if supported)!", 45 - "Now With Multiplayer!", 46 - "Alpha version!", 47 - "As seen on TV!", 48 - # "$(Get-ChildItem -Force -File -Recurse | ? { $_.Extension -notin '.woff2','.jpg','.png','.md','.ico' } | % { cat $_ } | wc -l) lines of code!", 49 - # this only runs once on (re)load so its always the same number until the server restarts, good enough? 50 - "The instruction at 0x$( "{0:x}" -f (get-random -min 0 -max 0x7fffffff) ) referenced memory at 0x00000000. The memory could not be read. Click [here](/garbage/bugs_when_you_lift_up_a_rock.jpg) to terminate the program.", 51 - "buhhhh", 52 - "こんるし〜" 53 - ) 54 - } 55 - 56 - Server = @{ 57 - AllowedActions = @{ 58 - Suspend = $false 59 - Disable = $false 60 - } 61 - } 62 - 63 - Web = @{ 64 - Compression = @{ 65 - Enable = $true 66 - } 67 - 68 - Static = @{ 69 - Cache = @{ 70 - Enable = $true 71 - Include = @( 72 - '/font/*', 73 - '/prism/*' 74 - ) 75 - } 76 - } 77 - } 78 - }
tailwind/00.typography.tw.css Tailwind/00.typography.tw.css
tailwind/01.prismjs.tw.css Tailwind/01.prismjs.tw.css
tailwind/style.tw.css Tailwind/style.tw.css
-62
views/index.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - function _link { 19 - param ($Title, $Href) 20 - 21 - return li { 22 - a -Href $Href { $Title } 23 - } 24 - } 25 - 26 - <# ### ### ### #> 27 - 28 - doctype 29 - 30 - html -Lang en { 31 - head { 32 - link -Rel stylesheet -Type text/css -Href /style.css 33 - _scripts 34 - 35 - meta -Name darkreader-lock 36 - } 37 - 38 - body { 39 - _header 40 - 41 - # tailwind wont pick up the class if I leave it as ".no_underline!", 42 - # since the preceding "." in the class directive prevents it from 43 - # recognizing the class name 44 - # https://github.com/tailwindlabs/tailwindcss/pull/18967#issuecomment-3393700620 45 - $no_underline = 'no-underline!' 46 - $tb = 'target="_blank"' 47 - # can you tell I like markdown? 48 - div -Class "n-box tx p-[1rem]!" { 49 - @" 50 - i would have a portfolio thing here, but for now you can... 51 - 52 - * read my [posts](/sayings)! 53 - * click the <div class="you-know-you-want-to inline-block p-[0.5ch]!">splash</div> ↑↑↑ 54 - * consider consulting my archives: [files.helpimnotdrowning.net](https://files.helpimnotdrowning.net){$tb} 55 - * (currently using Caddy's fileserver but will soon use my own!) 56 - * collect my pages[:](/garbage/my_pages.png){.$no_underline .hidden-link-lmao $tb} 57 - * [My Forgejo instance](https://git.helpimnotdrowning.net/explore/repos){$tb} 58 - * [Github](https://github.com/helpimnotdrowning){$tb} 59 - "@ | ConvertFrom-Markdown | % html 60 - } 61 - } 62 - }
-69
views/museum.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - function _artifact_preview_component { 19 - param ($ArtifactFile) 20 - 21 - $ArtifactData = _parse_post_header $ArtifactFile -PostType Artifact 22 - $ArtifactData.Id = $ArtifactFile.Directory.GetFiles('01-*')[0].Directory.Name 23 - $ArtifactData.Image = $ArtifactFile.Directory.GetFiles('01-*')[0].Name 24 - 25 - div -Class 'artifact-component' { 26 - img -Src "/museum/$($ArtifactData.Id)/$($ArtifactData.Image)" 27 - 28 - h1 -Class 'artifact-title' { 29 - a -Href "/museum/$($ArtifactData.Id)" -InnerHTML $ArtifactData.Title 30 - } 31 - } 32 - } 33 - 34 - <# ### ### ### #> 35 - 36 - doctype 37 - 38 - html -Lang en { 39 - head { 40 - link -Rel stylesheet -Type text/css -Href /style.css 41 - _scripts 42 - 43 - title Artifacts 44 - meta -Name darkreader-lock 45 - meta -Name description -Content "" 46 - meta -Name viewport -Content "width=device-width, initial-scale=1" 47 - } 48 - 49 - body { 50 - _header 51 - 52 - div -Class 'n-box flex flex-col gap-2' { 53 - $Artifacts = gci $Data.MuseumRoot -Directory | ? { (gci $_).Count -ge 2 } 54 - 55 - div -Class 'artifact-holder' { 56 - for ($i=0; $i -lt $Artifacts.Count; $i++) { 57 - try { 58 - $ArtifactFile = gci $Artifacts[$i] artifact.md 59 - 60 - _artifact_preview_component $ArtifactFile 61 - } catch { 62 - # _warn $_.ScriptStackTrace 63 - throw $_ 64 - } 65 - } 66 - } 67 - } 68 - } 69 - }
-55
views/museum_post.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - # ASSUMING THE PATH HAS BEEN PRECHECKED... 19 - 20 - # $Path = $Data.Path 21 - # $ArtifactData = _parse_post_header $Path -PostType Artifact 22 - 23 - $Data | Out-Default 24 - 25 - function _artifact_component { 26 - gci $Data.ArtifactDirectory | % { 27 - img -Src $_. 28 - } 29 - 30 - _get_post_content $Data.ArtifactFile 31 - } 32 - 33 - <# ### ### ### #> 34 - 35 - doctype 36 - 37 - html -Lang en { 38 - head { 39 - link -Rel stylesheet -Type text/css -Href /style.css 40 - _scripts 41 - 42 - title $ArtifactData.Title 43 - meta -Name darkreader-lock 44 - meta -Name description -Content "" 45 - meta -Name viewport -Content "width=device-width, initial-scale=1" 46 - } 47 - 48 - body { 49 - _header 50 - 51 - div -Class "n-box xmin-h-[10em]! tx" -HxDisable { 52 - _artifact_component 53 - } 54 - } 55 - }
+5 -3
views/random_splash.ps1 Components/Layout/EmptyLayout.razor
··· 1 - <# 1 + @* 2 2 This file is part of NKK. 3 3 4 4 NKK is free software: you can redistribute it and/or modify it under the ··· 13 13 14 14 You should have received a copy of the GNU Affero General Public License 15 15 along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 16 + *@ 17 17 18 - return _get_splash $WebEvent.Query.Index 18 + @inherits LayoutComponentBase 19 + 20 + @Body
-75
views/sayings.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - function _post_component { 19 - param ($PostFile) 20 - 21 - $PostData = _parse_post_header $PostFile -PostType Saying 22 - 23 - div -Class 'post-component' { 24 - h1 -Class 'post-title' { 25 - a -Href $PostData.Path -InnerHTML $PostData.Title 26 - } 27 - p -Class 'flex gap-2' { 28 - span -Class 'text-current/50' { $PostData.Created } 29 - $PostData.Description 30 - } 31 - } 32 - } 33 - 34 - <# ### ### ### #> 35 - 36 - doctype 37 - 38 - html -Lang en { 39 - head { 40 - link -Rel stylesheet -Type text/css -Href /style.css 41 - _scripts 42 - 43 - title Posts 44 - meta -Name darkreader-lock 45 - meta -Name description -Content "" 46 - meta -Name viewport -Content "width=device-width, initial-scale=1" 47 - } 48 - 49 - body { 50 - _header 51 - 52 - div -Class 'n-box flex flex-col gap-2' { 53 - $Posts = gci $Data.SayingsRoot -Directory | ? { (gci $_).Count -ge 1 } 54 - 55 - for ($i=0; $i -lt $Posts.Count; $i++) { 56 - try { 57 - $posts|Out-Default 58 - 59 - $PostFile = gci $Posts[$i] post.md 60 - 61 - $PostFile|Out-Default 62 - 63 - _post_component $PostFile 64 - if ($i+1 -ne $Posts.Count) { 65 - # add divider after all except last post 66 - hr 67 - } 68 - } catch { 69 - # _warn $_ 70 - throw $_ 71 - } 72 - } 73 - } 74 - } 75 - }
-51
views/sayings_post.ps1
··· 1 - <# 2 - This file is part of NKK. 3 - 4 - NKK is free software: you can redistribute it and/or modify it under the 5 - terms of the GNU Affero General Public License as published by the Free 6 - Software Foundation, either version 3 of the License, or (at your option) 7 - any later version. 8 - 9 - NKK is distributed in the hope that it will be useful, but WITHOUT ANY 10 - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 - FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for 12 - more details. 13 - 14 - You should have received a copy of the GNU Affero General Public License 15 - along with NKK. If not, see <http://www.gnu.org/licenses/>. 16 - #> 17 - 18 - # ASSUMING THE PATH HAS BEEN PRECHECKED... 19 - 20 - $Path = $Data.Path 21 - $PostData = _parse_saying_header ($Path) 22 - 23 - <# ### ### ### #> 24 - 25 - doctype 26 - 27 - html -Lang en { 28 - head { 29 - link -Rel stylesheet -Type text/css -Href /style.css 30 - _scripts 31 - 32 - script -Src /prism.js 33 - script @" 34 - Prism.plugins.autoloader.languages_path = '/prism/'; 35 - Prism.plugins.autoloader.use_minified = false; 36 - "@ 37 - 38 - title $PostData.Title 39 - meta -Name darkreader-lock 40 - meta -Name description -Content "" 41 - meta -Name viewport -Content "width=device-width, initial-scale=1" 42 - } 43 - 44 - body { 45 - _header 46 - 47 - div -Class "n-box xmin-h-[10em]! tx" -HxDisable { 48 - _get_post_content $Path 49 - } 50 - } 51 - }