GHOST CMS - Properties

Properties

This is a full list of all the available properties that can be used within your routes.yaml config file to manipulate your URL structure

Index of all available properties

Property Description
template Determines which Handlebars template file will be used for this route. Defaults to index.hbs if not specified.
permalink The generated URL for any post within a collection. Can contain dynamic variables based on post data:

  • {id} - unique set of characters, eg. 5982d807bcf38100194efd67
  • {slug} - the post slug, eg. my-post
  • {year} - publication year, eg. 2019
  • {month} - publication month, eg. 04
  • {day} - publication day, eg. 29
  • {primary_tag} - slug of first tag listed in the post, eg. news
  • {primary_author} - slug of first author, eg. cameron
filter Extensively filter posts returned in collections and channels using the full power and syntax of the Ghost Content API

For example author:cameron+tag:newswill return all posts published by Cameron, tagged with ‘News‘. Mix and match to suit.

order Choose any number of fields and sort orders for your content:

  • published_at desc - default, newest post first
  • published_at asc - chronological, oldest first
  • featured desc, published_at desc -
    featured posts, then normal posts, newest first
data Fetch & associate data from the Ghost API with a specified route. The source route of the data will be redirected to the new custom route.

  • post.slug - get data with => {{#post}}
  • page.slug - get data with => {{#page}}
  • tag.slug - get data with => {{#tag}}
  • author.slug - get data with => {{#author}}
rss Collections and channels come with automatically generated RSS feeds which can be disabled by setting the rss property to false
content_type Specify the mime-type for the current route, default: HTML
controller Add a custom controller to a route to perform additional functions. Currently the only supported value is channel

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

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

GHOST CMS - Properties的相关文章

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 - 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 - 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

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 - 配置 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 - 索引Index

Index Use: {{#is "index"}}{{/is}} to detect this context. 使用:{{#is "index"}}{{/is}}来检测这个上下文. Description描述 index is the name for the main post list in your Ghost site, the index context includes the home page and subsequent pages of th

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-sta