zoukankan      html  css  js  c++  java
  • GHOST CMS

    Content Taxonomies

    Taxonomies are groupings of posts based on a common relation. In Ghost, this is always defined by the post's author or tag

    Using taxonomies, Ghost will automatically generate post archives for tags and authors like /tag/getting-started/ which will render a list of associated content.

    Unlike collections, posts can appear in multiple taxonomies and the URL of the post is not affected by which taxonomies are applied.

    Taxonomies are structured like this:

    taxonomies:
      tag: /tag/{slug}/
      author: /author/{slug}/

    If a post by Cameron is tagged with News then it will be included in archives appearing on:

    • site.com – (The collection index)
    • site.com/author/cameron
    • site.com/tag/news/

    Each of these come with their own automatically generated RSS feeds which are accessed by adding /rss/ to the end of the URL.


    Customising taxonomies

    The configration options for taxonomies are a lot more basic than routes and collections. You can't define new or custom taxonomies, you can only modify those which are already there and adapt their syntax a small amount.

    taxonomies:
      tag: /topic/{slug}/
      author: /host/{slug}/

    If you don't like the prefixes for taxonomies, you can customise them to something else which suits your site and your content better. If you're running a publication which is primarily a podcast, for example, you might prefer host and topic.


    Removing taxonomies

    One small extra trick is that you can actually remove taxonomies entirely and not generate those pages for your site. If you prefer to keep things minimal, just leave the taxonomies field empty.

    taxonomies:
      # Nothing but silence

    Just make sure you also update your template files to not link to any tag or author archives, which will now 404!

  • 相关阅读:
    韩信的糊涂
    用友U8两个怪问题
    写给对前途迷茫的朋友:五句话定会改变你的人生
    换博客了
    各种杀毒工具的优缺点
    又是一年中秋到 别有一般更思乡
    谁说黑夜是孤单的
    李想:创业不一定是创办企业
    SQ小组KTV点歌系统简介
    注意!在subList生成子列表之后,一定不要随便更改原列表
  • 原文地址:https://www.cnblogs.com/QDuck/p/12081551.html
Copyright © 2011-2022 走看看