Skip to content

Commit

Permalink
chore: add ogpreview for default og
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Aug 3, 2024
1 parent 7c46be1 commit 52f914a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: bun install

- name: Build
run: bunx nuxi build --preset=cloudflare_pages
run: bunx nuxi generate --preset=cloudflare_pages

- name: Deploy
uses: cloudflare/wrangler-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install Deps
run: bun install
- name: Build
run: bun run build --preset=cloudflare_pages
run: bun run generate --preset=cloudflare_pages

# Deploy steps
- name: Deploy
Expand Down
Binary file modified bun.lockb
Binary file not shown.
7 changes: 6 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
devtools: { enabled: true },
modules: ["@nuxt/content", "@nuxtjs/tailwindcss", "@nuxtjs/seo"],
site: {
Expand All @@ -10,6 +9,12 @@ export default defineNuxtConfig({
defaultLocale: 'es'
},
ogImage: { enabled: false },
nitro: {
prerender: {
crawlLinks: true,
routes: ['/sitemap.xml']
}
},
app: {
head: {
charset: 'utf-8',
Expand Down
17 changes: 7 additions & 10 deletions pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@ const statusDropDown = ref(null);
const status = ref($locally.get(nodeId) ?? "Pendiente");
const isScrolled = ref(false);
onMounted(async () => {
if (!nodeId) return;
const contentResult = await queryContent((nodeId || []).join("/")).findOne();
content.value = contentResult;
showSidebar.value = contentResult && (route.query.fromClick || false);
useContentHead(contentResult)
});
useSeoMeta({
twitterCard: 'summary_large_image',
icon: '/favicon.ico',
Expand All @@ -132,6 +122,13 @@ useSeoMeta({
twitterImage: `/previews/${(nodeId && nodeId.join('-')) || 'ogpreview'}.png`,
})
onMounted(async () => {
if (!nodeId) return;
const contentResult = await queryContent((nodeId || []).join("/")).findOne();
content.value = contentResult;
showSidebar.value = contentResult && (route.query.fromClick || false);
});
const closeSidebar = () => {
content.value = null;
document.body.classList.remove("overflow-hidden");
Expand Down
Binary file added public/previews/ogpreview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 52f914a

Please sign in to comment.