Skip to content

Commit

Permalink
Merge pull request #122 from timlrx/v2
Browse files Browse the repository at this point in the history
fix allCoreContent logic
  • Loading branch information
timlrx authored Jul 25, 2023
2 parents d24a0b1 + 84899fa commit cf21c90
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-queens-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'pliny': patch
---

make algolia search input focus style more specific
4 changes: 3 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"pliny": "0.0.10"
},
"changesets": [
"afraid-queens-fold",
"dry-dolphins-burn",
"fuzzy-apples-judge",
"giant-geckos-dress",
Expand All @@ -26,6 +27,7 @@
"unlucky-keys-join",
"weak-swans-heal",
"wicked-maps-rest",
"yellow-ligers-sort"
"yellow-ligers-sort",
"young-hats-lie"
]
}
5 changes: 5 additions & 0 deletions .changeset/young-hats-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'pliny': patch
---

fix allCoreContent logic
7 changes: 7 additions & 0 deletions packages/pliny/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# pliny

## 0.1.0-beta.13

### Patch Changes

- 245b6d3: make algolia search input focus style more specific
- 4ba59d6: fix allCoreContent logic

## 0.1.0-beta.12

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pliny/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pliny",
"description": "Main entry point for pliny components",
"homepage": "https://github.com/timlrx/pliny",
"version": "0.1.0-beta.12",
"version": "0.1.0-beta.13",
"type": "module",
"exports": {
"./*": "./*",
Expand Down
4 changes: 3 additions & 1 deletion packages/pliny/public/algolia.css
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,9 @@ svg.DocSearch-Hit-Select-Icon {
}

.light .DocSearch-Input,
.dark .DocSearch-Input {
.dark .DocSearch-Input,
.light .DocSearch-Input:focus,
.dark .DocSearch-Input:focus {
box-shadow: 0 0 #0000;
background: transparent;
}
7 changes: 3 additions & 4 deletions packages/pliny/src/utils/contentlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function dateSortDesc(a: string, b: string) {
* @param {string} [dateKey='date']
* @return {*}
*/
export function sortPosts(allBlogs: MDXDocumentDate[], dateKey: string = 'date') {
export function sortPosts<T extends MDXDocumentDate>(allBlogs: T[], dateKey: string = 'date') {
return allBlogs.sort((a, b) => dateSortDesc(a[dateKey], b[dateKey]))
}

Expand Down Expand Up @@ -106,8 +106,7 @@ export function coreContent<T extends MDXDocument>(content: T): CoreContent<T> {
* @return {*} {CoreContent<T>[]}
*/
export function allCoreContent<T extends MDXDocument>(contents: T[]): CoreContent<T>[] {
const coreContent = contents.map((c) => coreContent(c))
if (isProduction)
return coreContent.filter((c: CoreContent<T>) => !('draft' in c && c.draft === true))
return coreContent
return contents.map((c) => coreContent(c)).filter((c) => !('draft' in c && c.draft === true))
return contents.map((c) => coreContent(c))
}

0 comments on commit cf21c90

Please sign in to comment.