Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve SEO #52

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"imagemin-pngquant": "^10.0.0",
"imagemin-svgo": "^11.0.1",
"imagemin-webp": "^8.0.0",
"loader-utils": "^3.3.1",
"mangle-css-class-webpack-plugin": "^5.1.0",
"mini-css-extract-plugin": "^2.9.2",
"postcss": "^8.4.49",
Expand Down
2 changes: 1 addition & 1 deletion src/scss/404.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body, html {
display: inline-block;
padding: calc($gap / 2) $gap; // Padding with gap-based scaling
font-size: $font-size-link;
font-weight: bold;
font-weight: 400;
color: $link-color;
background-color: $primary-color;
text-decoration: none;
Expand Down
4 changes: 2 additions & 2 deletions src/scss/_poppins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
@include font-face('Poppins', normal, 400, '../assets/fonts/Poppins-Regular-latin-ext.woff2', 'U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF');

/* latin */
@include font-face('Poppins', normal, 400, '../assets/fonts/Poppins-Regular-latin-ext.woff2', 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD');
@include font-face('Poppins', normal, 400, '../assets/fonts/Poppins-Regular-latin.woff2', 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD');

/* latin-ext */
@include font-face('Poppins', normal, 700, '../assets/fonts/Poppins-Bold-latin-ext.woff2', 'U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF');

/* latin */
@include font-face('Poppins', normal, 700, '../assets/fonts/Poppins-Bold-latin-ext.woff2', 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD');
@include font-face('Poppins', normal, 700, '../assets/fonts/Poppins-Bold-latin.woff2', 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD');
2 changes: 2 additions & 0 deletions src/views/404.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>404 - Page not found - Oops!</title>
<link rel="preload" href="../assets/fonts/Poppins-Regular-latin-ext.woff2" as="font" />
<link rel="preload" href="../assets/images/confused-robot.png?as=webp" as="image" />
</head>
<body>
<div class="error-container">
Expand Down
40 changes: 31 additions & 9 deletions src/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,59 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Balázs Varga</title>
<meta name="description" content="Discover the professional profile of Balázs Varga. View links to LinkedIn, GitHub, Bluesky, and blog content.">
<meta name="keywords" content="Balázs Varga, LinkedIn, GitHub, Bluesky, Blog">
<meta name="description" content="Discover the professional profile of Balázs Varga. View links to LinkedIn, GitHub, Bluesky, and blog content. Connect now!">
<meta name="author" content="Balázs Varga">
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:url" content="bvarga.dev" />
<meta property="og:url" content="<%- baseUrl %>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Balázs Varga" />
<meta property="og:description" content="Discover the professional profile of Balázs Varga. View links to LinkedIn, GitHub, Bluesky, and blog content." />
<meta property="og:image" content="../assets/images/profile.png" />
<meta property="og:image:alt" content="Balázs Varga's profile picture" />
<meta property="og:description" content="Discover the professional profile of Balázs Varga. View links to LinkedIn, GitHub, Bluesky, and blog content. Connect now!" />
<meta property="og:image" content="<%- baseUrl + '/' + profilePictureUrlPath %>" />
<meta property="og:image:alt" content="Profile picture of Balázs Varga, CTO @ Apter" />
<meta property="og:image:width" content="1366" />
<meta property="og:image:height" content="1269" />
<link rel="canonical" href="<%- baseUrl %>" />
<link rel="preload" href="../assets/images/profile100w100h.png?as=webp" as="image">
<link rel="preload" href="../assets/fonts/Poppins-Bold-latin-ext.woff2" />
<link rel="preload" href="../assets/fonts/Poppins-Regular-latin-ext.woff2" />
<link rel="preload" href="../../node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2" />
<link rel="preload" href="../../node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "Balázs Varga",
"url": "<%- baseUrl %>",
"sameAs": [
"https://www.linkedin.com/in/-balazs-varga-/",
"https://github.com/warnyul",
"https://bsky.app/profile/balzsvarga.bsky.social",
],
"image": "<%- baseUrl + '/' + profilePictureUrlPath %>",
"description": "Discover the professional profile of Balázs Varga. Links to LinkedIn, GitHub, Bluesky, and blog. Connect now!"
}
</script>
</head>
<body>
<div class="clazz-container">
<div class="clazz-content">
<header>
<picture>
<source type="image/webp" srcset="../assets/images/profile100w100h.png?as=webp" />
<img width="100" height="100" src="../assets/images/profile100w100h.png" alt="Balázs Varga" class="clazz-profile-image" />
<img class="clazz-profile-image" src="../assets/images/profile100w100h.png" alt="Profile picture of Balázs Varga, CTO @ Apter" loading="lazy" width="100" height="100" />
</picture>
<h1 class="clazz-text-center">Balázs Varga</h1>
</header>

<% links.forEach(function(link) { %>
<div class="clazz-button-container">
<a href="<%- link.url %>" target="_blank" rel="noopener noreferrer ugc"><%= link.name %></a>
<a href="<%- link.url %>" aria-label="Visit <%= link.name %>" target="_blank" rel="noopener noreferrer ugc"><%= link.name %></a>
</div>
<% }); %>
<div class="clazz-social-links">
<% socialLinks.forEach(function(link) { %>
<div class="clazz-social-link-container">
<a href="<%- link.url %>" aria-label="<%= link.name %>" target="_blank" rel="noopener noreferrer ugc">
<a href="<%- link.url %>" aria-label="Visit <%= link.name %>" target="_blank" rel="noopener noreferrer ugc">
<i class="fa-brands fa-<%- link.icon %> fa-2xl"></i>
</a>
</div>
Expand Down
18 changes: 17 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ const HtmlInlineScriptWebpackPlugin = require('html-inline-script-webpack-plugin
const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
const SitemapWebpackPlugin = require('sitemap-webpack-plugin').default;

const baseUrl = 'https://bvarga.dev';
const { interpolateName } = require('loader-utils');
const fs = require('fs');
const glob = require('glob');
const path = require('path');
const { sources } = require('webpack');
const context = path.join(__dirname, 'src');
const outputDir = path.join(__dirname, 'dist');
const baseUrl = 'https://bvarga.dev';

module.exports = {
mode: "production",
Expand Down Expand Up @@ -99,6 +102,19 @@ module.exports = {
templatePath: 'src/views/index.ejs',
templateEjsLoaderOption: {
data: {
baseUrl: baseUrl,
profilePictureUrlPath: function() {
const pngPath = path.resolve(__dirname, 'src/assets/images/profile.png');
const pngContent = fs.readFileSync(pngPath);
return interpolateName(
{ resourcePath: pngPath },
"[md4:contenthash:hex:20].[ext]",
{
context: context,
content: pngContent,
}
);
}(),
links: [
{
name: 'LinkedIn',
Expand Down