Let octopress support tag (tag)

Source: Internet
Author: User

    • Installing plugins
      • Octopress-tag-cloud
    • Display the label cloud in the sidebar
    • Use
    • Reference
Installing plugins

There are several plug-ins to implement the label function. One is the official recommended version of Octopress, which is said to not support multiple tags. Some people also use the "3D" tag cloud, style I am not too fond of. The final choice is a set of plugins for Robbyedwards. This set of plug-ins has two, one is octopress-tag-pages, used to generate the label page, and the other is Octopress-tag-cloud, used to display the implementation of the tag cloud function.

# # Octopress-tag-pages

Install Octopress-tag-page first. Get the plugin from the link above and copy the files to the same path as the octopress:

Plugins/tag_generator.rb

Source/_includes/custom/tag_feed.xml

Source/_includes/post/tags.html

Source/_layouts/tag_index.html

Among them tag_generator.rb and tag_feed.xml are necessary, others according to the internet are said to be optional.

Other files are files of the same name, which can affect the configured functionality if copied, and may cause some problems (possibly due to version compatibility issues).

This plugin does not need to be configured.

Octopress-tag-cloud

Then install Octopress-tag-cloud. Get the plug-in at the link above, and copy some files to the same path as octopress:

Plugins/tag_cloud.rb

Source/_includes/custom/asides/tags.html

TAG_CLOUD.RB is necessary. Tags.html is an example of displaying labels in the sidebar. You can configure it by referencing it.

Display the label cloud in the sidebar

Add custom/asides/tags.html to Default_asides: in _config.yml to display the label cloud in the sidebar. If you want to Chinese, then modify tags.html and other documents.

Use

In the new blog file, add a line "tags:", similar to:

---layout: posttitle: "test tag"published: truedate: 2014-10-28 00:42comments: truetags: [扩展, ttt]categories: ---

This will add two tags to this blog post, allowing labels and classifications to classify different dimensions of the article.

When there is more than one label for an article, there is a problem similar to the following when executing rake generate:

1  2  3  4  5  Span class= "Line-number" >6  7  8  9  10  
$ rake generate(in /ubdata/octopress)## Generating Site with Jekyllidentical source/stylesheets/screen.css Configuration file: /ubdata/octopress/_config.yml            Source: source       Destination: public      Generating...   Liquid Exception: comparison of Array with Array failed in _layouts/page.htmljekyll 2.4.0 | Error:  comparison of Array with Array failed

After more than 10 days of repeated tests, it is found that the problem occurs if the "limit" parameter is added to the source/_includes/custom/asides/tags.html. Just get rid of it.

Another problem is that the 2.0 version of OCROPTRSS calls the generate operation to execute all the plugins in the plugings, so it will report some errors and ignore them.

1 2 3 4 5 6 7 8 9 Ten  One  A  -  -
$ rake Generate(in/ubdata/octopress)# # Generating Site with Jekyllidentical source/stylesheets/screen.cssConfiguration file:/ubdata/octopress/_config.ymlSource:sourceDestination:publicGenerating ...Build warning:layout ' nil ' requested in tags/kuo-zhan/atom.xml does not exist.Build warning:layout ' nil ' requested in tags/ttt/atom.xml does not exist.Build warning:layout ' nil ' requested in tags/kuo-zhan/atom.xml does not exist.Build warning:layout ' nil ' requested in tags/ttt/atom.xml does not exist.Done .auto-regeneration:disabled. Use--watch to enable.
Reference

http://codemacro.com/2012/07/18/add-tag-to-octopress/

http://loudou.info/blog/2014/02/15/wei-octopress-tian-jia-tag-gong-neng/

Original link address: http://pangyi.github.io/blog/20150125/rang-octopresszhi-chi-biao-qian-(TAG)/
Written by pangyi?posted at Http://pangyi.github.io

Let octopress support tag (tag)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.