feat(meta): let articles meta override default
This commit is contained in:
		@@ -3,18 +3,11 @@ import { FileRoutes } from "@solidjs/start/router";
 | 
				
			|||||||
import { Suspense } from "solid-js";
 | 
					import { Suspense } from "solid-js";
 | 
				
			||||||
import "./app.css";
 | 
					import "./app.css";
 | 
				
			||||||
import { Layout } from "./components/Layout";
 | 
					import { Layout } from "./components/Layout";
 | 
				
			||||||
import { MetaProvider, Title, Meta } from "@solidjs/meta";
 | 
					import { MetaProvider } from "@solidjs/meta";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default function App() {
 | 
					export default function App() {
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<MetaProvider>
 | 
							<MetaProvider>
 | 
				
			||||||
			<Title>minhtran_dev</Title>
 | 
					 | 
				
			||||||
			<Meta property="og:title" content="minhtran_dev" />
 | 
					 | 
				
			||||||
			<Meta property="og:description" content="just trying my best :)" />
 | 
					 | 
				
			||||||
			<Meta property="og:image" content="/og.png" />
 | 
					 | 
				
			||||||
			<Meta property="og:image:alt" content="minhtran_dev site" />
 | 
					 | 
				
			||||||
			<Meta property="og:image:width" content="1200" />
 | 
					 | 
				
			||||||
			<Meta property="og:image:height" content="630" />
 | 
					 | 
				
			||||||
			<Router
 | 
								<Router
 | 
				
			||||||
				root={(props) => {
 | 
									root={(props) => {
 | 
				
			||||||
					return (
 | 
										return (
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,14 +1,25 @@
 | 
				
			|||||||
import { For } from "solid-js";
 | 
					import { For } from "solid-js";
 | 
				
			||||||
import Experience from "../components/Experience";
 | 
					import Experience from "../components/Experience";
 | 
				
			||||||
 | 
					import { Title, Meta } from "@solidjs/meta";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const links = [
 | 
					const links = [
 | 
				
			||||||
	"https://github.com/minhtrannhat",
 | 
						"https://github.com/minhtrannhat",
 | 
				
			||||||
	"https://linkedin.com/in/minh-tran-nhat",
 | 
						"https://linkedin.com/in/minh-tran-nhat",
 | 
				
			||||||
	"https://git.minhtrannhat.com/explore/repos",
 | 
						"https://git.minhtrannhat.com/explore/repos",
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const Homepage = () => {
 | 
					const Homepage = () => {
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<div>
 | 
							<div>
 | 
				
			||||||
 | 
								<Title>minhtran_dev</Title>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<Meta property="og:title" content="minhtran_dev" />
 | 
				
			||||||
 | 
								<Meta property="og:description" content="just trying my best :)" />
 | 
				
			||||||
 | 
								<Meta property="og:image" content="/og.png" />
 | 
				
			||||||
 | 
								<Meta property="og:image:alt" content="minhtran_dev site" />
 | 
				
			||||||
 | 
								<Meta property="og:image:width" content="1200" />
 | 
				
			||||||
 | 
								<Meta property="og:image:height" content="630" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<section class="mx-4 flex flex-col sm:flex-row gap-2v sm:gap-3h">
 | 
								<section class="mx-4 flex flex-col sm:flex-row gap-2v sm:gap-3h">
 | 
				
			||||||
				<div class="font-medium">
 | 
									<div class="font-medium">
 | 
				
			||||||
					<div class="text-nord-1 flex items-end mb-1v gap-1h">
 | 
										<div class="text-nord-1 flex items-end mb-1v gap-1h">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,20 @@
 | 
				
			|||||||
import { posts } from "~/data/posts";
 | 
					import { posts } from "~/data/posts";
 | 
				
			||||||
import dayjs from "dayjs";
 | 
					import dayjs from "dayjs";
 | 
				
			||||||
 | 
					import { Title, Meta } from "@solidjs/meta";
 | 
				
			||||||
import { For } from "solid-js";
 | 
					import { For } from "solid-js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const Articles = () => {
 | 
					const Articles = () => {
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<div>
 | 
							<div>
 | 
				
			||||||
 | 
								<Title>minhtran_dev - Articles</Title>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<Meta property="og:title" content="minhtran_dev Articles" />
 | 
				
			||||||
 | 
								<Meta property="og:description" content="My articles" />
 | 
				
			||||||
 | 
								<Meta property="og:image" content="/og.png" />
 | 
				
			||||||
 | 
								<Meta property="og:image:alt" content="minhtran_dev site" />
 | 
				
			||||||
 | 
								<Meta property="og:image:width" content="1200" />
 | 
				
			||||||
 | 
								<Meta property="og:image:height" content="630" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<ol class="flex flex-col gap-1v list-square ml-2h">
 | 
								<ol class="flex flex-col gap-1v list-square ml-2h">
 | 
				
			||||||
				<For each={Object.values(posts)}>
 | 
									<For each={Object.values(posts)}>
 | 
				
			||||||
					{(post) => (
 | 
										{(post) => (
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,6 +27,17 @@ const Blog = (props: RouteSectionProps<unknown>) => {
 | 
				
			|||||||
			<Meta name="og:title" content={meta().title} />
 | 
								<Meta name="og:title" content={meta().title} />
 | 
				
			||||||
			<Meta name="description" content={meta().description} />
 | 
								<Meta name="description" content={meta().description} />
 | 
				
			||||||
			<Meta name="og:description" content={meta().description} />
 | 
								<Meta name="og:description" content={meta().description} />
 | 
				
			||||||
 | 
								<Meta property="og:type" content="article" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<Meta
 | 
				
			||||||
 | 
									property="og:url"
 | 
				
			||||||
 | 
									content={`https://minhtranhat.com/blog/${meta()?.slug}`}
 | 
				
			||||||
 | 
								/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<Meta property="og:image" content="/og.png" />
 | 
				
			||||||
 | 
								<Meta property="og:image:alt" content="minhtran_dev site" />
 | 
				
			||||||
 | 
								<Meta property="og:image:width" content="1200" />
 | 
				
			||||||
 | 
								<Meta property="og:image:height" content="630" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<Show when={meta().featuredImage}>
 | 
								<Show when={meta().featuredImage}>
 | 
				
			||||||
				<PostImage
 | 
									<PostImage
 | 
				
			||||||
@@ -35,6 +46,7 @@ const Blog = (props: RouteSectionProps<unknown>) => {
 | 
				
			|||||||
					alt={meta().featuredImageDesc || ""}
 | 
										alt={meta().featuredImageDesc || ""}
 | 
				
			||||||
				/>
 | 
									/>
 | 
				
			||||||
			</Show>
 | 
								</Show>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<h1 class="text-2v leading-2 font-bold mb-1v">{meta().title}</h1>
 | 
								<h1 class="text-2v leading-2 font-bold mb-1v">{meta().title}</h1>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<div class="flex items-center gap-4h mb-2v text-sm leading-1">
 | 
								<div class="flex items-center gap-4h mb-2v text-sm leading-1">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
import { For } from "solid-js";
 | 
					import { For } from "solid-js";
 | 
				
			||||||
import { tags } from "~/data/tags";
 | 
					import { tags } from "~/data/tags";
 | 
				
			||||||
 | 
					import { Title, Meta } from "@solidjs/meta";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Code from andii.dev
 | 
					 * Code from andii.dev
 | 
				
			||||||
@@ -7,6 +8,15 @@ import { tags } from "~/data/tags";
 | 
				
			|||||||
const Tags = () => {
 | 
					const Tags = () => {
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<div>
 | 
							<div>
 | 
				
			||||||
 | 
								<Title>minhtran_dev - Article Tags</Title>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<Meta property="og:title" content="minhtran_dev Article Tags" />
 | 
				
			||||||
 | 
								<Meta property="og:description" content="Tags for my articles" />
 | 
				
			||||||
 | 
								<Meta property="og:image" content="/og.png" />
 | 
				
			||||||
 | 
								<Meta property="og:image:alt" content="minhtran_dev site" />
 | 
				
			||||||
 | 
								<Meta property="og:image:width" content="1200" />
 | 
				
			||||||
 | 
								<Meta property="og:image:height" content="630" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<h1 class="text-xl text-nord-1 font-bold mt-1v mb-1v">All tags:</h1>
 | 
								<h1 class="text-xl text-nord-1 font-bold mt-1v mb-1v">All tags:</h1>
 | 
				
			||||||
			<ol class="flex flex-col gap-1v list-square ml-2h">
 | 
								<ol class="flex flex-col gap-1v list-square ml-2h">
 | 
				
			||||||
				<For each={Object.values(tags)}>
 | 
									<For each={Object.values(tags)}>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user