Importing Markdown into markdown Template Literal
mattfelten opened this issue · 0 comments
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?