Skip to content
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

feat(project): support front-matter with Editor #122

Merged
merged 6 commits into from
Mar 8, 2022
Merged

Conversation

smarroufin
Copy link
Contributor

Resolves #118

@smarroufin smarroufin requested review from benjamincanac, a team and Flosciante and removed request for a team March 7, 2022 15:02
@vercel
Copy link

vercel bot commented Mar 7, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nuxtlabs/nuxt-com/2otjy3BcPfAHzASHSZU9fUqJyyja
✅ Preview: https://nuxt-com-git-feat-118-nuxtlabs.vercel.app

Copy link
Contributor Author

WIP.

At this point we are waiting for jonschlinkert/gray-matter#132 to be merged.
We can make it work locally by reproducing the PR changes in our node_modules.

Also waiting for directives on the handling of the content changes.
Should we save everything in localstorage or not? If so, how do we map it properly in storage so we can switch between files? Do we copy the "cache" mechanism of Docus?

Copy link
Member

@smarroufin Why is this PR mandatory?

For file changes, for now you can make a function that will parse and concat the data to have it ready to be sent somewhere. We can assume that it won't be stored in localStorage but sent to the API.

Copy link
Contributor Author

Oops, yes it wasn't that obvious.
There is a crash when loading the /content page. Buffer is not defined.
Like this: https://stackoverflow.com/questions/60772266/getting-buffer-is-not-defined-when-using-gray-matter-in-angular/60772329#60772329

Ok for the preparation for sending data. I'll adjust my code and let it pending. We'll talk about it more tomorrow.

Copy link
Contributor Author

I made a workaround to have it working for know.

We have another issue, flat library does not support esm, so yarn build breaks. It does not seem to be moving since last year according to the repo issues: hughsk/flat#101
Do we want to aim for an alternative library, or is there a way to transpile it with some nitro/vite/whatever stuff?

Copy link
Member

You can try to add it in vite.optmizeDeps nuxt config:

vite: {
  optimizeDeps: {
    include: ['...']
  }
}

@benjamincanac benjamincanac merged commit a467601 into dev Mar 8, 2022
@benjamincanac benjamincanac deleted the feat/118 branch March 8, 2022 15:16
larbish pushed a commit that referenced this pull request Aug 18, 2022
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
danielroe pushed a commit that referenced this pull request Oct 18, 2023
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DocusEditor content ref should only be the content without front-matter
2 participants