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

Markdown issues #61

Closed
lukebussey opened this issue May 22, 2017 · 5 comments
Closed

Markdown issues #61

lukebussey opened this issue May 22, 2017 · 5 comments

Comments

@lukebussey
Copy link

I've been using grunt-assemble@0.5.0 for a while now with the markdown helper, but since upgrading to 0.6.3 and following the instructions in the readme for fixing the markdown helpers, they are only working when the markdown content isn't passed in via a variable. E.g.

{{#markdown}}# heading{{/markdown}} - works
---
header: "# heading"
---
{{header}} - outputs "# header"
{{#markdown}}{{header}}{{/markdown}} - doesn't work

It seems what ever I try, I can't get markdown to work if the source is coming from a variable. The first example works, so clearly the helper code as specified in the readme is working.

Any thoughts on what's wrong?

@assemblebot
Copy link

@lukebussey Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

@doowb
Copy link
Member

doowb commented May 22, 2017

Hi @lukebussey, will you post your helpers.js file (from what's specified in the migration section) and your assemble config for the helpers.

This is probably either a configuration issue or a change in helper-markdown.

@lukebussey
Copy link
Author

Here you go:

Helper:

module.exports.register = function (Handlebars) {
  'use strict';

  Handlebars.registerHelper('markdown', require('helper-markdown')());
  Handlebars.registerHelper('md', require('helper-md').sync);
};

Gruntfile.js

// Generate pages
    assemble: {
      options: {
        root: '.tmp',
        layout: 'default',
        layoutext: '.hbs',
        layoutdir: '<%= config.app %>/layouts',
        assets: '<%= config.app %>',
        data: '<%= config.app %>/data/*.{json,yml}',
        partials: '<%= config.app %>/partials/{,*/}*.hbs',
        helpers: [
          '<%= config.app %>/helpers/*.js',
          'handlebars-inline'
        ],
        marked: {
          breaks: true
        }
      },
      pages: {
        options: {
          plugins: [
            'grunt-assemble-permalinks',
            'grunt-assemble-sitemap'
          ],
          sitemap: {
            dest: '.tmp',
            relativedest: '.tmp',
            robot: false
          },
          permalinks: {
            preset: 'pretty'
          }
        },
        files: [{
          expand: true,
          cwd: '<%= config.app %>/pages',
          dest: '.tmp',
          src: [
            '{,**/}*.{hbs,md}'
          ]
        }]
      }
    }

devDependencies:

  "devDependencies": {
    "autoprefixer": "^6.5.0",
    "babel-preset-es2015": "^6.18.0",
    "babelify": "^7.3.0",
    "grunt": "^1.0.1",
    "grunt-assemble": "^0.6.3",
    "grunt-assemble-permalinks": "^0.1.1",
    "grunt-assemble-sitemap": "^0.2.6",
    "grunt-browser-sync": "^2.1.3",
    "grunt-browserify": "^5.0.0",
    "grunt-bump": "^0.8.0",
    "grunt-concurrent": "^2.0.3",
    "grunt-contrib-clean": "^1.0.0",
    "grunt-contrib-concat": "^1.0.1",
    "grunt-contrib-copy": "^1.0.0",
    "grunt-contrib-cssmin": "^1.0.2",
    "grunt-contrib-htmlmin": "^2.0.0",
    "grunt-contrib-imagemin": "^1.0.0",
    "grunt-contrib-uglify": "^2.0.0",
    "grunt-contrib-watch": "^1.0.0",
    "grunt-critical": "0.2.1",
    "grunt-eslint": "^19.0.0",
    "grunt-fastly": "^0.2.0",
    "grunt-filerev": "^2.3.1",
    "grunt-google-cloud": "^1.0.2",
    "grunt-port-pick": "^1.5.1",
    "grunt-postcss": "^0.8.0",
    "grunt-sass": "^1.0.0",
    "grunt-svgmin": "^4.0.0",
    "grunt-text-replace": "^0.4.0",
    "grunt-usemin": "^3.0.0",
    "grunt-wait": "^0.1.0",
    "grunt-webfont": "^1.1.0",
    "handlebars-inline": "^1.0.0",
    "jit-grunt": "^0.10.0",
    "nightmare": "^2.9.1",
    "postcss-flexbugs-fixes": "^2.0.0",
    "postcss-uncss": "^0.14.0",
    "time-grunt": "^1.2.1",
    "uncss": "^0.14.1",
    "vo": "^4.0.2"
  }

@doowb
Copy link
Member

doowb commented May 22, 2017

Thanks. This is a bug in helper-markdown.
Will you open an issue there and link to it here?

@doowb
Copy link
Member

doowb commented May 23, 2017

Closing since this was fixed in helper-markdown.

@doowb doowb closed this as completed May 23, 2017
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

3 participants