format code

This commit is contained in:
somrat sorkar
2023-05-21 12:44:58 +06:00
parent 7048d2fc88
commit b169d93ec9
31 changed files with 266 additions and 245 deletions
+4 -1
View File
@@ -4,7 +4,10 @@ import config from "@/config/config.json";
import { humanize, plainify, slugify } from "@/lib/utils/textConverter";
import { FaRegFolder, FaRegUserCircle } from "react-icons/fa/index.js";
const { summary_length, blog_folder }: {summary_length: number, blog_folder: string} = config.settings;
const {
summary_length,
blog_folder,
}: { summary_length: number; blog_folder: string } = config.settings;
const { data } = Astro.props;
const { title, image, date, author, categories } = data.data;
---
+1 -1
View File
@@ -1,7 +1,7 @@
---
import { humanize } from "@/lib/utils/textConverter";
const { className }: {className?: string} = Astro.props;
const { className }: { className?: string } = Astro.props;
const paths = Astro.url.pathname.split("/").filter((x) => x);
let parts = [
+2 -1
View File
@@ -2,7 +2,8 @@
import { Image } from "@astrojs/image/components";
import config from "@/config/config.json";
const { src, srcDarkmode } : {src?: string, srcDarkmode?: string} = Astro.props;
const { src, srcDarkmode }: { src?: string; srcDarkmode?: string } =
Astro.props;
const {
logo,
logo_darkmode,
+5 -3
View File
@@ -1,8 +1,10 @@
---
type Pagination = {
section?: string, currentPage?: number, totalPages?: number
}
const { section, currentPage=1, totalPages=1 }: Pagination = Astro.props;
section?: string;
currentPage?: number;
totalPages?: number;
};
const { section, currentPage = 1, totalPages = 1 }: Pagination = Astro.props;
const indexPageLink = currentPage === 2;
const hasPrevPage = currentPage > 1;
+8 -2
View File
@@ -7,8 +7,14 @@ import {
IoLogoTwitter,
} from "react-icons/io5/index.js";
const { base_url }: {base_url: string} = config.site;
const { title, description, slug, className }: {title?: string, description?: string, slug?: string, className?: string} = Astro.props;
const { base_url }: { base_url: string } = config.site;
const {
title,
description,
slug,
className,
}: { title?: string; description?: string; slug?: string; className?: string } =
Astro.props;
---
<ul class={`${className}`}>
+32 -32
View File
@@ -36,38 +36,38 @@ import {
} from "react-icons/io5/index.js";
type SocialLink = {
facebook: string,
twitter: string,
mastodon: string,
instagram: string,
youtube: string,
linkedin: string,
github: string,
gitlab: string,
discord: string,
slack: string,
medium: string,
codepen: string,
bitbucket: string,
dribbble: string,
behance: string,
pinterest: string,
soundcloud: string,
tumblr: string,
reddit: string,
vk: string,
whatsapp: string,
snapchat: string,
vimeo: string,
tiktok: string,
foursquare: string,
rss: string,
email: string,
phone: string,
address: string,
skype: string,
website: string,
}
facebook: string;
twitter: string;
mastodon: string;
instagram: string;
youtube: string;
linkedin: string;
github: string;
gitlab: string;
discord: string;
slack: string;
medium: string;
codepen: string;
bitbucket: string;
dribbble: string;
behance: string;
pinterest: string;
soundcloud: string;
tumblr: string;
reddit: string;
vk: string;
whatsapp: string;
snapchat: string;
vimeo: string;
tiktok: string;
foursquare: string;
rss: string;
email: string;
phone: string;
address: string;
skype: string;
website: string;
};
const {
facebook,
twitter,
+36 -37
View File
@@ -1,47 +1,46 @@
---
import config from "@/config/config.json";
const { theme_switcher, default_theme }: { theme_switcher: boolean, default_theme: string } = config.settings;
const {className}: {className?: string} = Astro.props;
const {
theme_switcher,
default_theme,
}: { theme_switcher: boolean; default_theme: string } = config.settings;
const { className }: { className?: string } = Astro.props;
---
{
theme_switcher && (
<div class={`theme-switcher ${className}`}>
<input id="theme-switcher" data-theme-switcher type="checkbox" />
<label for="theme-switcher">
<span class="sr-only">theme switcher</span>
<span>
<!-- sun -->
<svg
class="absolute left-[4px] top-[4px] z-10 opacity-100 dark:opacity-0"
viewBox="0 0 56 56"
fill="#fff"
height="16"
width="16"
>
<path
d="M30 4.6c0-1-.9-2-2-2a2 2 0 0 0-2 2v5c0 1 .9 2 2 2s2-1 2-2Zm9.6 9a2 2 0 0 0 0 2.8c.8.8 2 .8 2.9 0L46 13a2 2 0 0 0 0-2.9 2 2 0 0 0-3 0Zm-26 2.8c.7.8 2 .8 2.8 0 .8-.7.8-2 0-2.9L13 10c-.7-.7-2-.8-2.9 0-.7.8-.7 2.1 0 3ZM28 16a12 12 0 0 0-12 12 12 12 0 0 0 12 12 12 12 0 0 0 12-12 12 12 0 0 0-12-12Zm23.3 14c1.1 0 2-.9 2-2s-.9-2-2-2h-4.9a2 2 0 0 0-2 2c0 1.1 1 2 2 2ZM4.7 26a2 2 0 0 0-2 2c0 1.1.9 2 2 2h4.9c1 0 2-.9 2-2s-1-2-2-2Zm37.8 13.6a2 2 0 0 0-3 0 2 2 0 0 0 0 2.9l3.6 3.5a2 2 0 0 0 2.9 0c.8-.8.8-2.1 0-3ZM10 43.1a2 2 0 0 0 0 2.9c.8.7 2.1.8 3 0l3.4-3.5c.8-.8.8-2.1 0-2.9-.8-.8-2-.8-2.9 0Zm20 3.4c0-1.1-.9-2-2-2a2 2 0 0 0-2 2v4.9c0 1 .9 2 2 2s2-1 2-2Z"
></path>
</svg>
<!-- moon -->
<svg
class="absolute left-[4px] top-[4px] z-10 opacity-0 dark:opacity-100"
viewBox="0 0 24 24"
fill="none"
height="16"
width="16"
>
<path
fill="#000"
fill-rule="evenodd"
clip-rule="evenodd"
d="M8.2 2.2c1-.4 2 .6 1.6 1.5-1 3-.4 6.4 1.8 8.7a8.4 8.4 0 0 0 8.7 1.8c1-.3 2 .5 1.5 1.5v.1a10.3 10.3 0 0 1-9.4 6.2A10.3 10.3 0 0 1 3.2 6.7c1-2 2.9-3.5 4.9-4.4Z"
></path>
</svg>
</span>
</label>
</div>
<div class={`theme-switcher ${className}`}>
<input id="theme-switcher" data-theme-switcher type="checkbox" />
<label for="theme-switcher">
<span class="sr-only">theme switcher</span>
<span>
<svg
class="absolute left-[4px] top-[4px] z-10 opacity-100 dark:opacity-0"
viewBox="0 0 56 56"
fill="#fff"
height="16"
width="16"
>
<path d="M30 4.6c0-1-.9-2-2-2a2 2 0 0 0-2 2v5c0 1 .9 2 2 2s2-1 2-2Zm9.6 9a2 2 0 0 0 0 2.8c.8.8 2 .8 2.9 0L46 13a2 2 0 0 0 0-2.9 2 2 0 0 0-3 0Zm-26 2.8c.7.8 2 .8 2.8 0 .8-.7.8-2 0-2.9L13 10c-.7-.7-2-.8-2.9 0-.7.8-.7 2.1 0 3ZM28 16a12 12 0 0 0-12 12 12 12 0 0 0 12 12 12 12 0 0 0 12-12 12 12 0 0 0-12-12Zm23.3 14c1.1 0 2-.9 2-2s-.9-2-2-2h-4.9a2 2 0 0 0-2 2c0 1.1 1 2 2 2ZM4.7 26a2 2 0 0 0-2 2c0 1.1.9 2 2 2h4.9c1 0 2-.9 2-2s-1-2-2-2Zm37.8 13.6a2 2 0 0 0-3 0 2 2 0 0 0 0 2.9l3.6 3.5a2 2 0 0 0 2.9 0c.8-.8.8-2.1 0-3ZM10 43.1a2 2 0 0 0 0 2.9c.8.7 2.1.8 3 0l3.4-3.5c.8-.8.8-2.1 0-2.9-.8-.8-2-.8-2.9 0Zm20 3.4c0-1.1-.9-2-2-2a2 2 0 0 0-2 2v4.9c0 1 .9 2 2 2s2-1 2-2Z" />
</svg>
<svg
class="absolute left-[4px] top-[4px] z-10 opacity-0 dark:opacity-100"
viewBox="0 0 24 24"
fill="none"
height="16"
width="16"
>
<path
fill="#000"
fill-rule="evenodd"
clip-rule="evenodd"
d="M8.2 2.2c1-.4 2 .6 1.6 1.5-1 3-.4 6.4 1.8 8.7a8.4 8.4 0 0 0 8.7 1.8c1-.3 2 .5 1.5 1.5v.1a10.3 10.3 0 0 1-9.4 6.2A10.3 10.3 0 0 1 3.2 6.7c1-2 2.9-3.5 4.9-4.4Z"
/>
</svg>
</span>
</label>
</div>
)
}
+1 -1
View File
@@ -3,7 +3,7 @@
{
process.env.NODE_ENV === "development" && (
<div class="fixed top-0 left-0 z-50 flex w-[30px] items-center justify-center bg-gray-200 py-[2.5px] text-[12px] uppercase text-black sm:bg-red-200 md:bg-yellow-200 lg:bg-green-200 xl:bg-blue-200 2xl:bg-pink-200">
<div class="fixed left-0 top-0 z-50 flex w-[30px] items-center justify-center bg-gray-200 py-[2.5px] text-[12px] uppercase text-black sm:bg-red-200 md:bg-yellow-200 lg:bg-green-200 xl:bg-blue-200 2xl:bg-pink-200">
<span class="block sm:hidden">all</span>
<span class="hidden sm:block md:hidden">sm</span>
<span class="hidden md:block lg:hidden">md</span>