-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38cf8fc
commit 25f92a8
Showing
6 changed files
with
130 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"astro-loader-github-prs": minor | ||
--- | ||
|
||
Add `monthsBack` option to specify the recent months for loading pull requests | ||
Support returning the `<Content />` component via `render(entry)` to render the PR content | ||
Errors no longer force the entire Astro project to terminate | ||
No longer calls `store.clear()` internally |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "astro-loader-github-prs", | ||
"version": "1.0.2", | ||
"description": "Aatro loader for loading GitHub pull reuqests from a given search string.", | ||
"description": "Astro loader for loading GitHub pull requests with a search query.", | ||
"author": "Stephanie Lin <[email protected]>", | ||
"license": "MIT", | ||
"keywords": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Get the search query with `monthsBack`. | ||
*/ | ||
export function getQueryWithMonthsBack( | ||
search: string, | ||
monthsBack: number | undefined | ||
) { | ||
if (!search.includes('created') && monthsBack) { | ||
const startDate = new Date() | ||
startDate.setMonth(startDate.getMonth() - monthsBack + 1) | ||
startDate.setDate(1) | ||
|
||
return `${search} created:>=${startDate.toISOString().split('T')[0]}` | ||
} | ||
return search | ||
} |