Skip to content
Open
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
6 changes: 6 additions & 0 deletions packages/app/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ useHead({
useSeoMeta({
title: "pkg.pr.new",
description: "Search repositories to list their continuous releases.",
ogTitle: "pkg.pr.new",
ogDescription: "Continuous (pre)Releases for your libraries.",
ogType: "website",
twitterCard: "summary_large_image",
});

defineOgImageComponent("Brand");
</script>

<template>
Expand Down
81 changes: 81 additions & 0 deletions packages/app/app/components/OgImage/Brand.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<script setup lang="ts">
withDefaults(
defineProps<{
title?: string;
description?: string;
}>(),
{
title: "pkg.pr.new",
description: "Continuous (pre)Releases for your libraries.",
},
);
</script>

<template>
<div
style="
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #0b0b0f;
color: #ffffff;
padding: 80px;
font-family: &quot;Inter&quot;, sans-serif;
"
>
<div
style="
position: absolute;
top: 0;
left: 0;
right: 0;
height: 8px;
background: linear-gradient(90deg, #f38020 0%, #0ea5e9 100%);
"
/>

<img src="/favicon.svg" width="128" height="128" alt="" />

<div
style="
font-size: 88px;
font-weight: 800;
margin-top: 32px;
letter-spacing: -0.02em;
"
>
{{ title }}
</div>

<div
style="
font-size: 36px;
opacity: 0.7;
margin-top: 16px;
text-align: center;
max-width: 900px;
"
>
{{ description }}
</div>

<div
style="
position: absolute;
bottom: 48px;
left: 80px;
right: 80px;
display: flex;
justify-content: space-between;
font-size: 24px;
opacity: 0.5;
"
>
<span>Continuous (pre)Releases</span>
<span>pkg.pr.new</span>
</div>
</div>
</template>
84 changes: 84 additions & 0 deletions packages/app/app/components/OgImage/Repo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<script setup lang="ts">
defineProps<{
owner: string;
repo: string;
releaseCount?: number;
}>();
</script>

<template>
<div
style="
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
background: #0b0b0f;
color: #ffffff;
padding: 64px;
font-family: &quot;Inter&quot;, sans-serif;
"
>
<div
style="
position: absolute;
top: 0;
left: 0;
right: 0;
height: 8px;
background: linear-gradient(90deg, #f38020 0%, #0ea5e9 100%);
"
/>

<div style="display: flex; align-items: center; gap: 16px">
<img src="/favicon.svg" width="56" height="56" alt="" />
<div style="font-size: 28px; opacity: 0.7">pkg.pr.new</div>
</div>

<div style="display: flex; align-items: center; gap: 32px">
<img
:src="`https://github.com/${owner}.png?size=200`"
width="180"
height="180"
style="border-radius: 20px"
alt=""
/>
<div style="display: flex; flex-direction: column">
<div style="font-size: 36px; opacity: 0.6">{{ owner }} /</div>
<div
style="
font-size: 84px;
font-weight: 800;
line-height: 1;
letter-spacing: -0.02em;
"
>
{{ repo }}
</div>
</div>
</div>

<div
style="
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28px;
"
>
<span style="opacity: 0.7">Continuous Releases</span>
<span
v-if="releaseCount != null"
style="
background: rgba(14, 165, 233, 0.15);
color: #38bdf8;
padding: 8px 20px;
border-radius: 999px;
"
>
{{ releaseCount }} releases
</span>
</div>
</div>
</template>
9 changes: 8 additions & 1 deletion packages/app/app/pages/~/[owner]/[repo].vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ useSeoMeta({
description: `See all ${repository.name} recent continuous releases.`,
ogTitle: `${repository.owner.login}/${repository.name} Continuous Releases`,
ogDescription: `See all ${repository.name} recent continuous releases.`,
ogType: "website",
twitterCard: "summary_large_image",
});

defineOgImageComponent("Repo", {
owner: repository.owner.login,
repo: repository.name,
releaseCount: repository.releaseCount,
});
// TODO: OG Image
</script>

<template>
Expand Down
24 changes: 23 additions & 1 deletion packages/app/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,30 @@ export default defineNuxtConfig({
future: { compatibilityVersion: 4 },

// https://nuxt.com/modules
modules: ["@nuxt/eslint", "@nuxt/ui", "@vueuse/nuxt", "nitro-cloudflare-dev"],
modules: [
"@nuxt/eslint",
"@nuxt/ui",
"@vueuse/nuxt",
"nitro-cloudflare-dev",
"nuxt-og-image",
],

css: ["~/assets/css/main.css"],

site: {
url: "https://pkg.pr.new",
name: "pkg.pr.new",
},

ogImage: {
defaults: {
component: "Brand",
width: 1200,
height: 630,
cacheMaxAgeSeconds: 60 * 60 * 24 * 7,
},
},

// https://eslint.nuxt.com
eslint: {
config: {
Expand Down Expand Up @@ -38,6 +58,8 @@ export default defineNuxtConfig({
"query-registry",
"@simulacrum",
"@jsdevtools",
"consola",
"nuxt-site-config",
],
},
},
Expand Down
2 changes: 2 additions & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@vueuse/nuxt": "^12.2.0",
"marked": "^15.0.4",
"nuxt": "^3.15.0",
"nuxt-og-image": "^4.2.0",
"nuxt-shiki": "0.3.0",
"octokit": "^4.0.2",
"query-registry": "^3.0.1",
Expand All @@ -47,6 +48,7 @@
"@types/string-similarity": "^4.0.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vue/compiler-sfc": "3.5.13",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"esbuild": "^0.20.2",
Expand Down
Loading
Loading