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

All _meta files being run through the mustache engine #766

Closed
dnwhte opened this issue Jan 10, 2018 · 1 comment
Closed

All _meta files being run through the mustache engine #766

dnwhte opened this issue Jan 10, 2018 · 1 comment

Comments

@dnwhte
Copy link
Member

dnwhte commented Jan 10, 2018

All _meta files being run through the mustache engine.

The reason is that the meta patterns have incomplete data when being rendered in https://github.com/pattern-lab/patternlab-node/blob/dev/core/lib/object_factory.js#L105 (specifically the fileExtension in this case).

Logging out the meta _00-head.njk file at the top of the render function results in:

{
    relPath: '.',
    fileName: '.',
    subdir: '',
    fileExtension: '',
    name: '-.',
    jsonFileData: {},
    patternBaseName: '.',
    patternName: '.',
    patternGroup: '',
    patternType: '',
    patternSubGroup: '',
    patternSubType: '',
    flatPatternPath: '',
    patternLink: null,
    patternPartial: '-.',
    verbosePartial: '/.',
    isPattern: true,
    isFlatPattern: true,
    patternState: '',
    template: '',
    patternPartialCode: '',
    lineage: [],
    lineageIndex: [],
    lineageR: [],
    lineageRIndex: [],
    isPseudoPattern: false,
    order: 9007199254740991,
    engine: {
        engine: {
            name: 'mustache.js',
            version: '2.3.0',
            tags: [Array],
            clearCache: [Function: clearCache],
            parse: [Function: parse],
            render: [Function: render],
            to_html: [Function: to_html],
            escape: [Function: escapeHtml],
            Scanner: [Function: Scanner],
            Context: [Function: Context],
            Writer: [Function: Writer]
        },
        engineName: 'mustache',
        engineFileExtension: '.mustache',
        isAsync: true,
        expandPartials: true,
        findPartialsRE: /{{>\s*?([\w\-\.\/~]+)(?:\:[A-Za-z0-9-_|]+)?(?:(?:| )\(.*)?(?:\s*)?}}/g,
        findPartialsWithStyleModifiersRE: /{{>\s*([\w\-\.\/~]+)(?!\()(\:[\w\-\|]+)(\s*\([^\)]*\))?\s*}}/g,
        findPartialsWithPatternParametersRE: /{{>\s*([\w\-\.\/~]+)(\:[\w\-\|]+)?(\s*\([^\)]*\))\s*}}/g,
        findListItemsRE: /{{#\s*(list(I|i)tems\.)(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)\s*}}/g,
        findPartialRE: undefined,
        renderPattern: [Function: renderPattern],
        patternMatcher: [Function: patternMatcher],
        spawnFile: [Function: spawnFile],
        spawnMeta: [Function: spawnMeta],
        findPartials: [Function: findPartials],
        findPartialsWithStyleModifiers: [Function: findPartialsWithStyleModifiers],
        findPartialsWithPatternParameters: [Function: findPartialsWithPatternParameters],
        findListItems: [Function: findListItems],
        findPartial_new: [Function: findPartial_new],
        findPartial: [Function: findPartial],
        usePatternLabConfig: [Function: usePatternLabConfig]
    },
    compileState: null,
    lastModified: null,
    extendedTemplate: '<!DOCTYPE html>\r\n<html class="{{ htmlClass }}">\r\n  <head>\r\n    <title>{{ title }}</title>\r\n    <meta charset="UTF-8">\r\n    <meta name="viewport" content="width=device-width" />\r\n\r\n    <link rel="stylesheet" href="../../css/style.css?{{ cacheBuster }}" media="all" />\r\n    <link rel="stylesheet" href="../../css/pattern-scaffolding.css?{{ cacheBuster }}" media="all" />\r\n\r\n    <!-- Begin Pattern Lab (Required for Pattern Lab to run properly) -->\r\n    {{ patternLabHead | safe }}\r\n    {% raw %}{{ patternLabHead }}{% endraw %}\r\n    <!-- End Pattern Lab -->\r\n\r\n  </head>\r\n  <body class="{{ bodyClass }}">\r\n'
}

Note: processMetaPattern is generating the pattern correctly.

@bmuenzenmeyer bmuenzenmeyer added this to the 3.0.0 milestone Jan 10, 2018
@dnwhte
Copy link
Member Author

dnwhte commented Jan 12, 2018

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

No branches or pull requests

2 participants