GHOST CMS - Content Taxonomies

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!

原文地址:https://www.cnblogs.com/QDuck/p/12081551.html

时间: 2024-08-30 13:39:05

GHOST CMS - Content Taxonomies的相关文章

GHOST CMS - Content Collections

Content Collections Collections are the backbone of how posts on a Ghost site are organised, as well as what URLs they live on. You can think of collections as major sections of a site which represent distinct and separate types of content, for examp

GHOST CMS - 创建自定义主页 Creating a custom home page

创建自定义主页 Creating a custom home page 为你的网站创建一个自定义的主页是一个让你从人群中脱颖而出的好方法,并把你自己独特的印记存放在你的网上.本教程向您展示了如何在Ghost中自定义和开发自己的自定义主页. Creating a custom home page for your site is a great way to set yourself apart from the crowd and put your own unique stamp on you

GHOST CMS - Channels

Channels If you want something more flexible than taxonomies, but less rigid than collections, then channels might be for you. A channel is a custom stream of paginated content matching a specific filter. This allows you to create subsets and superse

GHOST CMS - URLs & Dynamic Routing

URLs & Dynamic Routing Routing is the system which maps URL patterns to data and templates within Ghost. It comes pre-configured by default, but it can also be customised extensively to build powerful custom site structures. All of Ghost's routing co

GHOST CMS - 配置 Config

Config For self-hosted Ghost users, a custom configuration file can be used to override Ghost's default behaviour. This provides you with a range of options to configure your publication to suit your needs. 对于自承载的Ghost用户,可以使用自定义配置文件覆盖Ghost的默认行为.这为您提供

GHOST CMS -上下文概述 Context Overview

Context Overview上下文概述 Each page in a Ghost theme belongs to a context, which determines which template is used, what data will be available and what content is output by the {{body_class}} helper. Ghost主题中的每个页面都属于一个上下文,它决定使用哪个模板.哪些数据可用以及{{body_class}

GHOST CMS - Data Helpers

Data Helpers Data helpers are used to output data from your site. Use this reference list to discover what each handlebars helper can do when building a custom Ghost theme. Available data helpers @config @site navigation post url title img_url excerp

GHOST CMS - Handlebars Themes - Further Reading

Further Reading Where you go from here is up to you, the world is your router1 Ghost's dynamic routing system is an extremely powerful way to build advanced structures for your site, and it's hard to document every possible example of what can be don

GHOST CMS - Utility Helpers公用事业帮手

Utility Helpers Utility helpers are used to perform minor, optional tasks. Use this reference list to discover what each handlebars helper can do when building a custom Ghost theme. Available utility helpers asset ghost_head/foot body_class post_clas