Skip to content

Commit 90e8b55

Browse files
author
Mark
committedOct 31, 2023
basic seo
#17
1 parent 229c682 commit 90e8b55

20 files changed

+209
-29
lines changed
 

‎MyDevTools/Components/Layout/NavMenu.razor

+15-15
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,74 @@
88
</div>
99

1010
<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
11-
<nav class="flex-column">
11+
<nav class="flex-column" aria-label="Main navigation">
1212
<div class="nav-item px-3">
13-
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
13+
<NavLink class="nav-link" href="" Match="NavLinkMatch.All" aria-label="Navigate to Home">
1414
<span class="bi bi-house-door-fill" aria-hidden="true"></span> Home
1515
</NavLink>
1616
</div>
1717
<div class="nav-item px-3">
18-
<NavLink class="nav-link" href="JsonFormatter">
18+
<NavLink class="nav-link" href="JsonFormatter" aria-label="Navigate to JSON Formatter">
1919
<span class="bi bi-code-square" aria-hidden="true"></span> Json Formatter
2020
</NavLink>
2121
</div>
2222
<div class="nav-item px-3">
23-
<NavLink class="nav-link" href="DiffChecker">
23+
<NavLink class="nav-link" href="DiffChecker" aria-label="Navigate to Diff Checker">
2424
<span class="bi bi-file-diff" aria-hidden="true"></span> Diff Checker
2525
</NavLink>
2626
</div>
2727
<div class="nav-item px-3">
28-
<NavLink class="nav-link" href="SqlFormatter">
28+
<NavLink class="nav-link" href="SqlFormatter" aria-label="Navigate to SQL Formatter">
2929
<span class="bi bi-table" aria-hidden="true"></span> SQL Formatter
3030
</NavLink>
3131
</div>
3232
<div class="nav-item px-3">
33-
<NavLink class="nav-link" href="GuidGenerator">
33+
<NavLink class="nav-link" href="GuidGenerator" aria-label="Navigate to GUID Generator">
3434
<span class="bi bi-key-fill" aria-hidden="true"></span> GUID Gen
3535
</NavLink>
3636
</div>
3737
<div class="nav-item px-3">
38-
<NavLink class="nav-link" href="randomNumberGenerator">
38+
<NavLink class="nav-link" href="randomNumberGenerator" aria-label="Navigate to Random Number Generator">
3939
<span class="bi bi-dice-3" aria-hidden="true"></span> Random Numbers
4040
</NavLink>
4141
</div>
4242
<div class="nav-item px-3">
43-
<NavLink class="nav-link" href="ColorPickerConverter">
43+
<NavLink class="nav-link" href="ColorPickerConverter" aria-label="Navigate to Colour Converter">
4444
<span class="bi bi-palette" aria-hidden="true"></span> Colour Converter
4545
</NavLink>
4646
</div>
4747
<div class="nav-item px-3">
48-
<NavLink class="nav-link" href="hashGenerator">
48+
<NavLink class="nav-link" href="hashGenerator" aria-label="Navigate to Hash Generator">
4949
<span class="bi bi-lock-fill" aria-hidden="true"></span> Hash Gen
5050
</NavLink>
5151
</div>
5252
<div class="nav-item px-3">
53-
<NavLink class="nav-link" href="UrlEncoderDecoder">
53+
<NavLink class="nav-link" href="UrlEncoderDecoder" aria-label="Navigate to URL Encoder">
5454
<span class="bi bi-link" aria-hidden="true"></span> Url Encoder
5555
</NavLink>
5656
</div>
5757
<div class="nav-item px-3">
58-
<NavLink class="nav-link" href="QrCodeGen">
58+
<NavLink class="nav-link" href="QrCodeGen" aria-label="Navigate to QR Code Generator">
5959
<span class="bi bi-qr-code" aria-hidden="true"></span> QR Gen
6060
</NavLink>
6161
</div>
6262
<div class="nav-item px-3">
63-
<NavLink class="nav-link" href="BranchNameFormatter">
63+
<NavLink class="nav-link" href="BranchNameFormatter" aria-label="Navigate to Branch Name Formatter">
6464
<span class="bi bi-git" aria-hidden="true"></span> Branch Names
6565
</NavLink>
6666
</div>
6767
<div class="nav-item px-3">
68-
<NavLink class="nav-link" href="CronGenerator">
68+
<NavLink class="nav-link" href="CronGenerator" aria-label="Navigate to Cron Generator">
6969
<span class="bi bi-clock" aria-hidden="true"></span> Cron Gen
7070
</NavLink>
7171
</div>
7272
<div class="nav-item px-3">
73-
<NavLink class="nav-link" href="JwtDecoder">
73+
<NavLink class="nav-link" href="JwtDecoder" aria-label="Navigate to JWT Decoder">
7474
<span class="bi bi-shield-lock" aria-hidden="true"></span> JWT Decoder
7575
</NavLink>
7676
</div>
7777
<div class="nav-item px-3">
78-
<NavLink class="nav-link" href="containerIds">
78+
<NavLink class="nav-link" href="containerIds" aria-label="Navigate to Container IDs">
7979
<span class="bi bi-box" aria-hidden="true"></span> Container Ids
8080
</NavLink>
8181
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@inherits ComponentBase
2+
@inject IJSRuntime JSRuntime
3+
4+
@code {
5+
6+
protected async Task UpdateMetaTagsAsync(string description, string keywords)
7+
{
8+
await JSRuntime.InvokeVoidAsync("updateMetaTags", description, keywords);
9+
}
10+
}

‎MyDevTools/Components/Pages/BranchNameFormatter.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/BranchNameFormatter"
2+
@inherits Base.BasePage
23
@inject Services.IClipboardService ClipboardService
34

45
<h3 class="text-center">Git Branch Name Formatter</h3>
@@ -35,8 +36,10 @@
3536
private string formattedString = "";
3637
private string copyConfirmationMessage = "";
3738

38-
protected override void OnInitialized()
39+
protected override async void OnInitialized()
3940
{
41+
await UpdateMetaTagsAsync("Format a string to be used as a Git branch name.", "Git Branch Name Formatter, Dev Tools, Git Tools");
42+
4043
FormatGitBranchName();
4144
}
4245

‎MyDevTools/Components/Pages/ColorPickerConverter.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/ColorPickerConverter"
2+
@inherits Base.BasePage
23

34
<h3 class="text-center">Color Picker/Converter</h3>
45

@@ -41,8 +42,10 @@
4142
private string selectedColor = "#FFFFFF"; // Default to white
4243
private string convertedColor = "RGB(255, 255, 255)"; // Default to white
4344
44-
protected override void OnInitialized()
45+
protected override async void OnInitialized()
4546
{
47+
await UpdateMetaTagsAsync("Convert and choose colours for your projects.", "Colour Converter, Dev Tools, Design");
48+
4649
// Initialize the timer to call ConvertColors every 0.25 seconds
4750
timer = new Timer(_ => ConvertColors(), null, 0, 250);
4851
ConvertColors();

‎MyDevTools/Components/Pages/ContainerIds.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/containerIds"
2+
@inherits Base.BasePage
23
@inject Services.IClipboardService ClipboardService
34
@using System.Text
45

@@ -49,8 +50,10 @@
4950
"AZLU", "EISU", "BSIU", "NYKU", "YMLU"};
5051

5152

52-
protected override void OnInitialized()
53+
protected override async void OnInitialized()
5354
{
55+
await UpdateMetaTagsAsync("Generate container IDs.", "Container IDs, Dev Tools, Identifier");
56+
5457
GenerateCodes();
5558
}
5659

‎MyDevTools/Components/Pages/CronGenerator.razor

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@page "/CronGenerator"
22
@inject Services.IClipboardService ClipboardService
3+
@inherits Base.BasePage
34

45
<h3 class="text-center">Cron Expression Generator</h3>
56

@@ -85,6 +86,13 @@
8586
private string cronExpression = "";
8687
private string copyConfirmationMessage = "";
8788

89+
protected override async void OnInitialized()
90+
{
91+
await UpdateMetaTagsAsync("Generate cron expressions with ease.", "Cron Expression Generator, Dev Tools, Web Tools");
92+
93+
base.OnInitialized();
94+
}
95+
8896
private void GenerateCronExpression()
8997
{
9098
try

‎MyDevTools/Components/Pages/DiffChecker.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/DiffChecker"
2+
@inherits Base.BasePage
23
@using DiffPlex.DiffBuilder
34
@using DiffPlex.DiffBuilder.Model
45
@using MyDevTools.Components.Pages.Components
@@ -39,8 +40,10 @@
3940
private string text2 = "";
4041
private SideBySideDiffModel diffModel;
4142

42-
protected override void OnInitialized()
43+
protected override async void OnInitialized()
4344
{
45+
await UpdateMetaTagsAsync("Compare code and text to find differences.", "Diff Checker, Dev Tools, Code Comparison");
46+
4447
text1 = $"Example unchanged.{Environment.NewLine}Example changed.{Environment.NewLine}Example gone.{Environment.NewLine}";
4548
text2 = $"Example unchanged.{Environment.NewLine}Example CHANGED.{Environment.NewLine}{Environment.NewLine}Example new.";
4649
CompareTexts();

‎MyDevTools/Components/Pages/GuidGenerator.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/GuidGenerator"
2+
@inherits Base.BasePage
23
@inject Services.IClipboardService ClipboardService
34

45
<h3 class="text-center">GUID Generator</h3>
@@ -50,8 +51,10 @@
5051
private int quantity = 1;
5152
private List<string> guidResults = new();
5253

53-
protected override void OnInitialized()
54+
protected override async void OnInitialized()
5455
{
56+
await UpdateMetaTagsAsync("Generate GUIDs with ease.", "GUID Generator, Dev Tools, Identifier");
57+
5558
GenerateGUID();
5659
}
5760

‎MyDevTools/Components/Pages/HashGenerator.razor

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
@using System.Security.Cryptography
1+
@page "/hashgenerator"
2+
@inherits Base.BasePage
3+
@using System.Security.Cryptography
24

3-
@page "/hashgenerator"
45

56
<h3 class="text-center">Hash Generator</h3>
67

@@ -52,8 +53,10 @@
5253
private HashAlgorithms selectedAlgorithm = HashAlgorithms.SHA256;
5354
private string hashResult = "";
5455

55-
protected override void OnInitialized()
56+
protected override async void OnInitialized()
5657
{
58+
await UpdateMetaTagsAsync("Generate various types of hashes.", "Hash Generator, Dev Tools, Security");
59+
5760
GenerateHash();
5861
}
5962

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
@page "/jsonformatter"
2+
@inherits Base.BasePage
3+
@inject IJSRuntime JSRuntime
4+
25

36
<label for="inputQuery">Input JSON (rest assured, your data stays on your device):</label>
4-
<iframe id="myiframe" src="iframepages/jsonformatter.html" height="650px" width="1050px" scrolling="no" />
7+
<iframe id="myiframe" src="iframepages/jsonformatter.html" height="650px" width="1050px" scrolling="no" />
8+
9+
10+
@code {
11+
protected override async Task OnInitializedAsync()
12+
{
13+
await UpdateMetaTagsAsync("Easily format and validate your JSON code.", "JSON Formatter, Dev Tools, Code Formatter");
14+
}
15+
16+
}

‎MyDevTools/Components/Pages/JwtDecoder.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@using System.IdentityModel.Tokens.Jwt
33
@using Microsoft.IdentityModel.Tokens
44
@inject Services.IClipboardService ClipboardService
5+
@inherits Base.BasePage
56

67
<h3 class="text-center">JWT Decoder</h3>
78

@@ -35,8 +36,10 @@
3536
private string inputToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.S5CmpIhks5H_I8HWiRgEzhuHRCXLzguG6zGZtRjG5oA";
3637
private string decodedJson = "";
3738

38-
protected override void OnInitialized()
39+
protected override async void OnInitialized()
3940
{
41+
await UpdateMetaTagsAsync("Decode JWTs.", "JWT Decoder, Dev Tools, Web Tools");
42+
4043
DecodeJwt();
4144
}
4245

‎MyDevTools/Components/Pages/QrCodeGen.razor

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/QrCodeGen"
2+
@inherits Base.BasePage
23
@using Net.Codecrete.QrCodeGenerator
34
@using System.Security.Cryptography
45

@@ -32,6 +33,13 @@
3233
public string QRCodeText { get; set; }
3334
public string QRCodeSvg { get; set; }
3435

36+
protected override void OnInitialized()
37+
{
38+
UpdateMetaTagsAsync("Generate QR codes with ease.", "QR Code Generator, Dev Tools, Web Tools");
39+
40+
base.OnInitialized();
41+
}
42+
3543
public void GenerateQRCode()
3644
{
3745
if (!string.IsNullOrEmpty(QRCodeText))

‎MyDevTools/Components/Pages/RandomNumberGenerator.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/randomnumbergenerator"
2+
@inherits Base.BasePage
23
@inject Services.IClipboardService ClipboardService
34

45
<h3 class="text-center">Random Numbers</h3>
@@ -42,8 +43,10 @@
4243
private string generatedNumbersText = "";
4344
private string copyConfirmationMessage = "";
4445

45-
protected override void OnInitialized()
46+
protected override async void OnInitialized()
4647
{
48+
await UpdateMetaTagsAsync("Generate random numbers for various purposes.", "Random Numbers, Dev Tools, Math Tools");
49+
4750
base.OnInitialized();
4851

4952
// Generate random numbers with default values when the page is first visited

‎MyDevTools/Components/Pages/SqlFormatter.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/SqlFormatter"
2+
@inherits Base.BasePage
23
@using System.Text
34
@using BasicSQLFormatter
45
@inject Services.IClipboardService ClipboardService
@@ -37,8 +38,10 @@
3738
private string formattedQuery = "";
3839
private string copyConfirmationMessage = "";
3940

40-
protected override void OnInitialized()
41+
protected override async void OnInitialized()
4142
{
43+
await UpdateMetaTagsAsync("Make your SQL queries more readable.", "SQL Formatter, Dev Tools, Database Tools");
44+
4245
FormatSQLQuery();
4346
}
4447

‎MyDevTools/Components/Pages/UrlEncoderDecoder.razor

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/URLEncoderDecoder"
2+
@inherits Base.BasePage
23
@inject Services.IClipboardService ClipboardService
34

45
<h3 class="text-center">URL Encoder/Decoder</h3>
@@ -36,6 +37,13 @@
3637
private string processedUrl = "";
3738
private string copyConfirmationMessage = "";
3839

40+
protected override void OnInitialized()
41+
{
42+
UpdateMetaTagsAsync("Encode or decode URLs.", "URL Encoder, URL Decoder, Dev Tools, Web Tools");
43+
44+
base.OnInitialized();
45+
}
46+
3947
private void EncodeUrl()
4048
{
4149
try

‎MyDevTools/MyDevTools.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,13 @@
2727
<Folder Include="wwwroot\sample-data\" />
2828
</ItemGroup>
2929

30+
<ItemGroup>
31+
<Content Update="wwwroot\js\JsonEditor.js">
32+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33+
</Content>
34+
<Content Update="wwwroot\js\Seo.js">
35+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
36+
</Content>
37+
</ItemGroup>
38+
3039
</Project>

‎MyDevTools/wwwroot/index.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
<html lang="en">
33

44
<head>
5-
<meta charset="utf-8" />
5+
<title>Dev Tools - all-in-One Dev Toolbox</title>
6+
<meta name="description" content="A suite of Dev Tools for software developers. Offering JSON Formatter, Diff Checker, SQL Formatter, GUID Generator, Random Number Generator, Colour Converter, Hash Generator, URL Encoder, QR Code Generator, Branch Name Formatter, Cron Generator, JWT Decoder etc...">
7+
<meta name="keywords" content="Dev Tools, JSON Formatter, Diff Checker, SQL Formatter, GUID Generator, Random Numbers, Colour Converter, Hash Generator, URL Encoder, QR Code Generator, Branch Name Formatter, Cron Generator, JWT Decoder etc...">
8+
69
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>MyDevTools</title>
810
<base href="/" />
911
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
1012
<link rel="stylesheet" href="css/app.css" />
@@ -28,6 +30,7 @@
2830
<a class="dismiss">🗙</a>
2931
</div>
3032
<script src="_framework/blazor.webassembly.js"></script>
33+
<script src="/js/Seo.js"></script>
3134
</body>
3235

3336
</html>

‎MyDevTools/wwwroot/js/Seo.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function updateMetaTags(description, keywords) {
2+
document.querySelector('meta[name="description"]').setAttribute("content", description);
3+
document.querySelector('meta[name="keywords"]').setAttribute("content", keywords);
4+
}

‎MyDevTools/wwwroot/robots..txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User-agent: *
2+
Disallow: /admin/
3+
Allow: /
4+
Sitemap: https://www.mydevtools.org/sitemap.xml

‎MyDevTools/wwwroot/sitemap..xml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>https://www.mydevtools.org/</loc>
5+
<lastmod>2023-10-31</lastmod>
6+
<changefreq>daily</changefreq>
7+
<priority>1.0</priority>
8+
</url>
9+
<url>
10+
<loc>https://www.mydevtools.org/JsonFormatter</loc>
11+
<lastmod>2023-10-31</lastmod>
12+
<changefreq>weekly</changefreq>
13+
<priority>0.8</priority>
14+
</url>
15+
<url>
16+
<loc>https://www.mydevtools.org/DiffChecker</loc>
17+
<lastmod>2023-10-31</lastmod>
18+
<changefreq>weekly</changefreq>
19+
<priority>0.8</priority>
20+
</url>
21+
<url>
22+
<loc>https://www.mydevtools.org/SqlFormatter</loc>
23+
<lastmod>2023-10-31</lastmod>
24+
<changefreq>weekly</changefreq>
25+
<priority>0.8</priority>
26+
</url>
27+
<url>
28+
<loc>https://www.mydevtools.org/GuidGenerator</loc>
29+
<lastmod>2023-10-31</lastmod>
30+
<changefreq>weekly</changefreq>
31+
<priority>0.8</priority>
32+
</url>
33+
<url>
34+
<loc>https://www.mydevtools.org/randomNumberGenerator</loc>
35+
<lastmod>2023-10-31</lastmod>
36+
<changefreq>weekly</changefreq>
37+
<priority>0.8</priority>
38+
</url>
39+
<url>
40+
<loc>https://www.mydevtools.org/ColorPickerConverter</loc>
41+
<lastmod>2023-10-31</lastmod>
42+
<changefreq>weekly</changefreq>
43+
<priority>0.8</priority>
44+
</url>
45+
<url>
46+
<loc>https://www.mydevtools.org/hashGenerator</loc>
47+
<lastmod>2023-10-31</lastmod>
48+
<changefreq>weekly</changefreq>
49+
<priority>0.8</priority>
50+
</url>
51+
<url>
52+
<loc>https://www.mydevtools.org/UrlEncoderDecoder</loc>
53+
<lastmod>2023-10-31</lastmod>
54+
<changefreq>weekly</changefreq>
55+
<priority>0.8</priority>
56+
</url>
57+
<url>
58+
<loc>https://www.mydevtools.org/QrCodeGen</loc>
59+
<lastmod>2023-10-31</lastmod>
60+
<changefreq>weekly</changefreq>
61+
<priority>0.8</priority>
62+
</url>
63+
<url>
64+
<loc>https://www.mydevtools.org/BranchNameFormatter</loc>
65+
<lastmod>2023-10-31</lastmod>
66+
<changefreq>weekly</changefreq>
67+
<priority>0.8</priority>
68+
</url>
69+
<url>
70+
<loc>https://www.mydevtools.org/CronGenerator</loc>
71+
<lastmod>2023-10-31</lastmod>
72+
<changefreq>weekly</changefreq>
73+
<priority>0.8</priority>
74+
</url>
75+
<url>
76+
<loc>https://www.mydevtools.org/JwtDecoder</loc>
77+
<lastmod>2023-10-31</lastmod>
78+
<changefreq>weekly</changefreq>
79+
<priority>0.8</priority>
80+
</url>
81+
<url>
82+
<loc>https://www.mydevtools.org/containerIds</loc>
83+
<lastmod>2023-10-31</lastmod>
84+
<changefreq>weekly</changefreq>
85+
<priority>0.8</priority>
86+
</url>
87+
</urlset>

0 commit comments

Comments
 (0)
Please sign in to comment.