-
-
Notifications
You must be signed in to change notification settings - Fork 718
fix: fix csv file collections #3513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jasonzyt
wants to merge
12
commits into
nuxt:main
Choose a base branch
from
Jasonzyt:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f5e1d21
fix: fix csv & yaml config not passed to parser
Jasonzyt a268e33
fix: fix processCollectionItems for csv files
Jasonzyt 2bf3130
fix: fix typecheck & test
Jasonzyt c1cefd2
fix: parsedContent.body -> parsedContent.meta.body
Jasonzyt 7026484
Merge branch 'main' into Jasonzyt/main
farnabaz 422fee4
feat: csv collection
farnabaz 5e17767
test: update tests
farnabaz 0f6d610
Update source.ts
farnabaz d529a2c
fix: ignore header row
farnabaz f790439
docs: update csv docs
farnabaz f387fb2
Merge branch 'main' into Jasonzyt/main
farnabaz a21aa89
fix: csv parser for indexed CSVs
farnabaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,11 @@ | ||
name,email | ||
John Doe,[email protected] | ||
Jane Smith,[email protected] | ||
Bob Johnson,[email protected] | ||
Alice Brown,[email protected] | ||
Charlie Wilson,[email protected] | ||
Diana Lee,[email protected] | ||
Eve Davis,[email protected] | ||
Frank Miller,[email protected] | ||
Grace Taylor,[email protected] | ||
Henry Anderson,[email protected] |
This file contains hidden or 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,10 @@ | ||
<script setup lang="ts"> | ||
const { data } = await useAsyncData('tmp-content', () => queryCollection('org').all()) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<h1>People</h1> | ||
<pre>{{ data }}</pre> | ||
</div> | ||
</template> |
This file contains hidden or 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,10 @@ | ||
<script setup lang="ts"> | ||
const { data: tmpContent } = await useAsyncData('tmp-content', () => queryCollection('people').all()) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<h1>People</h1> | ||
<pre>{{ tmpContent }}</pre> | ||
</div> | ||
</template> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iβm not sure why you reverted this.
Since CSV files contain multiple rows, and each row should be treated as an independent ParsedContent, they require a special handling process. Each CSV file should not be processed as a single ParsedContent.
In contrast, formats like Markdown/JSON/YML contain only one ParsedContent per file, so they must be handled differently.
And the facts prove this point: after installing the latest package, errors occurred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSV and other formats must be handled seperately. Maybe we can find a better way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to do this, Content now has
defineCSVSource
which reads csv file and generate a document for each row