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

[[Links]] without Pages showing up as 'Untitled' on the graph #40

Closed
navneethatgodreams opened this issue Jan 14, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@navneethatgodreams
Copy link

Describe the bug

  • This bug occurs when a [[link]] is created with absolute paths turned on, to a un-created page.
  • In obsidian, this shows as a red dot on the graph, and allows you to create the page at a future point by double clicking.
  • In quartz, the graph shows these links as "Untitled" pages that when clicked on, lead to 404 error pages.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new page called "Test"
  2. In "Test", write a sentence in markdown. For example " Hi, at a later point I would like to learn more about [[artifical-intelligence]] "
  3. Notice that in obsidian graph, a red dot is created called "artificial-intelligence" but no page has been attached to it yet. Do not double click on it, as it will create the page for you. Leave as is.
  4. Push to github and publish
  5. Notice that "Test" appears on the graph, linked to a node called "Untitled"
  6. Click on "Untitled" and it should lead to a 404 page.

Expected behavior

Option A: "Untitled" should appear in a different colour and show the name "Artificial-Intelligence"

Option B: "Untitled" and corresponding dot/node should not show up on the graph at all

Screenshots
Quartz website graph:
image
image

Same graph in obsidian:
image

Desktop (please complete the following information):

  • Device: Surface Laptop Go
  • OS: Windows 11
  • Browser : Edge

Additional context
Context: I have a note taking style where I tag important keywords that I would like to get to later using [[keywordname ]] . Once enough mentions of [[keywordname]] turn up in my notes, obsidians graph shows multiple connections going into [[keywordname]] but the colour is greyed out implying that I haven't created a note on it yet. When I have time, I then double click on [[keywordname]] and it makes a page called "Keywordname" linked to it, where I summarize information about that keyword.

I use this instead of # tags since i can write my summary within that name itself, and I can leave many of these [[]] unlinked to pages incase it isn't important that I get to them, and they occupy a spot lower in the hierarchy in the obsidian graph depending on how often i've mentioned them.

@navneethatgodreams navneethatgodreams added the bug Something isn't working label Jan 14, 2022
@DeemOnSecurity
Copy link

DeemOnSecurity commented Jan 15, 2022

I believe the issue is that obsidian grabs a file name or the contents of [[]] as the title, where Quartz uses the frontmatter, it's unable to grab a title because there is no frontmatter to the file.

@navneethatgodreams
Copy link
Author

Yes that is likely. Although since the file is not created yet, this could probably be fixed with a conditional check if file exists type of command before the link is created in the graph code itself.

Unfortunately I'm not a coder, or I would've tried it myself :/

@navneethatgodreams
Copy link
Author

Perhaps an if statement of sorts here would be a quick fix?

  1. I changed the "//draw labels" sections in Layouts->Partials->Graph

from:
.text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || "Untitled")
to
.text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || "")

and this makes the titles on the unnamed nodes disappear. The nodes still show up, but i'm guessing adding an exception somewhere in "//draw individual nodes" should help?

@jackyzha0
Copy link
Owner

It is actually intended behaviour to name notes 'Untitled' if they do not have a title.

To change this, you can filter out notes without title by modifying all instances of neighbours.add(...) to check for the title.

e.g.

parseIdsFromLinks(links).forEach(id => neighbours.add(id))

becomes

parseIdsFromLinks(links)
	.filter(id => !!content[decodeURI(id).replace(/\s+/g, '-')]?.title)
	.forEach(id => neighbours.add(id))

Mara-Li referenced this issue in Mara-Li/archive-quartz-mara Feb 12, 2024
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

3 participants