Skip to content

Commit

Permalink
update the footer to include the version and a link to the commit in …
Browse files Browse the repository at this point in the history
…github

sadly, a custom tag helper just wasn't working 😞

if sonarcloud complains about this, i'll revert it
  • Loading branch information
ShaylenReddy42 committed Oct 17, 2022
1 parent 5a67f85 commit 1322343
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Frontends/SeelansTyres.Frontends.Mvc/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
@inject IConfiguration Configuration

@{
var assembly = Assembly.GetExecutingAssembly();

var informationalVersion = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion
?? "0.0.0+0-unknown";

var commitUrl =
assembly
.GetCustomAttributes<AssemblyMetadataAttribute>().ToList()
.SingleOrDefault(attribute => attribute.Key.EndsWith("Commit Url"))?.Value
?? "https://github.com/ShaylenReddy42/Seelans-Tyres";
}

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -80,7 +93,8 @@
@RenderBody()

<footer class="border-top w-100 p-5 text-muted text-center">
&copy; 2022 - Seelan's Tyres
Shaylen Reddy: MIT License<br>
<a href="@commitUrl" target="_blank">@($"v{informationalVersion}")</a>
</footer>

<script src="~/lib/jquery/dist/jquery.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
@using SeelansTyres.Frontends.Mvc.Components
@using SeelansTyres.Frontends.Mvc.Services
@using System.Net.Http.Headers
@using System.Reflection
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, SeelansTyres.Frontends.Mvc

0 comments on commit 1322343

Please sign in to comment.