Skip to content
This repository was archived by the owner on Jun 4, 2022. It is now read-only.

post.categories.map is not a function #290

@qizhao-umbc

Description

@qizhao-umbc

ERROR /Users/zhaoqi/blog/themes/hueman/layout/page.ejs:1

1| <%- partial('common/article', { post: page }) %>

/Users/zhaoqi/blog/themes/hueman/layout/common/article.ejs:28
26|
27|

28| <%- partial('post/ld_json', { post: post }) %>
29|
30| <%- partial('comment/index') %>
31|

/Users/zhaoqi/blog/themes/hueman/layout/common/post/ld_json.ejs:12
10| "image": "<%- url_for(config.url + thumbnail(post)) %>",
11| <% if (post.tags) { %>"keywords": "<%- post.tags.map(t => t.name).join(' ') %>",<% } %>

12| <% if (post.categories) { %>"genre": "<%- post.categories.map(c => c.name).join(' ') %>",<% } %>
13| "datePublished": "<%- date(post.date, 'YYYY-MM-DD') %>",
14| "dateCreated": "<%- date(post.date, 'YYYY-MM-DD') %>",
15| <% if (post.updated) { %>"dateModified": "<%- date(post.updated, 'YYYY-MM-DD') %>",<% } %>

post.categories.map is not a function

Did anyone meet this problem? It doesn't affect the site but it's annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions