reinit the project

Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
This commit is contained in:
nurRiyad
2023-01-05 22:16:03 +06:00
parent bb2c026901
commit e8b02f2414
38 changed files with 506 additions and 3417 deletions

View File

@@ -1,13 +0,0 @@
<script setup lang="ts">
definePageMeta({
layout: "blog",
});
</script>
<template>
<main
class="container mx-auto bg-white max-w-6xl p-6 min-h-screen prose prose-slate"
>
<ContentDoc />
</main>
</template>

View File

@@ -1,41 +0,0 @@
<script setup lang="ts">
definePageMeta({
layout: "list",
});
</script>
<template>
<div
class="container mx-auto max-w-6xl font-ibmmono antialiased min-h-screen"
>
<div class="flex gap-14">
<div class="m-2 rounded-lg object-cover">
<img
class="ring ring-blue-500 rounded-lg h-48"
src="@/assets/img/sdf.jpg"
alt="profile pic"
/>
</div>
<div class="basis-3/4 bg-white p-4 rounded-lg">
<div class="pb-3">
<h1 class="font-semibold text-xl">Md. AL Asad Nur Riyad</h1>
<h3 class="text-sm">Software Engineer @AppsCode</h3>
</div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Harum sint,
perspiciatis, tenetur commodi quasi doloremque magni minus hic itaque
in saepe a assumenda totam quidem suscipit impedit, aliquam earum
molestias.
</p>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Delectus
quibusdam tempore minus dignissimos nam sed ipsa eos odio numquam amet
hic similique quae rem repellat fugit perspiciatis excepturi quidem,
sequi obcaecati maiores laboriosam optio nostrum, modi eligendi?
Accusamus, quidem nobis!
</p>
</div>
</div>
</div>
</template>

View File

@@ -1,45 +0,0 @@
<script setup lang="ts">
import type { ParsedContent } from "@nuxt/content/dist/runtime/types";
definePageMeta({
layout: "list",
});
const data = useState("blogData");
// get all blog post
const getAllPost = computed(() => {
const allpost = (data.value as Array<ParsedContent>) || [];
const alltypes = allpost.map((post) => {
return {
title: post.title,
path: post._path,
date: post.date as string,
type: post.type,
};
});
alltypes.sort(function (a, b) {
const c = new Date(a.date);
const d = new Date(b.date);
return c < d ? 1 : -1;
});
return alltypes;
});
</script>
<template>
<div
class="container mx-auto max-w-6xl font-ibmmono antialiased min-h-screen"
>
<div>
<template v-for="pp in getAllPost" :key="pp">
<archiev-card
:title="pp.title"
:date="pp.date"
:path="pp.path"
:type="pp.type"
/>
</template>
</div>
</div>
</template>

View File

@@ -1,68 +0,0 @@
<script setup lang="ts">
import type { ParsedContent } from "@nuxt/content/dist/runtime/types";
const data = useState("blogData");
// get all the unique types from content
const getTopCategory = computed(() => {
const allpost = (data.value as Array<ParsedContent>) || [];
const alltypes = allpost.map((post) => {
return {
type: post.type,
dir: post._dir,
};
});
return [...new Map(alltypes.map((item) => [item["dir"], item])).values()];
});
// get all post in recent time order
const getRecentContent = computed(() => {
const allpost = (data.value as Array<ParsedContent>) || [];
const customizePost = allpost.map((post) => {
return {
title: post.title,
description: post.description,
path: post._path,
date: post.date as string,
type: post.type,
};
});
customizePost.sort(function (a, b) {
const c = new Date(a.date);
const d = new Date(b.date);
return c < d ? 1 : -1;
});
return customizePost.filter((post, idx) => idx < 6);
});
</script>
<template>
<div
class="container px-4 mx-auto max-w-6xl flex font-ibmmono gap-14 antialiased min-h-screen"
>
<div class="flex-1">
<h1 class="text-xl pb-8 text-[#e60067]">RECENTLY PUBLISHED</h1>
<div class="space-y-8">
<template v-for="rp in getRecentContent" :key="rp">
<blog-card
:title="rp.title"
:description="rp.description"
:path="rp.path"
:date="rp.date"
:type="rp.type"
/>
</template>
</div>
</div>
<div class="basis-1/4">
<div>
<h2 class="text-xl pb-8 text-[#e60067]">TOP CATEGORIES</h2>
<template v-for="cat in getTopCategory" :key="cat">
<topic-card :title="cat.type" :dir="cat.dir" />
</template>
</div>
</div>
</div>
</template>

View File

@@ -1,57 +0,0 @@
<script setup lang="ts">
import { ParsedContent } from "@nuxt/content/dist/runtime/types";
definePageMeta({
layout: "list",
});
const route = useRoute();
const routeType = computed(() => {
return route.params.topic || "";
});
const data = useState("blogData");
const getRecentContent = computed(() => {
const allpost = (data.value as Array<ParsedContent>) || [];
const modifedPost = allpost.map((post) => {
return {
title: post.title,
description: post.description,
path: post._path,
date: post.date as string,
author: post.author,
dir: post._dir,
};
});
const filteredPost = modifedPost.filter(
(post) => post.dir === routeType.value
);
filteredPost.sort(function (a, b) {
const c = new Date(a.date);
const d = new Date(b.date);
return c < d ? 1 : -1;
});
return filteredPost;
});
</script>
<template>
<div
class="container mx-auto max-w-6xl font-ibmmono antialiased min-h-[82vh]"
>
<div class="flex justify-between flex-wrap">
<template v-for="pp in getRecentContent" :key="pp">
<latest-blog-card
:title="pp.title"
:description="pp.description"
:date="pp.date"
:author="pp.author"
:path="pp.path"
/>
</template>
</div>
</div>
</template>

View File

@@ -1,39 +0,0 @@
<script setup lang="ts">
import { ParsedContent } from "@nuxt/content/dist/runtime/types";
definePageMeta({
layout: "list",
});
const data = useState("blogData");
const getTopCategory = computed(() => {
const allpost = (data.value as Array<ParsedContent>) || [];
const alltypes = allpost.map((post) => post.type);
const uniqType = new Set(alltypes);
const cobj = <Array<{ type: string; count: number; path: string }>>[];
uniqType.forEach((type) => {
const filterwithType = allpost.filter((post) => post.type === type);
const path = filterwithType[0]._path?.split("/").at(1);
cobj.push({
type: type,
count: filterwithType.length || 0,
path: path || "",
});
});
return cobj;
});
</script>
<template>
<div
class="container mx-auto max-w-6xl font-ibmmono antialiased min-h-[82vh]"
>
<div class="flex justify-start flex-wrap">
<template v-for="ct in getTopCategory" :key="ct">
<category-card :type="ct.type" :count="ct.count" :path="ct.path" />
</template>
</div>
</div>
</template>