Sensible tagging

聪明的标签

You can think of tags like Gmail labels. By tagging posts with one or more keyword, you can organise articles into buckets of related content.

您可以考虑像Gmail标签这样的标签。通过用一个或多个关键字标记文章,你可以将文章组织进相关内容的桶。

When you create content for your publication you can assign tags to help differentiate between categories of content.

在为出版物创建内容时,可以分配标记来帮助区分内容的类别。

For example you may tag some content with News and other content with Podcast, which would create two distinct categories of content listed on /tag/news/ and /tag/podcast/, respectively.

例如,您可以将一些内容标记为News,将其他内容标记为Podcast,这将创建两个不同类别的内容,分别列在/tag/ News /和/tag/ Podcast /上。

If you tag a post with both News and Podcast - then it appears in both sections. Tag archives are like dedicated home-pages for each category of content that you have. They have their own pages, their own RSS feeds, and can support their own cover images and meta data.

如果你给一篇文章加上新闻和播客,那么它就会同时出现在两个部分。标签归档就像你拥有的每一类内容的专用主页。他们有自己的页面,自己的RSS提要,可以支持自己的封面图片和元数据。

The primary tag

主要标签

Inside the Ghost editor, you can drag and drop tags into a specific order. The first tag in the list is always given the most importance, and some themes will only display the primary tag (the first tag in the list) by default.

在Ghost编辑器中,您可以将标记拖放到特定的顺序中。列表中的第一个标记总是最重要的,一些主题默认情况下只显示主标记(列表中的第一个标记)。

News, Technology, Startup
新闻、科技、创业

So you can add the most important tag which you want to show up in your theme, but also add related tags which are less important.

因此,您可以添加您想要在主题中显示的最重要的标记,但也可以添加不太重要的相关标记。

Private tags

私有标签

Sometimes you may want to assign a post a specific tag, but you don't necessarily want that tag appearing in the theme or creating an archive page. In Ghost, hashtags are private and can be used for special styling.

有时您可能希望为一篇文章分配一个特定的标签,但您不一定希望该标签出现在主题中或创建存档页面。在Ghost中,hashtags是私有的,可以用于特殊的样式。

For example, if you sometimes publish posts with video content - you might want your theme to adapt and get rid of the sidebar for these posts, to give more space for an embedded video to fill the screen. In this case, you could use private tags to tell your theme what to do.

例如,如果你有时发布带有视频内容的帖子,你可能想调整你的主题,去掉这些帖子的侧边栏,给嵌入视频留出更多空间来填充屏幕。在这种情况下,您可以使用私有标记来告诉主题要做什么。

News, #video
新闻,#视频

Here, the theme would assign the post publicly displayed tags of News - but it would also keep a private record of the post being tagged with #video. In your theme, you could then look for private tags conditionally and give them special formatting.

在这里,主题会分配帖子公开显示的新闻标签,但它也会保留贴有#video标签的帖子的私有记录。在主题中,可以有条件地查找私有标记,并为它们设置特殊的格式。

You can find documentation for theme development techniques like this and many more over on Ghost's extensive theme docs.
你可以在Ghost的扩展主题文档中找到类似的主题开发技术文档和更多文档。

Dynamic routing

动态路由

Dynamic routing gives you the ultimate freedom to build a custom publication to suit your needs. Routes are rules that map URL patterns to your content and templates.

动态路由使您可以完全自由地构建自定义发布,以满足您的需要。路由是将URL模式映射到内容和模板的规则。

You may not want content tagged with News to exist on: example.com/tag/news. Instead, you want it to exist on example.com/news .

您可能不希望在:example.com/tag/news上存在标记为News的内容。相反,您希望它存在于example.com/news上。

In this case you can use dynamic routes to create customised collections of content on your site. It's also possible to use multiple templates in your theme to render each content type differently.

在这种情况下,你可以使用动态路径在你的网站上创建定制的内容集合。还可以在主题中使用多个模板以不同方式呈现每种内容类型。

There are lots of use cases for dynamic routing with Ghost, here are a few common examples:

  • Setting a custom home page with its own template
  • Having separate content hubs for blog and podcast, that render differently, and have custom RSS feeds to support two types of content
  • Creating a founders column as a unique view, by filtering content created by specific authors
  • Including dates in permalinks for your posts
  • Setting posts to have a URL relative to their primary tag like example.com/europe/story-title/
Dynamic routing can be configured in Ghost using YAML files. Read our dynamic routing documentation for further details.

有很多使用Ghost的动态路由的用例,下面是一些常见的例子:

  • 使用自己的模板设置自定义主页
  • 为blog和podcast提供独立的内容hub,呈现方式不同,并提供定制的RSS提要来支持两种类型的内容
  • 通过过滤特定作者创建的内容,将founders列创建为一个独特的视图
  • 在文章的永久链接中包括日期
  • 将文章设置为相对于其主要标签的URL,如example.com/europe/storyy-title/
在Ghost中,动态路由可以通过YAML文件配置。了解更多细节,请阅读动态路由文档。

Next: Apps & Integrations

接下来:应用与集成

Work with all your favourite apps and tools using our integrations, or create your own custom integrations with webhooks.

通过我们集成组件,和所有您喜爱的应用程序和工具一起工作,或者通过webhooks创建您自己的自定义集成。