Params error when using Gulp

I’m using gulp-hugo-seed to build and deploy my Hugo project to s3. I get the below error when attempting to build with Gulp. Thanks in advance.

$ gulp
[10:24:03] Using gulpfile ~/Documents/sitename/gulpfile.js
[10:24:03] Starting 'default'...
[10:24:03] Starting 'build:dev'...
[10:24:03] Starting 'clean'...
[10:24:04] Finished 'clean' after 857 ms
[10:24:04] Starting 'clean'...
[10:24:04] Finished 'clean' after 4.02 ms
[10:24:04] Starting 'hugo:dev'...
INFO: 2016/01/11 Using config file: /Users/username/documents/sitename/src/hugo/config.toml
INFO: 2016/01/11 syncing from src/hugo/static/ to build/hugo-tmp/
INFO: 2016/01/11 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
INFO: 2016/01/11 Alias "/post/page/1" translated to "post/page/1/index.html"
INFO: 2016/01/11 Alias "/draft/page/1" translated to "draft/page/1/index.html"
ERROR: 2016/01/11 Error while rendering page post/2015-11-12-econocom-job.md: template: post/single.html:36:32: executing "post/single.html" at <.Params.tags>: range can't iterate over sitename
events.js:141
throw er; // Unhandled 'error' event
^
Error: Command `hugo -v -D -F -d ../../build/hugo-tmp -s ./src/hugo -b http://localhost:4000/` failed with exit code 255

Hello @pixelchef,

I’m not an Gulp expert, but it seems that Hugo fails to render a template. Could you share the frontmatter of post/2015-11-12-econocom-job.md and an excerpt of your post/single.html template?

Around line 36 you seem to use the range keyword which doesn’t seem to handle the sitename variable from the frontmatter.

Sure, here is post/2015-11-12-econocom-job.md

---
quick: true
tags: tag1
date: 2015-11-12 01:00:00 -0800
---

Here is post/single.html

{{ partial "header.html" . }}
<body>
{{ partial "navbar.html" . }}
<div class="container">
    <div class="row">
        <div class="col-md-9">
            <div class="well well-sm">
                    <h3>{{ .Title }}<br> <small>{{ .Description }}</small></h3>
                    <hr>
                    {{ if isset .Params "image" }}
                    <div style="width: 100%; margin: 10px 10px;">
                        <div style="width: auto; margin: 0 auto;">
                            <img src="{{ .Params.image }}"  style="border: 1px solid #999999;" />
                        </div>
                    </div>
                    {{ end }}
                    <hr>
                    {{ .Content }}
            </div>
        </div>

        <!-- Sidebar -->
        <div class="col-md-3">
            <div class="well well-sm"> <!-- Post-specific stats -->
                <h4>{{ .Date.Format "January 2, 2006" }}<br>
                <small>{{ .WordCount }} words</small></h4>
                <hr>
                <strong>Categories</strong>
                <ul class="list-unstyled">
                {{ range .Params.categories }}
                    <li><a href="/categories/{{ . | urlize }}">{{ . }}</a></li>
                {{ end }}
                </ul>
                <hr>
                <strong>Tags</strong><br>
                {{ range .Params.tags }}<a class="label label-default" href="/tags/{{ . | urlize }}">{{ . }}</a> {{ end }}
            </div>
            {{ partial "menu.html" . }}
        </div>
    </div>
{{ partial "footer.copyright.html" . }}
</div>
{{ partial "footer.html" . }}

The problem is the formatting of the tags in the frontmatter. Your template expects and list (which is the case by default) and wants to ranger over all tags.

But you need to put you tag in sqaure brackets in order to define a list. Try the following syntaxes. You can define lists inline with

tags: [tag1, tag2]

or you put each tag in it’s own row by adding a hyphen in front of your tag:

tags:
 - tag1
 - tag2