Skip to content

Pico Plugin: 記事にパンくずリストを付与するプラグイン

License

Notifications You must be signed in to change notification settings

Pico-Development-JP/Pico_Breadcrumbs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

pico-breadcrumbs

Picoのサイトにパンくずリストを表示するプラグインです。 サイトの記事がディレクトリ(フォルダ)構造を持っている場合に、パンくずリストを生成します。

使用方法

  1. プラグインをダウンロードし、pluginsフォルダにpico_breadcrumbsというフォルダ名で保存する
  2. config/config.ymlに、Pico_Breadcrumbs.enabled = trueという行を書き加える

記事に追加する値

なし

追加するTwig変数

  • breadcrumbs:パンくずリストを含む配列
    • url: ページのURL
    • name: ページのタイトル
    • exists: ページが存在する場合はtrue。

記述例

  {% if breadcrumbs %}
    <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
      <a href="/" itemprop="url"><span itemprop="title">{{ site_title }}</span></a>
      {% for crumb in breadcrumbs %}
        <div itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
          &nbsp;&gt;&nbsp; 
          <a href="{{ crumb.url }}" itemprop="url"><span itemprop="title">{{ crumb.name }}</span></a>
        </div>
      {% endfor %}
    </div>
  {% endif %}

コンフィグオプション

なし

About

Pico Plugin: 記事にパンくずリストを付与するプラグイン

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%