Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Frontmatter support #10

Open
krry opened this issue Mar 17, 2021 · 5 comments
Open

Frontmatter support #10

krry opened this issue Mar 17, 2021 · 5 comments

Comments

@krry
Copy link

krry commented Mar 17, 2021

Hiya, and thank you for this template 😸

I'm wondering if it supports/parses frontmatter, or could. Foam now allows us to put tags and such in the frontmatter, which I have started to do as another dimension of interlinkage.

And when I display my notes that contain frontmatter with this template, I see the frontmatter printed as though it were a horizontal line ---, a <p>, then a <h2>. I don't understand why it is parsed this way.

Here is an illustration. This markdown:

---
title: Projects
tags: PARA, zettlekasten, commonplace
timestamp: 2021-03-08 12:03:43
layout: page
---

# Projects

Here we keep teleological endeavors, ones with an end in sight.

becomes this markup:

<hr/>
<p>title: Projects
--
  | tags: PARA, zettlekasten, commonplace
  | timestamp: 2021-03-08 12:03:43</p>
<h2>layout: page</h2>
<h1>Projects</h1>
<p>Here we keep teleological endeavors, ones with an end in sight.</p>

So far I have tried to adding the remark-frontmatter plugin in the next.config.js as you instruct, and in combination with the remark-parse-frontmatter plugin. These seem to have no effect.

I'm stumped. Have you gotten frontmatter parsing to work? Do you have any pointers?

Thanks again. It's so great to be able to use Next and Vercel to publish my second brain.

@yenly
Copy link
Owner

yenly commented Mar 19, 2021

Hi, @krry! The reason you're not able to add frontmatter is because of the way NextJS had set up their MDX support in /pages. The way to add frontmatter support is similar to the approach in the PR @zomars had sent. I've requested changes to the PR. It could be abandoned by the submitter. I plan to take the PR as a suggestion and work on issue #4 myself. My plate is full at the moment so I won't be able to get to it until next month.

@zomars
Copy link

zomars commented Mar 19, 2021

Definitely not abandoned but my plate is also kinda full this month.

@krry
Copy link
Author

krry commented Mar 19, 2021

Ah, thank you for this context! Continuing to attempt to solve this last night I also landed at next-mdx-remote for frontmatter support, and then ran into the nesting issue. I'll of course share any progress I make.

@zomars
Copy link

zomars commented Mar 19, 2021

I've updated my PR if you want to take a look @krry. You could modify the Layout and pass the frontmatter data from local mdx files.

@krry
Copy link
Author

krry commented Mar 21, 2021

Aw, rad @zomars, thanks. I have recycled a lot of your PR in my app at this point, checking out the latest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants