LoginSignup
0
0

More than 5 years have passed since last update.

Hugoで新規記事を作成するときにエラー発生

Posted at

新規ポストを作成するためにhugo newを実行

$ hugo new post/newpost.md
ERROR 2017/05/13 14:15:04 Error processing archetype file /Users/d_ojima/Documents/hugotest/themes/sometheme/archetypes/default.md: Unable to Cast <nil> to map[string]interface{}
Error: Unable to Cast <nil> to map[string]interface{}

archetypeがなんちゃらとかで怒られる。

原因

/themes/<なにかしらのテーマ>/archetypesにarchetypeが定義されていないのが原因のようです。
今回使用していたテーマではarchetypeが定義されていませんでした...

本来は次のように投稿タイプごとのarchetypeが定義されている必要があります。

 archetypes
  ├── default.md
  ├── page.md
  └── post.md

解決方法

archetypeを定義すればオッケーです。
/themes/<なにかしらのテーマ>/archetypes以下にdefault.mdを作成しました。

default.md
date = ""
description = ""
tags = ["", ""]
title = ""

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0