先日から再びHugoを使うようになり、orgファイルからHTMLを生成しているのですが、 hugo server を実行したときに警告文が表示されるようになり、気になったので調べてみたら、orgファイルに記載しているHugo向けIn-Buffer Settings風1の項目にブラケット付与をしてほしいとのことでした。
Hugoが出力した警告文はこちらです。
1
2
Please use '#+tags[]:' notation, automatic conversion is deprecated.
Please use '#+categories[]:' notation, automatic conversion is deprecated.
上記の理由からorgファイルを書き換えなくてはなりません。 automatic conversion is deprecated とありますから「手動でやってほしい」と依頼事項があります。
// Bad. Print warning while building.
#+title: HugoのorgファイルのIn-Buffer Settings風の項目にブラケット付与が必須になる件
#+tags: Hugo Org-mode
#+categories: example
#+aliases: example
// Good
#+title: HugoのorgファイルのIn-Buffer Settings風の項目にブラケット付与が必須になる件
#+tags[]: Hugo Org-mode
#+categories[]: example
#+aliases[]: example
// GetOption returns the value associated to the export option key// Currently supported options:// - < (export timestamps)// - e (export org entities)// - f (export footnotes)// - toc (export table of content. an int limits the included org headline lvl)// - todo (export headline todo status)// - pri (export headline priority)// - tags (export headline tags)// see https://orgmode.org/manual/Export-settings.html for more informationfunc (d*Document) GetOption(keystring) string {
get:=func(settingsmap[string]string) string {
for_, field:=rangestrings.Fields(settings["OPTIONS"]) {
ifstrings.HasPrefix(field, key+":") {
returnfield[len(key)+1:]
}
}
return"" }
value:=get(d.BufferSettings)
ifvalue=="" {
value = get(d.DefaultSettings)
}
ifvalue=="" {
value = "nil"d.Log.Printf("Missing value for export option %s", key)
}
returnvalue}