mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-16 23:41:21 +08:00
feat: disable to use the path as the category
This commit is contained in:
@ -7,6 +7,7 @@ const contentDir = path.join(__dirname, '../src/content/post')
|
||||
// full path, root path, parent path
|
||||
|
||||
const getCategoryMode = 'parent'
|
||||
const isGetCategoryFromPath = false
|
||||
|
||||
function toCamelCase(str) {
|
||||
return str
|
||||
@ -56,6 +57,11 @@ function getCategoryFromPath(filePath) {
|
||||
|
||||
function processFile(filePath) {
|
||||
const fileContent = fs.readFileSync(filePath, 'utf8')
|
||||
|
||||
if (!isGetCategoryFromPath) {
|
||||
return
|
||||
}
|
||||
|
||||
const category = getCategoryFromPath(filePath)
|
||||
|
||||
if (!category) {
|
||||
|
@ -1,17 +1,17 @@
|
||||
---
|
||||
import PageLayout from '../layouts/BaseLayout.astro'
|
||||
import Section from '../components/Section.astro'
|
||||
import Card from '../components/Card.astro'
|
||||
import ProjectCard from '../components/ProjectCard.astro'
|
||||
import Label from '../components/Label.astro'
|
||||
import SkillLayout from '../components/SkillLayout.astro'
|
||||
import PostPreview from '@/components/blog/PostPreview.astro'
|
||||
import { Image } from 'astro:assets'
|
||||
import kazootttAvatar from '../assets/kazoottt-avatar.jpeg'
|
||||
import Card from '../components/Card.astro'
|
||||
import Label from '../components/Label.astro'
|
||||
import ProjectCard from '../components/ProjectCard.astro'
|
||||
import Section from '../components/Section.astro'
|
||||
import SkillLayout from '../components/SkillLayout.astro'
|
||||
import PageLayout from '../layouts/BaseLayout.astro'
|
||||
|
||||
import GiscusComment from '@/components/GiscusComment'
|
||||
import { getAllPosts, sortMDByDate } from '@/utils'
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import GiscusComment from '@/components/GiscusComment'
|
||||
|
||||
const frontend = ['react(熟悉)', 'vue2(了解)', 'vtk.js(了解)', 'next.js', 'tailwindcss']
|
||||
const backend = ['nodejs(熟悉)', 'python(了解)', 'elysiajs', 'nextjs', 'cloudflare d1', 'prisma']
|
||||
@ -36,7 +36,7 @@ const directProjects = [
|
||||
|
||||
// Get projects from markdown
|
||||
const mdProjects = allPosts
|
||||
.filter((post) => post.data.category === '项目-已结项')
|
||||
.filter((post) => post.data.category === '项目')
|
||||
.sort((a, b) => {
|
||||
if (a.data.pinned && !b.data.pinned) return -1
|
||||
if (!a.data.pinned && b.data.pinned) return 1
|
||||
|
Reference in New Issue
Block a user