How to use the yaml-front-matter/dist/yamlFront.safeLoadFront function in yaml-front-matter

To help you get started, we’ve selected a few yaml-front-matter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magda-io / magda / magda-web-client / src / Components / Static / StaticPage.js View on Github external
render() {
        const title = this.props.page.title;
        const contentRaw = this.props.page.content;

        const content = safeLoadFront(contentRaw);
        const bodyContent = content.__content;

        const breadcrumb = [
            <li>
                <span>{title}</span>
            </li>
        ];

        const hasEditPermissions = this.props.hasEditPermissions;

        const save = field =&gt; {
            return newValue =&gt; {
                const { title, content } = this.props.page;
                const page = { title, content };
                page[field] = newValue;
                this.props.updateStaticPage(

yaml-front-matter

yaml front matter for JS. Parse yaml or JSON from the beginning of files.

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis