| markdownify not working

So I have a yaml frontmatter parameter that is supposed to take markdown. However as soon as I’m trying to use the | markdownify function I get a Hugo formatting error. | plainify doesn’t work either.

I’ll need more information to help you with this:

  1. What’s the error on your terminal?
  2. What’s the template where this is being called?
  3. (Best option) Do you have a GH or other repo you can point me to?

It’s my own theme.

my frontmatter yaml is just very simple:

text: 'lorem ipsum'

my template looks like:

{{ .Params.text | markdownify }}

So yeah it’s as simple as it gets.
I can’t provide a public repo I’m sorry.
The terminal output is:

'hugo' errored after 46 ms
[16:24:08] Error: Hugo build failed
    at formatError (/home/test/test/node_modules/gulp/bin/gulp.js:169:10)

I can’t really tell you much more. I am using the Victor Hugo boilerplate. And I never had any issues such as these before. https://github.com/netlify/victor-hugo

@natorboy From what I can tell from the console error, this looks like a gulp-related issue. I know that Victor Hugo uses NPM scripts, web pack, and gulp so that you can get up and running from a single command (I’m not a fan of this), so your best bet is to submit this issue to the Victor Hugo repo directly. Netlify advertises Victor Hugo as a continually update starter kit dealie, and from my experience, their customer service is beyond top notch.

I’ve been running multiple sites on Hugo for a couple years now and never had an issue with params, even on the latest dev build.

HTH.

@rdwatters thanks for your help! I just now figured out that the issue was with the frontmatter in question being in an object. I had to do it like

{{ with .Params.testobject.text }}{{ . | markdownify }}{{ end }}

and now for some reason it works. I dont see why it wouldn’t work with

{{ .Params.testobject.text | markdownify }}

tough, but I am also quite new to the hugo templating.

My guess is that you have some files that don’t have testobject: in the front matter. It’s good that you’re using with to check for the existence of said front matter. :smile:

Does Hugo seriously check all the .md files for it’s existence? That’s cool. Thanks mate!

1 Like

I love Hugo and Netlify and Victor Hugo CMS but the compilation errors in Victor Hugo are a nightmare; a known nightmare at that. I was wondering if anyone can give any advice on my error and/or what I should be looking for?

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using npm@5.0.1 3 info using node@v6.10.3 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle victor-hugo@1.0.0~prestart: victor-hugo@1.0.0 6 silly lifecycle victor-hugo@1.0.0~prestart: no script for prestart, continuing 7 info lifecycle victor-hugo@1.0.0~start: victor-hugo@1.0.0 8 verbose lifecycle victor-hugo@1.0.0~start: unsafe-perm in lifecycle true 9 verbose lifecycle victor-hugo@1.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/life/local/stali/salvatoremalatesta.com.au/node_modules/.bin:/usr/local/heroku/bin:/Users/life/.rvm/gems/ruby-2.1.2/bin:/Users/life/.rvm/gems/ruby-2.1.2@global/bin:/Users/life/.rvm/rubies/ruby-2.1.2/bin:/Users/life/.rvm/bin:/Users/life/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin 10 verbose lifecycle victor-hugo@1.0.0~start: CWD: /Users/life/local/stali/salvatoremalatesta.com.au 11 silly lifecycle victor-hugo@1.0.0~start: Args: [ '-c', 'gulp server' ] 12 silly lifecycle victor-hugo@1.0.0~start: Returned: code: 1 signal: null 13 info lifecycle victor-hugo@1.0.0~start: Failed to exec start script 14 verbose stack Error: victor-hugo@1.0.0 start:gulp server14 verbose stack Exit status 1 14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:283:16) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at EventEmitter.emit (events.js:191:7) 14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at ChildProcess.emit (events.js:191:7) 14 verbose stack at maybeClose (internal/child_process.js:886:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 15 verbose pkgid victor-hugo@1.0.0 16 verbose cwd /Users/life/local/stali/salvatoremalatesta.com.au 17 verbose Darwin 16.6.0 18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 19 verbose node v6.10.3 20 verbose npm v5.0.1 21 error code ELIFECYCLE 22 error errno 1 23 error victor-hugo@1.0.0 start:gulp server23 error Exit status 1 24 error Failed at the victor-hugo@1.0.0 start script. 24 error This is probably not a problem with npm. There is likely additional logging output above. 25 verbose exit [ 1, true ]