Update from 1.x to 2.x

 

TeXt 2

After several months effort, TeXt 2 has finally released. the new version has lots of refactors and changes, which leads to some configuration incompatibilities. Hope this document will help you with your upgrade.

Skin

text_color_theme in _config.yml rename to text_skin.

1.x:

text_color_theme: forest
text_skin: forest

Layout

Article Layout

Post Layout and Page Layout rename to Article Layout.

1.x:

layout: post
layout: page

2.x:

layout: article

Since TOC, Edit on Github button, license and pageview are disabled by default on the new Article Layout, in order to keep same whit the former version, you can add these settings in the Front Matter:

license: true
aside:
  toc: true
show_edit_on_github: true
pageview: true

You can also use Front Matter defaults to specify configuration for all the posts of your site:

defaults:
  - scope:
      path: ""
      type: posts
    values:
      layout: article
      license: true
      aside:
        toc: true
      show_edit_on_github: true
      pageview: true

Archive Layout

All Layout rename to Archive Layout.

1.x:

layout: all

2.x:

layout: archive

Paths

In order to maintain consistency with the layout naming, TeXt 2 renamed all.html to archive.html. base and all variables under paths in _config.yml has renamed to root and archive.

1.x:

paths:
  base    : /blog
  all     : /blog/all.html
  rss     : /feed.xml

2.x:

paths:
  root    : /blog
  home    : /blog
  archive : /blog/archive.html
  rss     : /feed.xml

License

You need to specify license in _config.yml to enable license, which default to false:

license: CC-BY-4.0

Comments

There are some changes for configuration of comments, pageview and analytics in TeXt 2. which mainly add a provider attribute and change providers into corresponding sub-configuration items.

1.x:

disqus:
  shortname: kitian616-github-io

2.x:

comments:
  provider: disqus
  disqus:
    shortname: kitian616-github-io

Pageview

1.x:

leancloud:
  app_id: uAG3OhdcH8H4fxSqXLyBljA7-gzGzoHsz
  app_key: Mzf5m9skSwYVWVXhGiYMNyXs
  app_class: ThomasBlog

2.x:

pageview:
  provider: leancloud
  leancloud:
    app_id: uAG3OhdcH8H4fxSqXLyBljA7-gzGzoHsz
    app_key: Mzf5m9skSwYVWVXhGiYMNyXs
    app_class: ThomasBlog

Analytics

1.x:

ga_tracking_id: UA-71907556-1

2.x:

analytics:
  provider: google
  google:
    tracking_id: UA-71907556-1

Logo and Favicon

The location of the default logo has changed。the old icon generation tool has been removed,TeXt 2 recommend RealFaviconGenerator for generating favicon.

The navigation configuration at the top right of the site has been moved to _data/navigation.yml and the entire navigation is freely customizable in the new version.

1.x:

nav_lists:
  - titles:
      en: About
      zh: 关于
      zh-Hans: 关于
      zh-Hant: 關於
    url: /blog/about.html

2.x:

## _data/navigation.yml
header:
  - titles:
      en:       Archive
      zh:       归档
      zh-Hans:  归档
      zh-Hant:  歸檔
    url:        /blog/archive.html
  - titles:
      en:       About
      zh:       关于
      zh-Hans:  关于
      zh-Hant:  關於
    url:        /blog/about.html