Skip to content

Commit cf21c90

Browse files
authored
Merge pull request #122 from timlrx/v2
fix allCoreContent logic
2 parents d24a0b1 + 84899fa commit cf21c90

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

.changeset/afraid-queens-fold.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pliny': patch
3+
---
4+
5+
make algolia search input focus style more specific

.changeset/pre.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"pliny": "0.0.10"
77
},
88
"changesets": [
9+
"afraid-queens-fold",
910
"dry-dolphins-burn",
1011
"fuzzy-apples-judge",
1112
"giant-geckos-dress",
@@ -26,6 +27,7 @@
2627
"unlucky-keys-join",
2728
"weak-swans-heal",
2829
"wicked-maps-rest",
29-
"yellow-ligers-sort"
30+
"yellow-ligers-sort",
31+
"young-hats-lie"
3032
]
3133
}

.changeset/young-hats-lie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pliny': patch
3+
---
4+
5+
fix allCoreContent logic

packages/pliny/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# pliny
22

3+
## 0.1.0-beta.13
4+
5+
### Patch Changes
6+
7+
- 245b6d3: make algolia search input focus style more specific
8+
- 4ba59d6: fix allCoreContent logic
9+
310
## 0.1.0-beta.12
411

512
### Patch Changes

packages/pliny/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pliny",
33
"description": "Main entry point for pliny components",
44
"homepage": "https://github.com/timlrx/pliny",
5-
"version": "0.1.0-beta.12",
5+
"version": "0.1.0-beta.13",
66
"type": "module",
77
"exports": {
88
"./*": "./*",

packages/pliny/public/algolia.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,9 @@ svg.DocSearch-Hit-Select-Icon {
783783
}
784784

785785
.light .DocSearch-Input,
786-
.dark .DocSearch-Input {
786+
.dark .DocSearch-Input,
787+
.light .DocSearch-Input:focus,
788+
.dark .DocSearch-Input:focus {
787789
box-shadow: 0 0 #0000;
788790
background: transparent;
789791
}

packages/pliny/src/utils/contentlayer.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function dateSortDesc(a: string, b: string) {
2828
* @param {string} [dateKey='date']
2929
* @return {*}
3030
*/
31-
export function sortPosts(allBlogs: MDXDocumentDate[], dateKey: string = 'date') {
31+
export function sortPosts<T extends MDXDocumentDate>(allBlogs: T[], dateKey: string = 'date') {
3232
return allBlogs.sort((a, b) => dateSortDesc(a[dateKey], b[dateKey]))
3333
}
3434

@@ -106,8 +106,7 @@ export function coreContent<T extends MDXDocument>(content: T): CoreContent<T> {
106106
* @return {*} {CoreContent<T>[]}
107107
*/
108108
export function allCoreContent<T extends MDXDocument>(contents: T[]): CoreContent<T>[] {
109-
const coreContent = contents.map((c) => coreContent(c))
110109
if (isProduction)
111-
return coreContent.filter((c: CoreContent<T>) => !('draft' in c && c.draft === true))
112-
return coreContent
110+
return contents.map((c) => coreContent(c)).filter((c) => !('draft' in c && c.draft === true))
111+
return contents.map((c) => coreContent(c))
113112
}

0 commit comments

Comments
 (0)