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

get all tag need add filter: "visibility:public" #85

Closed
rebron1900 opened this issue Aug 18, 2023 · 3 comments
Closed

get all tag need add filter: "visibility:public" #85

rebron1900 opened this issue Aug 18, 2023 · 3 comments

Comments

@rebron1900
Copy link

在使用了 Internal tags 的情况下会出现 /404/ 键值重复的情况。
所以获取所有Tags时需要过滤掉Internal tags。
When using Internal tags, there may be duplicate values for /404/ key. Therefore, it is necessary to filter out Internal tags when retrieving all Tags.

  // Get all tags
  config.addCollection("tags", async function(collection) {
    collection = await api.tags
      .browse({
        include: "count.posts",
        limit: "all",
       filter: "visibility:public" // 
      })
      .catch(err => {
        console.error(err);
      });
@rebron1900 rebron1900 changed the title get all tag ndee add filter: "visibility:public" get all tag need add filter: "visibility:public" Aug 18, 2023
@daviddarnes
Copy link
Contributor

daviddarnes commented Aug 18, 2023

Agreed @rebron1900, I've made a PR here but it's not been merged despite how old it is 😓 #39

@rebron1900
Copy link
Author

@daviddarnes
"How can I prevent 11ty from parsing Internal tags? I need to use some Internal tags to determine whether the page should load TOC or be full width."
如何才能让11ty不解析 Internal tags 呢?我需要用到一些 Internal tags 来判断页面是否加载 TOC 或者是否是full width

@daviddarnes
Copy link
Contributor

@rebron1900 it should be possible to add a filter to 11ty to check if a tag is visible or not and show / hide it. Check out the Ghost Content API for more info https://ghost.org/docs/content-api/#tags

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