カスタム出力形式
Hugo は、カレンダーイベント、電子書籍フォーマット、Google AMP、JSON 検索インデックスなど、複数のフォーマット、または任意のカスタムテキスト形式でコンテンツを出力できます。
このページでは、メディアタイプと出力形式を使用してサイトを適切に設定する方法と、カスタム出力用のテンプレートを作成する場所について説明します。
メディアタイプ
メディアタイプ (MIME タイプ および コンテンツタイプ とも呼ばれる) は、インターネット上で送信されるファイル形式とフォーマットコンテンツの 2 つの部分の識別子のことです。
以下は、Hugo の組み込みメディアタイプの完全なセットです。
| type | suffixes |
|---|---|
| application/javascript | [js jsm mjs] |
| application/json | [json] |
| application/manifest+json | [webmanifest] |
| application/octet-stream | [] |
| application/pdf | [pdf] |
| application/rss+xml | [xml rss] |
| application/toml | [toml] |
| application/typescript | [ts] |
| application/xml | [xml] |
| application/yaml | [yaml yml] |
| font/otf | [otf] |
| font/ttf | [ttf] |
| image/bmp | [bmp] |
| image/gif | [gif] |
| image/jpeg | [jpg jpeg jpe jif jfif] |
| image/png | [png] |
| image/svg+xml | [svg] |
| image/webp | [webp] |
| text/calendar | [ics] |
| text/css | [css] |
| text/csv | [csv] |
| text/html | [html] |
| text/jsx | [jsx] |
| text/markdown | [md markdown] |
| text/plain | [txt] |
| text/tsx | [tsx] |
| text/x-sass | [sass] |
| text/x-scss | [scss] |
| video/3gpp | [3gpp 3gp] |
| video/mp4 | [mp4] |
| video/mpeg | [mpg mpeg] |
| video/ogg | [ogv] |
| video/webm | [webm] |
| video/x-msvideo | [avi] |
注意:
- カスタムのメディアタイプを追加したり、デフォルトを変更したりできます。たとえば、
text/htmlのサフィックスをaspに変更したい場合などです。 Suffixesは、Hugo でそのメディアタイプの URL とファイル名に使用される値です。Typeは、新しい/カスタムのOutput Formatsを定義するときに使用する必要がある識別子です (以下を参照)。- メディアタイプの完全なセットは、Hugo の組み込み開発サーバーに登録され、ブラウザで確実に認識されます。
メディアタイプを追加または変更するには、[サイト設定][config] の mediaTypes セクションで、すべてのサイトまたは特定の言語に対して定義します。
上記の例では、新しいメディアタイプ text/enriched をひとつ追加し、組み込みのメディアタイプ text/html のサフィックスを変更しています。
注意: これらのメディアタイプは 出力形式 用に設定されています。Hugo のデフォルトの出力形式 (たとえば HTML) の一つを再定義したい場合、メディアタイプも再定義する必要があります。つまり、HTML 出力形式のサフィックスを html (デフォルト) から htm に変更したい場合は、メディアタイプを再定義する必要があります。
注意 上記を機能させるには、サイト設定に outputs 定義も追加する必要があります。
出力形式の定義
メディアタイプといくつかの追加設定により、出力形式 が得られます。
以下は、Hugo の組み込み出力形式の完全なセットです。
| name | mediaType | path | baseName | rel | protocol | isPlainText | isHTML | noUgly | permalinkable |
|---|---|---|---|---|---|---|---|---|---|
| HTML | text/html | index | canonical | false | true | false | true | ||
| AMP | text/html | amp | index | amphtml | false | true | false | true | |
| CSS | text/css | styles | stylesheet | true | false | false | false | ||
| CSV | text/csv | index | alternate | true | false | false | false | ||
| Calendar | text/calendar | index | alternate | webcal:// | true | false | false | false | |
| JSON | application/json | index | alternate | true | false | false | false | ||
| MARKDOWN | text/markdown | index | alternate | true | false | false | false | ||
| ROBOTS | text/plain | robots | alternate | true | false | false | false | ||
| RSS | application/rss+xml | index | alternate | false | false | true | false | ||
| Sitemap | application/xml | sitemap | sitemap | false | false | true | false | ||
| WebAppManifest | application/manifest+json | manifest | manifest | true | false | false | false |
- 1 つのページを好きなだけ多くの出力形式で出力することができ、 それらがファイルシステム上の一意なパスに解決される限り、無限に出力形式を定義できます。上の表では、
AMPとHTMLの比較というのが最も良い例です。AMPはPathの値がampであるため、HTMLバージョンを上書きしません。たとえば、/index.htmlと/amp/index.htmlの両方を定義することができます。 MediaTypeは、既に定義されているメディアタイプのTypeと一致する必要があります。- 新しい出力形式を定義したり、組み込みの出力形式を再定義したりできます。 たとえば、
AMPページを別のパスに配置したい場合です。
出力形式を追加または変更するには、サイトの 設定ファイル
の outputFormats セクションで、すべてのサイトまたは特定の言語に対して定義します。
上記の例は架空のものですが、baseURL が https://example.org を持つサイトのホームページに使用すると、URL が bep://example.org/myindex.enr のプレーンテキストのホームページが生成されます。
出力形式を設定する
以下は、出力形式の設定オプションとそのデフォルト値の完全なリストです。
name- 出力形式の識別子です。これは、ページに必要な出力形式を定義するために使用されます。
mediaType- これは、定義されたメディアタイプの
Typeと一致する必要があります。 path- 出力ファイルを保存するサブパスです。
baseName- リストファイル名 (ホームページなど) のベースファイル名です。 デフォルト:
index rellinkタグでrel値を作成するために使用できます。 デフォルト:alternateprotocol- この出力形式に対して、
baseURL内の “http://” または “https://” を置き換えます。 isPlainText- テンプレートに、Go のプレーンテキスト テンプレートパーサーを使用します。 デフォルト:
false isHTMLHTMLタイプの形式にのみ関連する状況、たとえば、ページのエイリアスなど、で使用されます。 デフォルト:false.noUgly- サイトで
uglyURLsがtrueに設定されている場合、アグリー URL をオフにするために使用されます。 デフォルト:false. notAlternativePageのAlternativeOutputFormats形式リストにこの形式を含めることが意味をなさない場合 (たとえば、CSSを使用) に有効にします。 必ずしも他の形式を置き換えるとは限らないため、ここでは alternate ではなく alternative という用語を使用することに注意してください。 デフォルト:false.permalinkable.Permalinkと.RelPermalinkがメインではなく、レンダリングの出力形式を返すようになりました (下記参照 )。これは、HTMLとAMPに対してデフォルトで有効になっています。 デフォルト:false.weight- これをゼロ以外の値に設定すると、最初のソート基準として使用されます。
ページの出力形式
Hugo の Page は、ファイルシステム上で複数の 出力形式 にレンダリングできます。
デフォルトの出力形式
すべての Page には Kind
属性があり、それに基づいてデフォルトの出力形式が設定されます。
| 種類 (Kind) | デフォルトの出力形式 |
|---|---|
page |
HTML |
home |
HTML、RSS |
section |
HTML、RSS |
taxonomy |
HTML、RSS |
term |
HTML、RSS |
出力形式をカスタマイズする
これは outputs という出力形式のリストを Page のフロントマターまたはサイト設定 (すべてのサイトか言語ごとのいずれか) で定義することで変更できます。
サイト設定ファイルの例:
上記の例では、 section、taxonomy、term の 出力形式 は、デフォルトの値 ["HTML", "RSS"] のままであることに注意してください。
| Kind | 説明 | 例 |
|---|---|---|
home |
ホームページのランディングページ | /index.html |
page |
指定されたページのランディングページ | my-post ページ (/posts/my-post/index.html) |
section |
指定されたセクションのランディングページ | posts セクション (/posts/index.html) |
taxonomy |
タクソノミーのランディングページ | tags タクソノミー (/tags/index.html) |
term |
あるタクソノミーの用語のランディングページ | tags タクソノミーの用語 awesome (/tags/awesome/index.html) |
outputsの定義は、PageKind(page、home、section、taxonomy、またはterm) ごとに行われます。- 使用される名前 (たとえば、
HTML、AMP) は、定義された 出力形式 のNameと一致する必要があります。- これらの名前は、大文字と小文字が区別しません。
- これらは、コンテンツファイルのフロントマターで
Pageごとにオーバーライドできます。
以下は、レンダリングされた Page の出力形式を定義するコンテンツファイルの YAML フロントマターの例です。
出力形式を一覧表示する
それぞれの Page には .OutputFormats (現在のものを含むすべての形式) と .AlternativeOutputFormats 変数の両方があり、後者はサイトの <head> で link rel リストを作成するのに役立ちます。
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}}
出力形式にリンクする
Page の .Permalink と .RelPermalink は、そのページに定義された最初の出力形式 (他に何も定義されていない場合は、通常は HTML) を返します。 これは、呼び出し元のテンプレートファイルに関係ありません。
single.json.json から:
{{ .RelPermalink }} > /that-page/
{{ with .OutputFormats.Get "json" -}}
{{ .RelPermalink }} > /that-page/index.json
{{- end }}
現在のテンプレートファイルの出力形式を返すようにするには、指定された出力形式の permalinkable 設定を true にする必要があります。
以下は、上記と同じテンプレートファイルで、json 出力形式の permalinkable が true に設定されています。
{{ .RelPermalink }} > /that-page/index.json
{{ with .OutputFormats.Get "html" -}}
{{ .RelPermalink }} > /that-page/
{{- end }}
コンテンツファイルからは、ref または relref ショートコード
を使用できます。
[Neat]({{< ref "blog/neat.md" "amp" >}})
[Who]({{< relref "about.md#who" "amp" >}})
出力形式を指定するテンプレート
新しい出力形式には、有用なものをレンダリングするために、対応するテンプレートが必要です。
Page のレンダリングに使用するテンプレートを選択する際に、出力形式の Name と MediaType の Suffixes を参照することです。
下の表は、さまざまな出力形式の例と、使用されるサフィックス、および Hugo のそれぞれのテンプレートの 検索順序 を示しています。表のすべての例は、以下のことができます。
| Example | OutputFormat | Suffix | Template Lookup Order |
|---|---|---|---|
| "posts" セクションのシングルページ | HTML | html | [layouts/posts/single.html.html layouts/posts/single.html layouts/_default/single.html.html layouts/_default/single.html] |
| "posts" セクションのシングルページのベーステンプレート | HTML | html | [layouts/posts/single-baseof.html.html layouts/posts/baseof.html.html layouts/posts/single-baseof.html layouts/posts/baseof.html layouts/_default/single-baseof.html.html layouts/_default/baseof.html.html layouts/_default/single-baseof.html layouts/_default/baseof.html] |
| レイアウトが設定された "posts" セクションのシングルページ | HTML | html | [layouts/posts/demolayout.html.html layouts/posts/single.html.html layouts/posts/demolayout.html layouts/posts/single.html layouts/_default/demolayout.html.html layouts/_default/single.html.html layouts/_default/demolayout.html layouts/_default/single.html] |
| レイアウトが設定された "posts" セクションのシングルページのベーステンプレート | HTML | html | [layouts/posts/demolayout-baseof.html.html layouts/posts/single-baseof.html.html layouts/posts/baseof.html.html layouts/posts/demolayout-baseof.html layouts/posts/single-baseof.html layouts/posts/baseof.html layouts/_default/demolayout-baseof.html.html layouts/_default/single-baseof.html.html layouts/_default/baseof.html.html layouts/_default/demolayout-baseof.html layouts/_default/single-baseof.html layouts/_default/baseof.html] |
| AMP シングルページ | AMP | html | [layouts/posts/single.amp.html layouts/posts/single.html layouts/_default/single.amp.html layouts/_default/single.html] |
| フランス語の AMP シングルページ | AMP | html | [layouts/posts/single.fr.amp.html layouts/posts/single.amp.html layouts/posts/single.fr.html layouts/posts/single.html layouts/_default/single.fr.amp.html layouts/_default/single.amp.html layouts/_default/single.fr.html layouts/_default/single.html] |
| ホームページ | HTML | html | [layouts/index.html.html layouts/home.html.html layouts/list.html.html layouts/index.html layouts/home.html layouts/list.html layouts/_default/index.html.html layouts/_default/home.html.html layouts/_default/list.html.html layouts/_default/index.html layouts/_default/home.html layouts/_default/list.html] |
| ホームページのベーステンプレート | HTML | html | [layouts/index-baseof.html.html layouts/home-baseof.html.html layouts/list-baseof.html.html layouts/baseof.html.html layouts/index-baseof.html layouts/home-baseof.html layouts/list-baseof.html layouts/baseof.html layouts/_default/index-baseof.html.html layouts/_default/home-baseof.html.html layouts/_default/list-baseof.html.html layouts/_default/baseof.html.html layouts/_default/index-baseof.html layouts/_default/home-baseof.html layouts/_default/list-baseof.html layouts/_default/baseof.html] |
| タイプが設定されたホームページ | HTML | html | [layouts/demotype/index.html.html layouts/demotype/home.html.html layouts/demotype/list.html.html layouts/demotype/index.html layouts/demotype/home.html layouts/demotype/list.html layouts/index.html.html layouts/home.html.html layouts/list.html.html layouts/index.html layouts/home.html layouts/list.html layouts/_default/index.html.html layouts/_default/home.html.html layouts/_default/list.html.html layouts/_default/index.html layouts/_default/home.html layouts/_default/list.html] |
| タイプが設定されたホームページのベーステンプレート | HTML | html | [layouts/demotype/index-baseof.html.html layouts/demotype/home-baseof.html.html layouts/demotype/list-baseof.html.html layouts/demotype/baseof.html.html layouts/demotype/index-baseof.html layouts/demotype/home-baseof.html layouts/demotype/list-baseof.html layouts/demotype/baseof.html layouts/index-baseof.html.html layouts/home-baseof.html.html layouts/list-baseof.html.html layouts/baseof.html.html layouts/index-baseof.html layouts/home-baseof.html layouts/list-baseof.html layouts/baseof.html layouts/_default/index-baseof.html.html layouts/_default/home-baseof.html.html layouts/_default/list-baseof.html.html layouts/_default/baseof.html.html layouts/_default/index-baseof.html layouts/_default/home-baseof.html layouts/_default/list-baseof.html layouts/_default/baseof.html] |
| レイアウトが設定されたホームページ | HTML | html | [layouts/demolayout.html.html layouts/index.html.html layouts/home.html.html layouts/list.html.html layouts/demolayout.html layouts/index.html layouts/home.html layouts/list.html layouts/_default/demolayout.html.html layouts/_default/index.html.html layouts/_default/home.html.html layouts/_default/list.html.html layouts/_default/demolayout.html layouts/_default/index.html layouts/_default/home.html layouts/_default/list.html] |
| フランス語の AMP ホームページ | AMP | html | [layouts/index.fr.amp.html layouts/home.fr.amp.html layouts/list.fr.amp.html layouts/index.amp.html layouts/home.amp.html layouts/list.amp.html layouts/index.fr.html layouts/home.fr.html layouts/list.fr.html layouts/index.html layouts/home.html layouts/list.html layouts/_default/index.fr.amp.html layouts/_default/home.fr.amp.html layouts/_default/list.fr.amp.html layouts/_default/index.amp.html layouts/_default/home.amp.html layouts/_default/list.amp.html layouts/_default/index.fr.html layouts/_default/home.fr.html layouts/_default/list.fr.html layouts/_default/index.html layouts/_default/home.html layouts/_default/list.html] |
| JSON ホーム | JSON | json | [layouts/index.json.json layouts/home.json.json layouts/list.json.json layouts/index.json layouts/home.json layouts/list.json layouts/_default/index.json.json layouts/_default/home.json.json layouts/_default/list.json.json layouts/_default/index.json layouts/_default/home.json layouts/_default/list.json] |
| RSS ホーム | RSS | xml | [layouts/index.rss.xml layouts/home.rss.xml layouts/rss.xml layouts/list.rss.xml layouts/index.xml layouts/home.xml layouts/list.xml layouts/_default/index.rss.xml layouts/_default/home.rss.xml layouts/_default/rss.xml layouts/_default/list.rss.xml layouts/_default/index.xml layouts/_default/home.xml layouts/_default/list.xml layouts/_internal/_default/rss.xml] |
| RSS セクションの投稿 | RSS | xml | [layouts/posts/section.rss.xml layouts/posts/rss.xml layouts/posts/list.rss.xml layouts/posts/section.xml layouts/posts/list.xml layouts/section/section.rss.xml layouts/section/rss.xml layouts/section/list.rss.xml layouts/section/section.xml layouts/section/list.xml layouts/_default/section.rss.xml layouts/_default/rss.xml layouts/_default/list.rss.xml layouts/_default/section.xml layouts/_default/list.xml layouts/_internal/_default/rss.xml] |
| カテゴリーのタクソノミー | RSS | xml | [layouts/categories/category.terms.rss.xml layouts/categories/terms.rss.xml layouts/categories/taxonomy.rss.xml layouts/categories/rss.xml layouts/categories/list.rss.xml layouts/categories/category.terms.xml layouts/categories/terms.xml layouts/categories/taxonomy.xml layouts/categories/list.xml layouts/category/category.terms.rss.xml layouts/category/terms.rss.xml layouts/category/taxonomy.rss.xml layouts/category/rss.xml layouts/category/list.rss.xml layouts/category/category.terms.xml layouts/category/terms.xml layouts/category/taxonomy.xml layouts/category/list.xml layouts/taxonomy/category.terms.rss.xml layouts/taxonomy/terms.rss.xml layouts/taxonomy/taxonomy.rss.xml layouts/taxonomy/rss.xml layouts/taxonomy/list.rss.xml layouts/taxonomy/category.terms.xml layouts/taxonomy/terms.xml layouts/taxonomy/taxonomy.xml layouts/taxonomy/list.xml layouts/_default/category.terms.rss.xml layouts/_default/terms.rss.xml layouts/_default/taxonomy.rss.xml layouts/_default/rss.xml layouts/_default/list.rss.xml layouts/_default/category.terms.xml layouts/_default/terms.xml layouts/_default/taxonomy.xml layouts/_default/list.xml layouts/_internal/_default/rss.xml] |
| カテゴリーの用語 | RSS | xml | [layouts/categories/term.rss.xml layouts/categories/category.rss.xml layouts/categories/taxonomy.rss.xml layouts/categories/rss.xml layouts/categories/list.rss.xml layouts/categories/term.xml layouts/categories/category.xml layouts/categories/taxonomy.xml layouts/categories/list.xml layouts/term/term.rss.xml layouts/term/category.rss.xml layouts/term/taxonomy.rss.xml layouts/term/rss.xml layouts/term/list.rss.xml layouts/term/term.xml layouts/term/category.xml layouts/term/taxonomy.xml layouts/term/list.xml layouts/taxonomy/term.rss.xml layouts/taxonomy/category.rss.xml layouts/taxonomy/taxonomy.rss.xml layouts/taxonomy/rss.xml layouts/taxonomy/list.rss.xml layouts/taxonomy/term.xml layouts/taxonomy/category.xml layouts/taxonomy/taxonomy.xml layouts/taxonomy/list.xml layouts/category/term.rss.xml layouts/category/category.rss.xml layouts/category/taxonomy.rss.xml layouts/category/rss.xml layouts/category/list.rss.xml layouts/category/term.xml layouts/category/category.xml layouts/category/taxonomy.xml layouts/category/list.xml layouts/_default/term.rss.xml layouts/_default/category.rss.xml layouts/_default/taxonomy.rss.xml layouts/_default/rss.xml layouts/_default/list.rss.xml layouts/_default/term.xml layouts/_default/category.xml layouts/_default/taxonomy.xml layouts/_default/list.xml layouts/_internal/_default/rss.xml] |
| "posts" セクションのセクションリスト | HTML | html | [layouts/posts/posts.html.html layouts/posts/section.html.html layouts/posts/list.html.html layouts/posts/posts.html layouts/posts/section.html layouts/posts/list.html layouts/section/posts.html.html layouts/section/section.html.html layouts/section/list.html.html layouts/section/posts.html layouts/section/section.html layouts/section/list.html layouts/_default/posts.html.html layouts/_default/section.html.html layouts/_default/list.html.html layouts/_default/posts.html layouts/_default/section.html layouts/_default/list.html] |
| タイプが "blog" に設定された "posts" セクションのセクションリスト | HTML | html | [layouts/blog/posts.html.html layouts/blog/section.html.html layouts/blog/list.html.html layouts/blog/posts.html layouts/blog/section.html layouts/blog/list.html layouts/posts/posts.html.html layouts/posts/section.html.html layouts/posts/list.html.html layouts/posts/posts.html layouts/posts/section.html layouts/posts/list.html layouts/section/posts.html.html layouts/section/section.html.html layouts/section/list.html.html layouts/section/posts.html layouts/section/section.html layouts/section/list.html layouts/_default/posts.html.html layouts/_default/section.html.html layouts/_default/list.html.html layouts/_default/posts.html layouts/_default/section.html layouts/_default/list.html] |
| レイアウトが "demoLayout" に設定された "posts" セクションのセクションリスト | HTML | html | [layouts/posts/demolayout.html.html layouts/posts/posts.html.html layouts/posts/section.html.html layouts/posts/list.html.html layouts/posts/demolayout.html layouts/posts/posts.html layouts/posts/section.html layouts/posts/list.html layouts/section/demolayout.html.html layouts/section/posts.html.html layouts/section/section.html.html layouts/section/list.html.html layouts/section/demolayout.html layouts/section/posts.html layouts/section/section.html layouts/section/list.html layouts/_default/demolayout.html.html layouts/_default/posts.html.html layouts/_default/section.html.html layouts/_default/list.html.html layouts/_default/demolayout.html layouts/_default/posts.html layouts/_default/section.html layouts/_default/list.html] |
| カテゴリーのタクソノミーリスト | HTML | html | [layouts/categories/category.terms.html.html layouts/categories/terms.html.html layouts/categories/taxonomy.html.html layouts/categories/list.html.html layouts/categories/category.terms.html layouts/categories/terms.html layouts/categories/taxonomy.html layouts/categories/list.html layouts/category/category.terms.html.html layouts/category/terms.html.html layouts/category/taxonomy.html.html layouts/category/list.html.html layouts/category/category.terms.html layouts/category/terms.html layouts/category/taxonomy.html layouts/category/list.html layouts/taxonomy/category.terms.html.html layouts/taxonomy/terms.html.html layouts/taxonomy/taxonomy.html.html layouts/taxonomy/list.html.html layouts/taxonomy/category.terms.html layouts/taxonomy/terms.html layouts/taxonomy/taxonomy.html layouts/taxonomy/list.html layouts/_default/category.terms.html.html layouts/_default/terms.html.html layouts/_default/taxonomy.html.html layouts/_default/list.html.html layouts/_default/category.terms.html layouts/_default/terms.html layouts/_default/taxonomy.html layouts/_default/list.html] |
| カテゴリーのタクソノミー用語 | HTML | html | [layouts/categories/term.html.html layouts/categories/category.html.html layouts/categories/taxonomy.html.html layouts/categories/list.html.html layouts/categories/term.html layouts/categories/category.html layouts/categories/taxonomy.html layouts/categories/list.html layouts/term/term.html.html layouts/term/category.html.html layouts/term/taxonomy.html.html layouts/term/list.html.html layouts/term/term.html layouts/term/category.html layouts/term/taxonomy.html layouts/term/list.html layouts/taxonomy/term.html.html layouts/taxonomy/category.html.html layouts/taxonomy/taxonomy.html.html layouts/taxonomy/list.html.html layouts/taxonomy/term.html layouts/taxonomy/category.html layouts/taxonomy/taxonomy.html layouts/taxonomy/list.html layouts/category/term.html.html layouts/category/category.html.html layouts/category/taxonomy.html.html layouts/category/list.html.html layouts/category/term.html layouts/category/category.html layouts/category/taxonomy.html layouts/category/list.html layouts/_default/term.html.html layouts/_default/category.html.html layouts/_default/taxonomy.html.html layouts/_default/list.html.html layouts/_default/term.html layouts/_default/category.html layouts/_default/taxonomy.html layouts/_default/list.html] |
Hugo は、可能であれば、パーシャルのメディアタイプと出力形式も検出し、その情報を使用して、パーシャルをプレーンテキスト テンプレートとして解析するかどうかを決定します。
Hugo は指定された名前を探すので、好きな名前を付けることができます。 ただし、プレーンテキストとして扱いたい場合は、ファイルのサフィックスと、必要であれば出力形式の名前を使用する必要があります。 パターンは、以下のとおりです。
[partial name].[OutputFormat].[suffix]
以下のパーシャルはプレーンテキストのテンプレートです (出力形式は CSV で、サフィックス csv を持つ唯一の出力形式であるため、出力形式の Name を含める必要はありません)。
{{ partial "mytextpartial.csv" . }}