Skip to content

Commit

Permalink
fix: delete dead props (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsdonato authored Jan 31, 2024
1 parent 72eb4c6 commit 0467c98
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 122 deletions.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "${1}"
2 changes: 0 additions & 2 deletions docs/ciberseguridad/streamers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,5 @@ submenu:
src: '/streamers/hack4u.jpg'
height: 80
width: 90
createdAt: '2024-01-29T00:00:00Z'
updatedAt: '2024-01-29T00:00:00Z'
videos: []
---
2 changes: 0 additions & 2 deletions docs/frontend/colors_palette.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ submenu:
src: '/frontend/uicolors.svg'
height: 80
width: 190
createdAt: '2024-01-25T00:00:00Z'
updatedAt: '2024-01-29T00:00:00Z'
videos: []

- imgPlaceholder: 'Cool Contrast'
Expand Down
4 changes: 1 addition & 3 deletions docs/frontend/components_library.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ submenu:
height: 80
width: 190
videos: []

- imgPlaceholder: 'Buttons ibelick'
titleCard: 'Buttons ibelick'
links:
Expand All @@ -194,7 +194,5 @@ submenu:
src: ''
height: 80
width: 190
createdAt: '2024-01-30T00:00:00Z'
updatedAt: '2024-01-30T00:00:00Z'
videos: []
---
12 changes: 0 additions & 12 deletions docs/frontend/icons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ submenu:
src: ''
height: 80
width: 190
createdAt: '2024-01-27T00:00:00Z'
updatedAt: '2024-01-27T00:00:00Z'
videos: []

- imgPlaceholder: svgl
Expand All @@ -117,8 +115,6 @@ submenu:
src: ''
height: 80
width: 190
createdAt: '2024-01-27T00:00:00Z'
updatedAt: '2024-01-27T00:00:00Z'
videos: []

- imgPlaceholder: yesicon
Expand All @@ -130,8 +126,6 @@ submenu:
src: ''
height: 80
width: 190
createdAt: '2024-01-27T00:00:00Z'
updatedAt: '2024-01-27T00:00:00Z'
videos: []

- imgPlaceholder: Remix Icon
Expand All @@ -143,8 +137,6 @@ submenu:
src: ''
height: 80
width: 190
createdAt: '2024-01-27T00:00:00Z'
updatedAt: '2024-01-27T00:00:00Z'
videos: []

- imgPlaceholder: MingCute Icon
Expand All @@ -156,8 +148,6 @@ submenu:
src: ''
height: 80
width: 190
createdAt: '2024-01-27T00:00:00Z'
updatedAt: '2024-01-27T00:00:00Z'
videos: []

- imgPlaceholder: Animated Icons
Expand All @@ -169,7 +159,5 @@ submenu:
src: ''
height: 80
width: 190
createdAt: '2024-01-27T00:00:00Z'
updatedAt: '2024-01-27T00:00:00Z'
videos: []
---
24 changes: 8 additions & 16 deletions docs/frontend/images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ submenu:
url: 'https://www.pexels.com/es-es/'
cover:
src: ''
height: 80
width: 190
createdAt: '2024-01-29T00:00:00Z'
updatedAt: '2024-01-29T00:00:00Z'
height: 80
width: 190
videos: []

- imgPlaceholder: 'Animated Backgrounds'
Expand All @@ -27,10 +25,8 @@ submenu:
url: 'https://animatedbackgrounds.me'
cover:
src: ''
height: 80
width: 190
createdAt: '2024-01-29T00:00:00Z'
updatedAt: '2024-01-29T00:00:00Z'
height: 80
width: 190
videos: []

- imgPlaceholder: 'Undraw'
Expand All @@ -40,10 +36,8 @@ submenu:
url: 'https://undraw.co'
cover:
src: ''
height: 80
width: 190
createdAt: '2024-01-29T00:00:00Z'
updatedAt: '2024-01-29T00:00:00Z'
height: 80
width: 190
videos: []

- imgPlaceholder: 'Humaaans'
Expand All @@ -53,9 +47,7 @@ submenu:
url: 'https://www.humaaans.com'
cover:
src: ''
height: 80
width: 190
createdAt: '2024-01-29T00:00:00Z'
updatedAt: '2024-01-29T00:00:00Z'
height: 80
width: 190
videos: []
---
2 changes: 0 additions & 2 deletions docs/frontend/streamers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ submenu:
src: '/streamers/carlosazaustre.png'
height: 80
width: 90
createdAt: '2024-01-30T00:00:00Z'
updatedAt: '2024-01-30T00:00:00Z'
videos: []

---
2 changes: 0 additions & 2 deletions docs/vscode/extensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ submenu:
src: ''
height: 40
width: 40
createdAt: '2024-01-14T00:00:00Z'
updatedAt: '2024-01-26T00:00:00Z'
links:
- type: 'Market'
url: 'https://marketplace.visualstudio.com/items?itemName=inu1255.easy-snippet'
Expand Down
35 changes: 0 additions & 35 deletions lib/date-utils.test.ts

This file was deleted.

19 changes: 0 additions & 19 deletions lib/date-utils.ts

This file was deleted.

12 changes: 0 additions & 12 deletions lib/file-utils.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import fs from 'fs/promises'
import path from 'path'

import { isToday, isUpdated } from './date-utils'

export const readFile = (localPath: string) => {
return fs.readFile(path.join(process.cwd(), localPath), 'utf8')
}

export const getCreationDate = async (localPath: string) => {
const stats = await fs.stat(path.join(process.cwd(), localPath + '.mdx'))
return isToday(stats.birthtime)
}

export const getUpdatedDate = async (localPath: string) => {
const stats = await fs.stat(path.join(process.cwd(), localPath + '.mdx'))
return isUpdated(stats.mtime)
}
18 changes: 1 addition & 17 deletions lib/mdx/get-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { z } from 'zod'

import { getCreationDate, getUpdatedDate } from '../file-utils'
import { getMdxData } from './mdx-utils'

export const schema = z.array(
Expand All @@ -10,8 +9,6 @@ export const schema = z.array(
z.object({
name: z.string(),
url: z.string(),
isCreated: z.optional(z.boolean()),
isUpdated: z.optional(z.boolean()),
})
),
})
Expand All @@ -22,21 +19,8 @@ export async function getMenu() {

const parsedData = schema.parse(mdxData.data)

const final = parsedData.map(menuItem => {
return {
name: menuItem.name,
items: menuItem.items.map(at => {
return {
...at,
isCreated: getCreationDate(at.url),
isUpdated: getUpdatedDate(at.url),
}
}),
}
})

return {
...mdxData,
data: final,
data: parsedData,
}
}

0 comments on commit 0467c98

Please sign in to comment.