当前位置: 首页 > 软件库 > Web应用开发 > >

jekyll-titles-from-headings

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 范楚
操作系统 未知
开源组织
适用人群 未知
 软件概览

Jekyll Titles from Headings

A Jekyll plugin to pull the page title from the first Markdown heading when none is specified.

CI

What it does

If you have a Jekyll page that doesn't have a title specified in the YAML Front Matter, but the first non-whitespace line in the page is a Markdown H1 / H2 / H3, this plugin instructs Jekyll to use that first heading as the page's title.

Why

Because lots of plugins and templates rely on page.title.

If you're using a plugin like Jekyll Optional Front Matter, you'd have to add Front Matter, just to get the title, which you're already specifying in the document.

Additionally, this allows you to store the title semantically, in the document itself so that it's readable, both as Markdown and when rendered, as machine-readable for plugins like Jekyll SEO Tag.

Usage

  1. Add the following to your site's Gemfile:
gem 'jekyll-titles-from-headings'
  1. Add the following to your site's config file:
plugins:
  - jekyll-titles-from-headings

Note: If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.

Configuration

Configuration options are optional and placed in _config.yml under the titles_from_headings key. They default to:

titles_from_headings:
  enabled:     true
  strip_title: false
  collections: false

Stripping titles

If your theme renders titles based on page.title, you can remove the title from the content by setting strip_title to prevent rendering it twice.

To limit this behavior to a certain layouts or paths, you can use front matter defaults, e.g.

defaults:
  - scope:
      path: some-path
      layout: some_layout
    values:
      strip_title: true

Processing Collections

If you want to enable this plugin for collection items, set the collections option to true.

Since collection items (including posts) already have a title inferred from their filename, this option changes the behavior of this plugin to override the inferred title. The inferred title is only used as a fallback in case the document doesn't start with a heading.

Disabling

Even if the plugin is enabled (e.g., via the :jekyll_plugins group in your Gemfile) you can disable it by setting the enabled key to false.

 相关资料
  • JekyllRedirectFrom Give your Jekyll posts and pages multiple URLs. When importing your posts and pages from, say, Tumblr, it's annoying andimpractical to create new pages in the proper subdirectories

  • .from( target:Object, duration:Number, vars:Object, position:* ) : * 添加一个TweenLite.from()动画到时间轴,相当于add(TweenLite.from(...)),以下两行产生相同的结果: myTimeline.add( TweenLite.from(element, 1, {left:100, opacity:

  • from 将其他类型或者数据结构转换为 Observable 当你在使用 Observable 时,如果能够直接将其他类型转换为 Observable,这将是非常省事的。from 操作符就提供了这种功能。 演示 将一个数组转换为 Observable: let numbers = Observable.from([0, 1, 2]) 它相当于: let numbers = Observable<

  • From请求头中包含的 Internet 电子邮件地址谁控制了请求的用户代理的人类用户。 如果您正在运行机器人用户代理(例如搜寻器),From则应发送标题,以便在服务器出现问题(例如机器人发送过多,不需要或无效的请求)时联系您。 您不应该使用From标题进行访问控制或身份验证。 Header type Request header Forbidden header name no 语法 From:

  • from 函数签名: from(ish: ObservableInput, mapFn: function, thisArg: any, scheduler: Scheduler): Observable 将数组、promise 或迭代器转换成 observable 。 对于数组和迭代器,所有包含的值都会被作为序列发出! 此操作符也可以用来将字符串作为字符的序列发出! 示例 示例 1: 数组转换而

  • Jekyll 是一个简单的免费的Blog生成工具,类似WordPress。但是和WordPress又有很大的不同,原因是jekyll只是一个生成静态网页的工具,不需要数据库支持。但是可以配合第三方服务,例如discuz。最关键的是jekyll可以免费部署在Github上,而且可以绑定自己的域名。 快速安装指令: gem install jekylljekyll new my-awesome-sit