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

Importing Markdown into markdown Template Literal #475

Open
mattfelten opened this issue Jan 24, 2019 · 0 comments
Open

Importing Markdown into markdown Template Literal #475

mattfelten opened this issue Jan 24, 2019 · 0 comments

Comments

@mattfelten
Copy link
Contributor

So I'm trying to publish our CHANGELOG.md file as a page on our site. I'm using lerna-changelog to almost-automatically generate our changelogs on each release. The trouble is that it uses an :emoji: character instead of the actual unicode emoji character in the headings. GitHub parses these fine, but importing the markdown file straight into Catalog doesn't convert them.

No problem! I say. I could make a React page that imports the markdown file, runs a search and replace, and then display it within a markdown template literal. Easy.

The only issue is I can't figure out how to actually do that. I'm struggling to get the markdown imported. Ideas I've had that don't work:

  • Importing as module. import * as changelog from './CHANGELOG.md';
  • Straight const changelog = require('./CHANGELOG.md');
  • Using pageLoader. const changelog = pageLoader(() => import('./CHANGELOG.md'));

I'm worried that I might need to change something about the webpack config to support this, but I don't really know what I'd need to do. Any advice?

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

No branches or pull requests

1 participant