Format with prettier
This commit is contained in:
@ -9,7 +9,7 @@ const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } =
|
||||
<div class="container flex">
|
||||
<div class="flex flex-row mx-auto container justify-between">
|
||||
<a
|
||||
href={getPermalink(prevUrl, "raw")}
|
||||
href={getPermalink(prevUrl, 'raw')}
|
||||
class={`btn px-2 font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white shadow-none mr-2
|
||||
${!prevUrl ? 'invisible' : ''}`}
|
||||
>
|
||||
@ -19,7 +19,7 @@ const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } =
|
||||
</div>
|
||||
</a>
|
||||
<a
|
||||
href={getPermalink(nextUrl, "raw")}
|
||||
href={getPermalink(nextUrl, 'raw')}
|
||||
class={`btn px-2 font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white shadow-none ${
|
||||
!nextUrl ? 'invisible' : ''
|
||||
}`}
|
||||
|
@ -11,7 +11,8 @@ const { post } = Astro.props;
|
||||
<article>
|
||||
<header>
|
||||
<p class="max-w-3xl mx-auto text-center">
|
||||
<time datetime={post.publishDate}>{getFormattedDate(post.publishDate)}</time> ~ {Math.ceil(post.readingTime)} min read
|
||||
<time datetime={post.publishDate}>{getFormattedDate(post.publishDate)}</time> ~ {Math.ceil(post.readingTime)} min
|
||||
read
|
||||
</p>
|
||||
<h1
|
||||
class="px-4 sm:px-6 max-w-3xl mx-auto text-center text-4xl md:text-5xl font-bold leading-tighter tracking-tighter mb-8 font-heading"
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
import { AstroSeo } from "@astrolib/seo"
|
||||
import { GoogleAnalytics } from "@astrolib/analytics"
|
||||
import { AstroSeo } from '@astrolib/seo';
|
||||
import { GoogleAnalytics } from '@astrolib/analytics';
|
||||
import { getImage } from '@astrojs/image';
|
||||
import { getRelativeUrlByFilePath } from '~/utils/directories';
|
||||
|
||||
@ -9,7 +9,7 @@ import defaultImageSrc from '~/assets/images/default.png';
|
||||
import { SITE } from '~/config.mjs';
|
||||
import Fonts from '../atoms/Fonts.astro';
|
||||
import ExtraMetaTags from '../atoms/ExtraMetaTags.astro';
|
||||
import SplitbeeAnalytics from "./SplitbeeAnalytics.astro";
|
||||
import SplitbeeAnalytics from './SplitbeeAnalytics.astro';
|
||||
|
||||
const { src: defaultImage } = await getImage({
|
||||
src: defaultImageSrc,
|
||||
@ -44,22 +44,22 @@ const image =
|
||||
<AstroSeo
|
||||
title={title}
|
||||
description={description}
|
||||
|
||||
canonical={canonical}
|
||||
noindex={noindex}
|
||||
nofollow={nofollow}
|
||||
|
||||
openGraph={{
|
||||
url: canonical,
|
||||
title: ogTitle,
|
||||
description: description,
|
||||
type: ogType,
|
||||
images: image ? [
|
||||
{
|
||||
url: image.toString(),
|
||||
alt: ogTitle,
|
||||
},
|
||||
] : undefined,
|
||||
images: image
|
||||
? [
|
||||
{
|
||||
url: image.toString(),
|
||||
alt: ogTitle,
|
||||
},
|
||||
]
|
||||
: undefined,
|
||||
// site_name: 'SiteName',
|
||||
}}
|
||||
twitter={{
|
||||
|
@ -1,15 +1,6 @@
|
||||
---
|
||||
const {
|
||||
doNotTrack = true,
|
||||
noCookieMode = false,
|
||||
url = "https://cdn.splitbee.io/sb.js"
|
||||
} = Astro.props;
|
||||
const { doNotTrack = true, noCookieMode = false, url = 'https://cdn.splitbee.io/sb.js' } = Astro.props;
|
||||
---
|
||||
|
||||
<!-- Splitbee Analytics -->
|
||||
<script
|
||||
data-respect-dnt={doNotTrack}
|
||||
data-no-cookie={noCookieMode}
|
||||
async
|
||||
src={url}
|
||||
></script>
|
||||
<script data-respect-dnt={doNotTrack} data-no-cookie={noCookieMode} async src={url}></script>
|
||||
|
@ -25,9 +25,7 @@ import { getPermalink, getBlogPermalink, getHomePermalink } from '~/utils/permal
|
||||
class="items-center w-full md:w-auto hidden md:flex text-gray-600 dark:text-slate-200 h-screen md:h-auto"
|
||||
aria-label="Main navigation"
|
||||
>
|
||||
<ul
|
||||
class="flex flex-col pt-8 md:pt-0 md:flex-row md:self-center w-full md:w-auto text-xl md:text-base"
|
||||
>
|
||||
<ul class="flex flex-col pt-8 md:pt-0 md:flex-row md:self-center w-full md:w-auto text-xl md:text-base">
|
||||
<li>
|
||||
<a
|
||||
class="font-medium hover:text-gray-900 dark:hover:text-white px-4 py-3 flex items-center transition duration-150 ease-in-out"
|
||||
|
@ -6,7 +6,7 @@ import Picture from '~/components/core/Picture.astro';
|
||||
<section>
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="py-12 md:py-20">
|
||||
<div class="text-center pb-10 md:pb-16">
|
||||
<div class="text-center pb-10 md:pb-16 max-w-5xl mx-auto">
|
||||
<h1 class="text-5xl md:text-[3.50rem] font-bold leading-tighter tracking-tighter mb-4 font-heading">
|
||||
Your website with
|
||||
<span class="bg-clip-text text-transparent bg-gradient-to-r from-primary-500 to-secondary-500">Astro</span> +
|
||||
@ -49,9 +49,10 @@ import Picture from '~/components/core/Picture.astro';
|
||||
src={import('~/assets/images/hero.jpg')}
|
||||
class="mx-auto rounded-md shadow-lg bg-gray-400 dark:bg-slate-700 w-full"
|
||||
widths={[400, 768]}
|
||||
sizes=" (max-width: 767px) 400px, 768px"
|
||||
sizes="(max-width: 767px) 400px, 768px"
|
||||
alt="Hero Image"
|
||||
aspectRatio="16:9"
|
||||
loading="eager"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -23,7 +23,7 @@ export const BLOG = {
|
||||
|
||||
post: {
|
||||
disabled: false,
|
||||
pathname: '', // empty for /some-post, value for /pathname/some-post
|
||||
pathname: '', // empty for /some-post, value for /pathname/some-post
|
||||
},
|
||||
|
||||
category: {
|
||||
|
@ -26,8 +26,8 @@ const meta = {
|
||||
title: `Blog ${currentPage > 1 ? `— Page ${currentPage} ` : ''}— ${SITE.name}`,
|
||||
description: SITE.description,
|
||||
canonical: getCanonical(getPermalink(BLOG?.blog?.pathname)),
|
||||
ogType: "blog",
|
||||
noindex: currentPage > 1
|
||||
ogType: 'blog',
|
||||
noindex: currentPage > 1,
|
||||
};
|
||||
---
|
||||
|
||||
|
@ -30,7 +30,7 @@ const meta = {
|
||||
canonical: post.canonical || getCanonical(getPermalink(post.slug, 'post')),
|
||||
image: await findImage(post.image),
|
||||
ogTitle: post.title,
|
||||
ogType: "article"
|
||||
ogType: 'article',
|
||||
};
|
||||
---
|
||||
|
||||
|
@ -37,7 +37,7 @@ const currentPage = page.currentPage ?? 1;
|
||||
const meta = {
|
||||
title: `Category '${category}' ${currentPage > 1 ? `— Page ${currentPage} ` : ''}— ${SITE.name}`,
|
||||
description: SITE.description,
|
||||
canonical: getCanonical(getPermalink(category, "category")),
|
||||
canonical: getCanonical(getPermalink(category, 'category')),
|
||||
noindex: true,
|
||||
};
|
||||
---
|
||||
|
@ -37,8 +37,8 @@ const currentPage = page.currentPage ?? 1;
|
||||
const meta = {
|
||||
title: `Posts by tag '${tag}' ${currentPage > 1 ? `— Page ${currentPage} ` : ''}— ${SITE.name}`,
|
||||
description: SITE.description,
|
||||
canonical: getCanonical(getPermalink(tag, "tag")),
|
||||
noindex: true
|
||||
canonical: getCanonical(getPermalink(tag, 'tag')),
|
||||
noindex: true,
|
||||
};
|
||||
---
|
||||
|
||||
|
@ -2,10 +2,10 @@ import getReadingTime from 'reading-time';
|
||||
import { toString } from 'mdast-util-to-string';
|
||||
|
||||
export function remarkReadingTime() {
|
||||
return function (tree, { data }) {
|
||||
const text = toString(tree);
|
||||
const readingTime = Math.ceil(getReadingTime(text).minutes);
|
||||
return function (tree, { data }) {
|
||||
const text = toString(tree);
|
||||
const readingTime = Math.ceil(getReadingTime(text).minutes);
|
||||
|
||||
data.astro.frontmatter.readingTime = readingTime;
|
||||
};
|
||||
}
|
||||
data.astro.frontmatter.readingTime = readingTime;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user