Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
try to improve google page speed
Browse files Browse the repository at this point in the history
  • Loading branch information
hlassiege committed Nov 12, 2023
1 parent 084e372 commit d71a7e9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 29 deletions.
11 changes: 7 additions & 4 deletions components/BlogCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
class="mb-4 bg-white border border-gray-200 min-h-[400px] border-b-2 border-b-slate-400 hover:drop-shadow-xl hover:border-gray-300 transition-all hover:-translate-y-1"
>
<NuxtLink class="overflow-hidden" :to="postLink">
<img
<NuxtImg
v-if="img"
class="object-cover w-full h-52"
:src="'/images/' + img"
loading="lazy"
alt=""
format="webp"
alt="Blog post cover"
/>
<img
<NuxtImg
v-else
class="object-contain w-full h-52"
src="/images/post-anonymous.jpg"
loading="lazy"
alt=""
format="webp"
alt="Blog post cover"
/>
</NuxtLink>
<div class="p-3">
Expand All @@ -34,6 +36,7 @@
v-for="tag in tags"
:key="tag"
:href="'/blog?tag=' + tag"
:aria-label="`More about ${tag}`"
class="m-1 leading-loose text-slate-400 border border-current lowercase px-2 rounded font-medium"
@click.prevent="$emit('changeCurrentTag', tag)"
>#{{ tag }}</a
Expand Down
2 changes: 1 addition & 1 deletion components/HeroSection.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<section class="hero-banner">
<img src="lofi.svg" class="hero-banner-img" />
<NuxtImg src="lofi.svg" class="hero-banner-img" alt="Blog Banner" />
<slot name="content"> </slot>
</section>
</template>
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineNuxtConfig({
},

css: ["@/assets/css/main.css", "@/assets/scss/main.scss"],
modules: ["@nuxt/content", "@nuxtjs/tailwindcss", "@nuxt/image-edge"],
modules: ["@nuxt/content", "@nuxtjs/tailwindcss", "@nuxt/image"],
content: {
markdown: {
remarkPlugins: ["remark-reading-time"],
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@nuxt/content": "2.9.0",
"@nuxt/image-edge": "1.0.0-28324167.9427c1c",
"@nuxt/image": "1.0.0",
"@nuxtjs/feed": "2.0.0",
"@nuxtjs/redirect-module": "0.3.1",
"@nuxtjs/sitemap": "2.4.0",
Expand Down
6 changes: 4 additions & 2 deletions pages/fr/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<NuxtLink
class="relative inline-block group focus:outline-none focus:ring"
to="/blog"
aria-label="Read more blog posts"
>
<span
class="absolute inset-0 transition-transform translate-x-1.5 translate-y-1.5 bg-pink-300 group-hover:translate-y-0 group-hover:translate-x-0"
Expand All @@ -81,7 +82,7 @@
<span
class="relative inline-block px-8 py-3 text-sm font-bold tracking-widest text-black uppercase border-2 border-current group-active:text-opacity-75"
>
Read more
Read more blog posts
</span>
</NuxtLink>
</div>
Expand All @@ -91,6 +92,7 @@
<NuxtLink
class="relative inline-block group focus:outline-none focus:ring"
to="/blog"
aria-label="Read more blog posts"
>
<span
class="absolute inset-0 transition-transform translate-x-1.5 translate-y-1.5 bg-pink-300 group-hover:translate-y-0 group-hover:translate-x-0"
Expand All @@ -99,7 +101,7 @@
<span
class="relative inline-block px-8 py-3 text-sm font-bold tracking-widest text-black uppercase border-2 border-current group-active:text-opacity-75"
>
Read more
Read more blog posts
</span>
</NuxtLink>
</div>
Expand Down
6 changes: 4 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<NuxtLink
class="relative inline-block group focus:outline-none focus:ring"
to="/blog"
aria-label="Read more blog posts"
>
<span
class="absolute inset-0 transition-transform translate-x-1.5 translate-y-1.5 bg-pink-300 group-hover:translate-y-0 group-hover:translate-x-0"
Expand All @@ -81,7 +82,7 @@
<span
class="relative inline-block px-8 py-3 text-sm font-bold tracking-widest text-black uppercase border-2 border-current group-active:text-opacity-75"
>
Read more
Read more blog posts
</span>
</NuxtLink>
</div>
Expand All @@ -91,6 +92,7 @@
<NuxtLink
class="relative inline-block group focus:outline-none focus:ring"
to="/blog"
aria-label="Read more blog posts"
>
<span
class="absolute inset-0 transition-transform translate-x-1.5 translate-y-1.5 bg-pink-300 group-hover:translate-y-0 group-hover:translate-x-0"
Expand All @@ -99,7 +101,7 @@
<span
class="relative inline-block px-8 py-3 text-sm font-bold tracking-widest text-black uppercase border-2 border-current group-active:text-opacity-75"
>
Read more
Read more blog posts
</span>
</NuxtLink>
</div>
Expand Down

0 comments on commit d71a7e9

Please sign in to comment.