~xdavidwu/xdavidwu.link

1c8239f6647accd93938eff776d6f302e6f5efe1 — Michael Rose 8 years ago 20fe00d
Move breadcrumb text out of _config.yml and into ui-text.yml data file
3 files changed, 26 insertions(+), 26 deletions(-)

M _config.yml
M _data/ui-text.yml
M _includes/breadcrumbs.html
M _config.yml => _config.yml +0 -2
@@ 17,8 17,6 @@ email                    : # e.g. "your-email@domain.com"
logo                     : "site-logo.png"
teaser                   : "500x300.png"
breadcrumbs              : # true, false (default)
breadcrumb_home_label    : "Home"
breadcrumb_separator     : "/"
twitter:
  username               : &twitter "mmistakes"
facebook:

M _data/ui-text.yml => _data/ui-text.yml +23 -21
@@ 3,27 3,29 @@
# English (default)
# -----------------
en: &DEFAULT_EN
  page                : "Page"
  pagination_previous : "Previous"
  pagination_next     : "Next"
  toc_label           : "On This Page"
  ext_link_label      : "Direct Link"
  less_than           : "less than"
  minute_read         : "minute read"
  minutes_read        : "minutes read"
  share_on_label      : "Share on"
  meta_label          :
  tags_label          : "Tags:"
  categories_label    : "Categories:"
  date_label          : "Updated:"
  comments_label      : "Leave a Comment"
  more_label          : "Learn More"
  related_label       : "You May Also Enjoy"
  follow_label        : "Follow:"
  feed_label          : "Feed"
  powered_by          : "Powered by"
  website_label       : "Website"
  email_label         : "Email"
  page                  : "Page"
  pagination_previous   : "Previous"
  pagination_next       : "Next"
  breadcrumb_home_label : "Home"
  breadcrumb_separator  : "/"
  toc_label             : "On This Page"
  ext_link_label        : "Direct Link"
  less_than             : "less than"
  minute_read           : "minute read"
  minutes_read          : "minutes read"
  share_on_label        : "Share on"
  meta_label            :
  tags_label            : "Tags:"
  categories_label      : "Categories:"
  date_label            : "Updated:"
  comments_label        : "Leave a Comment"
  more_label            : "Learn More"
  related_label         : "You May Also Enjoy"
  follow_label          : "Follow:"
  feed_label            : "Feed"
  powered_by            : "Powered by"
  website_label         : "Website"
  email_label           : "Email"
en_US:
  <<: *DEFAULT_EN
en_UK:

M _includes/breadcrumbs.html => _includes/breadcrumbs.html +3 -3
@@ 19,10 19,10 @@
    {% for crumb in crumbs offset: 1 %}
      {% if forloop.first %}
        <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
          <a href="{{ base_path }}/" itemprop="item"><span itemprop="name">{{ site.breadcrumb_home_label }}</span></a>
          <a href="{{ base_path }}/" itemprop="item"><span itemprop="name">{{ site.data.ui-text[site.locale].breadcrumb_home_label }}</span></a>
          <meta itemprop="position" content="{{ i }}" />
        </li>
        <span class="sep">{{ site.breadcrumb_separator }}</span>
        <span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator }}</span>
      {% endif %}
      {% if forloop.last %}
        <li class="current">{{ page.title }}</li>


@@ 32,7 32,7 @@
          <a href="{{ base_path }}{{ crumb | downcase | replace: '%20', '-' | prepend: path_type | prepend: crumb_path }}" itemprop="item"><span itemprop="name">{{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }}</span></a>
          <meta itemprop="position" content="{{ i }}" />
        </li>
        <span class="sep">{{ site.breadcrumb_separator }}</span>
        <span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator }}</span>
      {% endif %}
    {% endfor %}
  </ol>