File: include.md

package info (click to toggle)
ruby-slim 5.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 828 kB
  • sloc: ruby: 5,583; makefile: 12
file content (20 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# インクルード

インクルードプラグインを使うことで, Slim テンプレートに他の Slim ファイルを読み込むことができます。.slim 拡張子はファイル名に自動的に付加されます。
読み込まれたファイルが Slim でない場合は `#{文字列展開}` を含んだテキストファイルとして扱われます。

例:

    include partial.slim
    include partial
    include partial.txt

インクルードプラグインを有効化

    require 'slim/include'

# オプション

| タイプ | 名前 | デフォルト値 | 目的 |
| ------ | ---- | ------------ | ---- |
| Array | :include_dirs | [Dir.pwd, '.'] | ファイルを検索するディレクトリ |