Function "after" not defined use hugo-build

Get error for hugo-build in wercker . but work well in my computer.

My Hugo Code, detail see here

{{ $bp := after $nums $bookPages }}

Error Log:

export WERCKER_STEP_ROOT="/pipeline/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba"
export WERCKER_STEP_ID="hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba"
export WERCKER_STEP_OWNER="arjen"
export WERCKER_STEP_NAME="hugo-build"
export WERCKER_REPORT_NUMBERS_FILE="/report/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/numbers.ini"
export WERCKER_REPORT_MESSAGE_FILE="/report/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/message.txt"
export WERCKER_REPORT_ARTIFACTS_DIR="/report/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/artifacts"
export WERCKER_HUGO_BUILD_VERSION="0.15"
export WERCKER_HUGO_BUILD_FORCE_INSTALL="false"
export WERCKER_HUGO_BUILD_PROD_BRANCHES="master"
export WERCKER_HUGO_BUILD_DISABLE_PYGMENTS="false"
export WERCKER_HUGO_BUILD_CONFIG=""
export WERCKER_HUGO_BUILD_FLAGS=""
export WERCKER_HUGO_BUILD_DEV_FLAGS=""
export WERCKER_HUGO_BUILD_THEME=""
export WERCKER_HUGO_BUILD_DEV_BRANCHES=""
source "/pipeline/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/run.sh" < /dev/null
ERROR: 2016/02/25 template: partials/book/updowncharpter.html:8: function "after" not defined
ERROR: 2016/02/25 Error while rendering section book: reflect: call of reflect.Value.FieldByName on ptr Value

How can help me ? Thanks a lot!

@ArjenSchwarz, can you help with this?

@ysqi, sorry I didn’t see your question earlier. Looking at your source code you’ve fixed or worked around the problem now but did you discover what the issue was?

hi @ArjenSchwarz, I don’t fiexd and did’t use after in hugo-build . change code view here

Hi @ysqi, thanks for pointing out where you made the change. I’ll have a look to see where it breaks and hopefully fix it.

The after template func was released in Hugo 0.15. If that doesn’t exist it must mean that you are on <= Hugo 0.14.

Thanks @bep, that indeed turned out to be the case.

@ysqi, I looked at your wercker file and you are using the samueldebruyn/hugo-build docker container for the build. Looking at that container, it was only updated to use Hugo 0.15 5 days ago, so when you tried it it was still using 0.14 which as @bep points out doesn’t support after.

As Hugo is already installed on that box, the Wercker step doesn’t try to install the latest version, assuming that you want to use the already installed version. You can override that behaviour by adding force_install: true to your wercker.yml file.