refactor: rename project to OliverBooth

This commit is contained in:
Oliver Booth 2023-08-05 23:27:50 +01:00
parent a495973c44
commit 6205648e53
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
33 changed files with 124 additions and 94 deletions

View File

@ -6,7 +6,7 @@ const ts = require('gulp-typescript');
const terser = require('gulp-terser');
const srcDir = 'src';
const destDir = 'oliverbooth.dev/wwwroot';
const destDir = 'OliverBooth/wwwroot';
function compileSCSS() {
return gulp.src(`${srcDir}/scss/**/*.scss`)

View File

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "oliverbooth.dev", "oliverbooth.dev\oliverbooth.dev.csproj", "{A58A6FA3-480C-400B-822A-3786741BF39C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OliverBooth", "OliverBooth\OliverBooth.csproj", "{A58A6FA3-480C-400B-822A-3786741BF39C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{06B0C27F-3432-41D7-B103-47B8D0EE28CC}"
ProjectSection(SolutionItems) = preProject

View File

@ -5,7 +5,6 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<RootNamespace>OliverBooth</RootNamespace>
<TargetCulture>en</TargetCulture>
<UICulture>en</UICulture>
</PropertyGroup>

View File

@ -35,5 +35,5 @@
<textarea class="form-control" id="message" name="message" rows="5" required placeholder="What's on your mind?"></textarea>
</div>
<button asp-action="Submit" class="btn btn-primary" style="margin-top: 10px;">Submit</button>
</form>
<button class="btn btn-primary" style="margin-top: 10px;">Submit</button>
</form>

View File

@ -1,10 +1,10 @@
@page "/{culture=en}/error/{code:int?}"
@page "/{culture=en}/error/{code:int?}"
@model OliverBooth.Pages.ErrorModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h1 class="text-danger">Error @(Model.StatusCode != 200 ? Model.StatusCode.ToString() : "")</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)

View File

@ -8,10 +8,6 @@ namespace OliverBooth.Pages;
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
@ -19,8 +15,21 @@ public class ErrorModel : PageModel
_logger = logger;
}
public void OnGet()
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
public int StatusCode { get; private set; }
public void OnGet(int? code = null)
{
StatusCode = code ?? HttpContext.Response.StatusCode;
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
var originalPath = "unknown";
if (HttpContext.Items.TryGetValue("originalPath", out object? value))
{
originalPath = value as string;
}
}
}

View File

@ -5,12 +5,7 @@
<h1 class="display-4">@Localizer["HomeTitle"]</h1>
<p class="lead">@Localizer["HomeSubtitle"]</p>
<p>
My primary focus is C#, though I have dabbled in several other languages such as Java, Kotlin, VB, C/C++,
Python, and others. Over the years I've built up a collection of projects. Some of which I'm extremely proud of,
and others I've quietly abandoned and buried. I'm currently working on a few projects that I hope to release in
the near future, but in the meantime, feel free to check out some of my <a asp-page="/Projects/Index">previous work.</a>
</p>
<p>@Localizer.GetHtml("Intro1")</p>
<p>
I've also written a few <a asp-page="/tutorials/index">tutorials</a> on various topics, usually involving

View File

@ -0,0 +1,75 @@
@using System.Globalization
@using Microsoft.AspNetCore.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@inject IViewLocalizer Localizer
@{
CultureInfo? requestCulture = Context.Features.Get<IRequestCultureFeature>()?.RequestCulture.Culture;
string culture = (requestCulture ?? CultureInfo.CurrentCulture).TwoLetterISOLanguageName;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Oliver Booth</title>
<link rel="shortcut icon" href="~/img/favicon.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/css/bootstrap.min.css" integrity="sha512-Z/def5z5u2aR89OuzYcxmDJ0Bnd5V1cKqBEbvLOiUNWdg9PQeXVvXLI90SE4QOHGlfLqUnDNVAYyZi8UwUTmWQ==" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/vs2015.min.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@100;400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="~/css/app.min.css" asp-append-version="true"/>
<link rel="stylesheet" href="~/oliverbooth.dev.styles.css" asp-append-version="true"/>
</head>
<body>
<header class="container" style="margin-top: 20px;">
<div id="site-title" class="text-center">
<h1>
<a href="/"><img src="~/img/ob-256x256.png" alt="Oliver Booth" height="128"> Oliver Booth</a>
</h1>
</div>
</header>
<nav>
<ul class="site-nav">
<li>
<a asp-page="/index" asp-route-culture="@culture">@Localizer["Home"]</a>
</li>
<li>
<a href="https://blog.oliverbooth.dev">Blog</a>
</li>
<li>
<a asp-page="/tutorials/index" asp-route-culture="@culture">@Localizer["Tutorials"]</a>
</li>
<li>
<a asp-page="/projects/index" asp-route-culture="@culture">@Localizer["Projects"]</a>
</li>
<li>
<a asp-page="/contact/index" asp-route-culture="@culture">@Localizer["Contact"]</a>
</li>
<li>
<a asp-page="/donate" asp-route-culture="@culture">@Localizer["Donate"]</a>
</li>
</ul>
</nav>
<hr class="page-separator"/>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="footer text-muted">
<div class="container text-center">
&copy; @DateTime.UtcNow.Year &bullet; <a asp-area="" asp-page="/privacy/index" asp-route-culture="@culture">@Localizer["Privacy"]</a>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/js/bootstrap.bundle.min.js" integrity="sha512-ToL6UYWePxjhDQKNioSi4AyJ5KkRxY+F1+Fi7Jgh0Hp5Kk2/s8FD7zusJDdonfe5B00Qw+B8taXxF6CFLnqNCw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
<script src="~/js/app.min.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@ -1,7 +1,9 @@
using System.Globalization;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.Localization;
using OliverBooth;
using OliverBooth.Middleware;
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources");
@ -23,6 +25,8 @@ builder.Services.Configure<RequestLocalizationOptions>(options =>
options.SupportedUICultures = supportedCultures;
});
builder.Services.Configure<LocalizationOptions>(options => options.ResourcesPath = "Resources");
WebApplication app = builder.Build();
if (!app.Environment.IsDevelopment())

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="HomeTitle" xml:space="preserve">
<value>Hi, I'm Oliver.</value>
</data>
<data name="HomeSubtitle" xml:space="preserve">
<value>I'm a tech enthusiast, coffee drinker, and software developer.</value>
</data>
<data name="Intro1" xml:space="preserve">
<value>My primary focus is C#, though I have dabbled in several other languages such as Java, Kotlin, VB, C/C++, Python, and others. Over the years I've built up a collection of projects. Some of which I'm extremely proud of, and others I've quietly abandoned and buried. I'm currently working on a few projects that I hope to release in the near future, but in the meantime, feel free to check out some of my &lt;a asp-page="/Projects/Index"&gt;previous work.&lt;/a&gt;</value>
</data>
</root>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="HomeTitle" xml:space="preserve">
<value>Salut, je suis Oliver.</value>
</data>
<data name="HomeSubtitle" xml:space="preserve">
<value>Je suis un passionné de technologie, un buveur de café, et un developpeur de logiciels.</value>
</data>
<data name="Intro1" xml:space="preserve">
<value>Je me concentre principalement sur C#, bien que j'ai également expérimenté plusieurs autres langues telles que Java, Kotlin, VB, C / C++, Python et d'autres. Au fil des ans, j'ai constitué une collection de projets. Certains dont je suis extrêmement fier, et d'autres que j'ai tranquillement abandonnés et enterrés. Je travaille actuellement sur quelques projets que j'espère publier dans un proche avenir, mais en attendant, n'hésitez pas à consulter certains de mes &lt;a asp-page="/Projects/Index"&gt;travaux précédents.&lt;/a&gt;</value>
</data>
</root>

View File

@ -1,58 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Oliver Booth</title>
<link rel="shortcut icon" href="~/img/favicon.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css" integrity="sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/vs2015.min.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@100;400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="~/css/app.min.css" asp-append-version="true"/>
<link rel="stylesheet" href="~/oliverbooth.dev.styles.css" asp-append-version="true"/>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/Index">oliverbooth.dev</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2023 - oliverbooth.dev - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.bundle.min.js" integrity="sha512-i9cEfJwUwViEPFKdC1enz4ZRGBj8YQo6QByFTF92YXHi7waCqyexvRD75S5NVTsSiTv7rKWqG9Y5eFxmRsOn0A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
<script src="~/js/app.min.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="HomeTitle" xml:space="preserve">
<value>Hi, I'm Oliver.</value>
</data>
<data name="HomeSubtitle" xml:space="preserve">
<value>I'm a tech enthusiast, coffee drinker, and software developer.</value>
</data>
</root>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="HomeTitle" xml:space="preserve">
<value>Salut, je suis Oliver.</value>
</data>
<data name="HomeSubtitle" xml:space="preserve">
<value>Je suis un passionné de technologie, un buveur de café, et un developpeur de logiciels.</value>
</data>
</root>