Skip to content

Commit

Permalink
Merge branch 'upgrade'
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRoger committed Mar 31, 2024
2 parents 67cccbf + 928ac43 commit eeb2f3a
Show file tree
Hide file tree
Showing 10 changed files with 442 additions and 310 deletions.
521 changes: 291 additions & 230 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.5.5",
"@astrojs/mdx": "^2.0.0",
"@astrojs/check": "^0.5.10",
"@astrojs/mdx": "^2.2.2",
"@astrojs/rss": "^4.0.0",
"@astrojs/tailwind": "^5.0.3",
"@astrojs/vercel": "^7.3.3",
"@fontsource/jetbrains-mono": "^5.0.17",
"@fontsource/poppins": "^5.0.8",
"@iconify-json/simple-icons": "^1.1.93",
"astro": "^4.0.3",
"@astrojs/vercel": "^7.5.0",
"@fontsource/jetbrains-mono": "^5.0.19",
"@fontsource/poppins": "^5.0.13",
"@iconify-json/simple-icons": "^1.1.97",
"astro": "^4.5.12",
"astro-icon": "^1.1.0",
"js-sha256": "^0.11.0",
"mdast-util-to-string": "^4.0.0",
"reading-time": "^1.5.0",
"tailwindcss": "^3.3.5",
"typescript": "^5.2.2"
"tailwindcss": "^3.4.3",
"typescript": "^5.4.3"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"daisyui": "^4.4.2"
"@tailwindcss/typography": "^0.5.12",
"daisyui": "^4.9.0"
}
}
31 changes: 31 additions & 0 deletions src/components/AuthorBasicInfo.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
import StackTechCard from "../components/StackTechCard.astro";
import { Icon } from "astro-icon/components";
import IconButton from "../components/IconButton.astro";
import AuthorAvatar from "../components/AuthorAvatar.astro";
import type { AuthorProfile } from "../scripts/types/post_types";
import EmailText from "./EmailText.astro";
import SocialList from "./SocialList.astro";
import StackList from "./StackList.astro";
interface Props {
adm: AuthorProfile;
}
const { adm } = Astro.props;
const githubUrl = adm.github;
const linkedinUrl = adm.linkedin;
const stack = adm.stack;
---

<div
class="flex sm:gap-2 md:max-2xl:gap-5 sm:flex-col md:max-2xl:flex-row mb-3"
>
<AuthorAvatar adm={adm} />
<div class="flex flex-col sm:gap-2">
<h1>{adm.name}</h1>
<EmailText email={adm.email} />
<SocialList githubUrl={githubUrl} linkedinUrl={linkedinUrl} />
<StackList stack={stack} />
</div>
</div>
13 changes: 13 additions & 0 deletions src/components/EmailText.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
import { Icon } from "astro-icon/components";
interface Props {
email: string;
}
const { email } = Astro.props;
---

<div class="flex flex-row gap-2 items-center">
<Icon name="mail" size={20} />
<h3>{email}</h3>
</div>
14 changes: 11 additions & 3 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import SponsorButton from "./SponsorButton.astro";
---

<footer>
<div class="flex sm:flex-col sm:gap-3 md:max-2xl:flex-row w-100 justify-between items-center p-5 px-10">
<div
class="flex sm:flex-col sm:gap-3 md:max-2xl:flex-row w-100 justify-between items-center p-5 px-10"
>
<aside>
<small>
<span>
Expand All @@ -21,13 +23,19 @@ import SponsorButton from "./SponsorButton.astro";
href="https://github.com/LuanRoger/lr-tech-blog"
class="tooltip tooltip-top flex items-center"
data-tip="Fork me"
aria-label="Goto to Github"
>
<IconButton name="fork" size={17} alt="Goto to Github" />
</a>
<a href="/rss.xml" class="tooltip tooltip-top flex items-center" data-tip="RSS">
<a
href="/rss.xml"
class="tooltip tooltip-top flex items-center"
data-tip="RSS"
aria-label="Check RSS page"
>
<IconButton name="rss" size={17} alt="Check RSS page" />
</a>
<SponsorButton/>
<SponsorButton />
</aside>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/components/Logo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const logoAlt = "Logo LR Tech Blog"
---

<div class="saturate-100 hue-rotate-30 btn btn-ghost h-auto">
<a href="/">
<Image class:list={"transition hover:scale-105"} src={lrLogo} alt={logoAlt} width={90} />
<a href="/" class="transition hover:scale-105">
<Image src={lrLogo} alt={logoAlt} width={90} loading={"eager"} />
</a>
</div>
45 changes: 45 additions & 0 deletions src/components/SocialList.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
import IconButton from "./IconButton.astro";
interface Props {
githubUrl?: string | undefined;
linkedinUrl?: string | undefined;
}
const { githubUrl, linkedinUrl } = Astro.props;
---

<div class="flex flex-row gap-3">
{
githubUrl && (
<social-button data-url={githubUrl}>
<IconButton name="github" size={30} alt="Goto creator's GitHub" />
</social-button>
)
}
{
linkedinUrl && (
<social-button data-url={linkedinUrl}>
<IconButton name="linkedin" size={30} alt="Goto creator's Linkedin" />
</social-button>
)
}
</div>

<script>
import { goto } from "../scripts/goto";

class SocialButton extends HTMLElement {
constructor() {
super();

const socialUrl = this.dataset.url;

const button = this.querySelector("button");
if (typeof socialUrl === "string")
button?.addEventListener("click", () => goto(socialUrl));
}
}

customElements.define("social-button", SocialButton);
</script>
9 changes: 7 additions & 2 deletions src/components/SponsorButton.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
---

<iframe src="https://github.com/sponsors/LuanRoger/button" title="Sponsor LuanRoger"
height="32" width="114"/>
<iframe
src="https://github.com/sponsors/LuanRoger/button"
title="Sponsor LuanRoger"
height="32"
width="114"
loading="lazy"></iframe>
27 changes: 27 additions & 0 deletions src/components/StackList.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
import type { AuthorProfileStack } from "../scripts/types/post_types";
import StackTechCard from "./StackTechCard.astro";
interface Props {
stack: AuthorProfileStack[];
listClass?: string | undefined;
}
const { stack, listClass } = Astro.props;
---

<div>
<small>STACK</small>
<ul class={listClass ?? "flex flex-wrap gap-3"}>
{
stack.map((s) => (
<li>
<StackTechCard
name={s.name}
iconName={s.iconName}
iconColor={s.iconColor}
/>
</li>
))
}
</ul>
</div>
66 changes: 4 additions & 62 deletions src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,84 +1,26 @@
---
import { getEntry } from "astro:content";
import AuthorAvatar from "../components/AuthorAvatar.astro";
import LayoutPage from "../layouts/LayoutPage.astro";
import type { AuthorProfile } from "../scripts/types/post_types";
import { Icon } from "astro-icon/components";
import IconButton from "../components/IconButton.astro";
import Prose from "../components/Prose.astro";
import StackTechCard from "../components/StackTechCard.astro";
import AuthorBasicInfo from "../components/AuthorBasicInfo.astro";
const title = "Sobre";
const admName = "rog";
const admAuthorProfile = await getEntry("authors", admName);
const admDescription = await getEntry("authorsDescription", admName);
const adm: AuthorProfile = admAuthorProfile.data;
const { Content } = await admDescription.render();
const githubUrl = adm.github;
const linkedinUrl = adm.linkedin;
const { Content } = await admDescription.render();
---

<LayoutPage title={title}>
<div
class="flex sm:gap-2 md:max-2xl:gap-5 sm:flex-col md:max-2xl:flex-row mb-3"
>
<AuthorAvatar adm={adm} />
<div class="flex flex-col sm:gap-2">
<h1>{adm.name}</h1>
<div class="flex flex-row gap-2 items-center">
<Icon name="mail" size={20} />
<h3>{adm.email}</h3>
</div>
<div class="flex flex-row gap-3">
<social-button data-url={githubUrl}>
<IconButton name="github" size={30} alt="Goto creator's GitHub" />
</social-button>
<social-button data-url={linkedinUrl}>
<IconButton name="linkedin" size={30} alt="Goto creator's Linkedin" />
</social-button>
</div>
<div>
<!-- TODO: Separate in component -->
<small>STACK</small>
<ul class="flex flex-wrap gap-3">
{
adm.stack.map((s) => (
<li>
<StackTechCard
name={s.name}
iconName={s.iconName}
iconColor={s.iconColor}
/>
</li>
))
}
</ul>
</div>
</div>
</div>
<AuthorBasicInfo adm={adm} />
<article>
<Prose>
<Content />
</Prose>
</article>
</LayoutPage>

<script>
import { goto } from "../scripts/goto";

class SocialButton extends HTMLElement {
constructor() {
super();

const socialUrl = this.dataset.url;

const button = this.querySelector("button");
if (typeof socialUrl === "string")
button?.addEventListener("click", () => goto(socialUrl));
}
}

customElements.define("social-button", SocialButton);
</script>

0 comments on commit eeb2f3a

Please sign in to comment.