Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't hide posts from homepage using routes.yaml #20550

Closed
1 task done
cowchimp opened this issue Jul 6, 2024 · 3 comments
Closed
1 task done

Can't hide posts from homepage using routes.yaml #20550

cowchimp opened this issue Jul 6, 2024 · 3 comments

Comments

@cowchimp
Copy link

cowchimp commented Jul 6, 2024

Issue Summary

I'm trying to hide posts with specific tags from the homepage of my blog using routes.yaml but they still show up.
Thank you.

Steps to Reproduce

  1. Install a fresh ghost install using this docker compose file (there is no ./ghost_content directory. it will be auto-created)
version: '3'
services:
  ghost5:
    image: ghost:5.87.1-alpine
    container_name: ghost-debug
    environment:
      - GHOST_LOGGING=debug
      - NODE_ENV=development
      - url=http://localhost:3001
      - database__client=sqlite3
      - database__connection__filename=/var/lib/ghost/content/data/ghost.db
    volumes:
      - ./ghost_content:/var/lib/ghost/content
    ports:
      - "3001:2368"
  1. Go to http://localhost:3001/ghost/#/setup and complete the setup
  2. Go to http://localhost:3001/ghost/#/settings and click Download current routes
  3. Edit the downloaded routes.yaml file
  4. Add a single line directing to hide posts with tag side from the main collection
routes:

collections:
  /:
    permalink: /{slug}/
    template: index
+    filter: tag:-side

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/
  1. Click "Upload routes file" and upload the edited file. Confirm "Routes uploaded" toast message
  2. Go to http://localhost:3001/ghost/#/posts and confirm you already have one post (the default "Coming soon" post)
  3. Create and publish a new post with the title "Hello World" and a tag side
  4. Go to your blog's homepage

Expected behavior:
Only the "Coming soon" post should be shown there since it doesn't have the side tag

Actual behavior
Both the "Coming soon" and "Hello World" posts are shown

Ghost Version

5.87.1

Node.js Version

docker

How did you install Ghost?

docker ghost:5.87.1-alpine

Database type

SQLite3

Browser & OS version

No response

Relevant log / error output

[2024-07-06 05:27:02] INFO "GET /ghost/api/admin/settings/routes/yaml/" 200 97ms
[2024-07-06 05:28:58] ERROR This should not happen.

This should not happen.

Error ID:
    a50b8090-3b58-11ef-9dd3-ff3581719daf

Error Code:
    URLSERVICE_RESOURCE_DUPLICATE

----------------------------------------

InternalServerError: This should not happen.
    at Urls.add (/var/lib/ghost/versions/5.87.1/core/server/services/url/Urls.js:47:27)
    at UrlGenerator._try (/var/lib/ghost/versions/5.87.1/core/server/services/url/UrlGenerator.js:178:23)
    at /var/lib/ghost/versions/5.87.1/core/server/services/url/UrlGenerator.js:132:18
    at arrayEach (/var/lib/ghost/versions/5.87.1/node_modules/lodash/lodash.js:530:11)
    at Function.forEach (/var/lib/ghost/versions/5.87.1/node_modules/lodash/lodash.js:9410:14)
    at UrlGenerator._onInit (/var/lib/ghost/versions/5.87.1/core/server/services/url/UrlGenerator.js:131:11)
    at Queue.run (/var/lib/ghost/versions/5.87.1/core/server/services/url/Queue.js:125:17)
    at Queue.run (/var/lib/ghost/versions/5.87.1/core/server/services/url/Queue.js:129:22)
    at Queue.run (/var/lib/ghost/versions/5.87.1/core/server/services/url/Queue.js:129:22)
    at Queue.run (/var/lib/ghost/versions/5.87.1/core/server/services/url/Queue.js:129:22)
    at Queue.start (/var/lib/ghost/versions/5.87.1/core/server/services/url/Queue.js:216:14)
    at Bridge.reloadFrontend (/var/lib/ghost/versions/5.87.1/core/bridge.js:106:26)
    at async RouteSettings.setFromFilePath (/var/lib/ghost/versions/5.87.1/core/server/services/route-settings/RouteSettings.js:109:13)
    at async Object.query (/var/lib/ghost/versions/5.87.1/core/server/api/endpoints/settings.js:158:13)
    at async getResponse (/var/lib/ghost/versions/5.87.1/node_modules/@tryghost/api-framework/lib/pipeline.js:259:34)
    at async ImplWrapper (/var/lib/ghost/versions/5.87.1/node_modules/@tryghost/api-framework/lib/pipeline.js:264:30)

[2024-07-06 05:28:59] INFO Ghost URL Service Ready in 248.916s

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Jul 6, 2024
@cowchimp
Copy link
Author

cowchimp commented Jul 9, 2024

It looks like maybe this is an issue in the source theme specifically - TryGhost/Source#33

@9larsons
Copy link
Contributor

9larsons commented Jul 9, 2024

Yep, this is the source theme - thanks for making that connection. I'm going to close this out and I'll take a look at what we can do in the theme.

@9larsons 9larsons closed this as completed Jul 9, 2024
@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label Jul 9, 2024
@9larsons 9larsons closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
@cowchimp
Copy link
Author

I'll take a look at what we can do in the theme.

Thank you so much! Looking forward to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants