TryGhost / TryGhost/Source

Using collection tag filter to exclude a certain tag doesn't work on index page

Open
#66 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
129
Forks
258
Avg merge
2h 57m
Merged PRs (30d)
36

Description

I just modified my routes.yaml to look something like this:

routes:
  /portfolio/art/:
    controller: channel
    filter: tag:portfolio+tag:art
  /portfolio/figure-drawing/:
    controller: channel
    filter: tag:portfolio+tag:figure-drawing
  /portfolio/pixel-art/:
    controller: channel
    filter: tag:portfolio+tag:pixel-art

collections:
  /portfolio/:
    permalink: /portfolio/{slug}/
    filter: primary_tag:portfolio
    template: tag
    data: tag.portfolio

  /:
    permalink: /{slug}/
    template: index
    filter: tag:-portfolio

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

But somehow the portfolio tagged posts still show up on the home page. Though interestingly the issue does not occur when using the Casper theme.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the routes.yaml configuration shown and compare Source's index-page behavior with the Casper theme. Trace how the home-page collection applies the tag exclusion, then verify that portfolio-tagged posts no longer appear on the home page while the portfolio routes still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.