Skip to content

Commit

Permalink
SEO fixes and socials modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
davidawad committed Nov 12, 2023
1 parent 482398d commit 3552784
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 128 deletions.
77 changes: 4 additions & 73 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
---
import { LOGO_IMAGE, SITE } from "@config";
import "@styles/header.css";
import Hr from "./Hr.astro";
import LinkButton from "./LinkButton.astro";
import logoPNG from "/assets/logo.png";
import logoSVG from "/assets/logo.svg";
import Schema from "./Schema.astro"
export interface NavProps {
activeNav?: "posts" | "investing" | "engineering" | "about" | "search";
}
Expand Down Expand Up @@ -33,6 +36,7 @@ const { activeNav } = Astro.props;
}
</a>
</h2>
<Schema />
<nav id="nav-menu">
<button
class="hamburger-menu focus-outline"
Expand Down Expand Up @@ -131,79 +135,6 @@ const { activeNav } = Astro.props;
<Hr />
</header>

<style>
#skip-to-content {
@apply absolute -top-full left-16 z-50 bg-skin-accent px-3 py-2 text-skin-inverted transition-all focus:top-4;
}
.nav-container {
@apply mx-auto flex max-w-3xl flex-col items-center justify-between sm:flex-row;
}
.top-nav-wrap {
@apply relative flex w-full items-start justify-between p-4 sm:items-center sm:py-8;
}
.logo {
@apply absolute py-1 text-xl font-semibold sm:static sm:text-2xl;
}
.hamburger-menu {
@apply self-end p-2 sm:hidden;
}
.hamburger-menu svg {
@apply h-6 w-6 scale-125 fill-skin-base;
}

nav {
@apply flex w-full flex-col items-center bg-skin-fill sm:ml-2 sm:flex-row sm:justify-end sm:space-x-4 sm:py-0;
}
nav ul {
@apply mt-4 grid w-44 grid-cols-2 grid-rows-4 gap-x-2 gap-y-2 sm:ml-0 sm:mt-0 sm:w-auto sm:gap-x-5 sm:gap-y-0;
}
nav ul li {
@apply col-span-2 flex items-center justify-center;
}
nav ul li a {
@apply w-full px-4 py-3 text-center font-medium hover:text-skin-accent sm:my-0 sm:px-2 sm:py-1;
}
nav ul li:nth-child(4) a {
@apply w-auto;
}
nav ul li:nth-child(4),
nav ul li:nth-child(5) {
@apply col-span-1;
}
nav a.active {
@apply underline decoration-wavy decoration-2 underline-offset-4;
}
nav a.active svg {
@apply fill-skin-accent;
}

nav button {
@apply p-1;
}
nav button svg {
@apply h-6 w-6 fill-skin-base hover:fill-skin-accent;
}
#theme-btn {
@apply p-3 sm:p-1;
}
#theme-btn svg {
@apply scale-125 hover:rotate-12 sm:scale-100;
}

.menu-icon line {
@apply transition-opacity duration-75 ease-in-out;
}
.menu-icon .close {
opacity: 0;
}
.menu-icon.is-active .line {
@apply opacity-0;
}
.menu-icon.is-active .close {
@apply opacity-100;
}
</style>

<script>
// Toggle menu
const menuBtn = document.querySelector(".hamburger-menu");
Expand Down
57 changes: 57 additions & 0 deletions src/components/Schema.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
import { SITE, SOCIALS } from "@config";
export interface Props {
title?: string;
author?: string;
description?: string;
ogImage?: string;
}
const {
title = SITE.title,
author = SITE.author,
description = SITE.desc,
ogImage = SITE.ogImage,
} = Astro.props;
---

<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "David Awad",
"jobTitle": "Lawyer, Investor, Engineer",
"worksFor": {
"@type": "Organization",
"name": "Axethrow"
},
"url": "https://davidaw.ad",
"image": "/davidawad-banner.jpg",
"sameAs": [
"https://twitter.com/realdavidawad/",
"https://github.com/davidawad/",
"https://www.linkedin.com/in/davidaawad/"
],
"alumniOf": [
{
"@type": "EducationalOrganization",
"name": "Rutgers University"
},
{
"@type": "EducationalOrganization",
"name": "Georgia Institute of Technology"
},
{
"@type": "EducationalOrganization",
"name": "Northwestern California University School of Law"
}
],
"description": "David Awad, a seasoned electrical engineer turned investor turned lawyer baesd in NYC and DXB, specializes in SaaS Private Equity. This blog offers insights into venture capital, private equity in SaaS as they relate to the law, and software development trends.",
"mainEntityOfPage": {
"@type": "Blog",
"@id": "https://davidaw.ad"
}
};
</script>
5 changes: 4 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export const SITE: Site = {
postPerPage: 3,
};

export const LOCALE = ["en-EN"]; // set to [] to use the environment default
const siteTitleTag = "David Awad | Lawyer, Investor, Engineer"

// set to [] to use the environment default
export const LOCALE = ["en-EN", "ar-EG"];

export const LOGO_IMAGE = {
enable: false,
Expand Down
Loading

0 comments on commit 3552784

Please sign in to comment.