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

Transclusion of generated page (tag page) does not work #1398

Open
hbock-42 opened this issue Sep 5, 2024 · 3 comments
Open

Transclusion of generated page (tag page) does not work #1398

hbock-42 opened this issue Sep 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@hbock-42
Copy link

hbock-42 commented Sep 5, 2024

Describe the bug
Trying to transclude a generated page (cf: a page that does not exist in the content folder but is generated by Quartz) does not show the generated page content.
Instead it show a text:
Transclude of tags
Where tags is the page I wanted to transclude.

Here is the markdown I used to try to transclude the tags page.

![[tags]]

Trying to transclude a markdown page from the content folder works as expected.

To Reproduce

  1. From any page inside your vault, add a translusion on the tags page (this page is generated by quartz).
![[tags]]
  1. Serve your site: npx quatrz build --serve

Expected behavior
I should see the content of the tags page going to the page where I added the transclusion.

Desktop (please complete the following information):

  • Quartz Version: v4.3.1
  • node Version: v20.15
  • npm version: v10.7.0
  • OS: macos
  • Browser: arc
@hbock-42 hbock-42 added the bug Something isn't working label Sep 5, 2024
@saberzero1
Copy link
Collaborator

saberzero1 commented Sep 6, 2024

You can transclude the tags page. You even add content to it and it will show at the top of the tags page in Quartz.

In fact, you can create a page for every tag and change them individually.

To do this, you need to a tags folder in your content folder inside Obsidian.

Let me illustrate with an example:

Assume I have the following tags on my Quartz site:

  • #main
  • #main/sub
  • #other

I can create a page for every tag, as well as an overview, by adding a structure like this:

(Assuming this inside the content folder)
tags/
  main/
    sub.md
  index.md
  main.md
  other.md

In the above example, we have tags/index.md as our main tag page. This is what will be transcluded when you link to it in your example.

  • tags/main.md is linked to every page with the #main tag.
  • tags/main/sub.md is linked to every page with the #main/sub tag.
  • tags/others.md is linked to every page with the #others tag.

Keep in mind that #main/sub describes sub as a sub-tag of main. Therefore every page tagged #main/sub is also tagged #main. This is intentional, as it allows for tag hierarchies.

@hbock-42
Copy link
Author

hbock-42 commented Sep 6, 2024

Thank you for the answer @saberzero1 .

What I am looking to to is to use to transclude the generated (automatically by quartz ❤️) tags page into another page.

When I transclude an existing already existing page using the transclusion notation, I can see the content of the transcluded page into the page where I put the transclusion notation.
This is not the case when I try to transclude the tags page.

Here is the obsidian documentation refering to what I am speaking about https://help.obsidian.md/Linking+notes+and+files/Embed+files

@saberzero1
Copy link
Collaborator

Below an example of embedding tags/index.md

---
title: Tags
---

Hello there **waves**

image

Notice how the first part is embedded, but the tag list is not. There are two ways to work around this:

  1. Instead of embedding a tag page into another page, write the content of the page in the tags/%TAGNAME%.md file (where %TAGNAME% is your specific tag). The tag list will now display under your content. (See https://quartz.jzhao.xyz/tags/ for an example of this)
  2. Change the embedding code in ofm.ts to use the transclusion code (the code that generates the preview when you hover a link can be found in the visit() function in renderPage.tsx), as these previews do contain the tag list (see above image)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants