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

Include URLS from frontmatter values #1

Closed
mnaoumov opened this issue Feb 18, 2023 · 6 comments
Closed

Include URLS from frontmatter values #1

mnaoumov opened this issue Feb 18, 2023 · 6 comments

Comments

@mnaoumov
Copy link

Currently only URLs from the note content are added to the panel

@giselle197
Copy link
Owner

giselle197 commented Feb 21, 2023

I've been considering your suggestion for a few days.
At first Obsidian does not support "external links in YAML" rendered (hope my perception is correct), neither does my view. Secondly, I thought over the format users may use.

So, may I ask you, which format do you use
url: https://... (just single URL)

Or
url: https://web1..., https://web2... (separated by comma)

Or several URLs in list

Or ... you have URLs in the paragraph and it is frontmatter field (value) (<-- It's a tricky situation!)

Thanks for your advice!

@mnaoumov
Copy link
Author

@giselle197 please take a look at this plugin https://github.com/Trikzon/obsidian-frontmatter-links

It makes the links from the frontmatter clickable

It supports single or multiple links from the field values, with or without quotes

@mnaoumov
Copy link
Author

---
url-with-quotes: "https://google.com"
url-without-quotes: https://google.com
url-array-with-quotes: ["https://google.com", "https://microsoft.com"]
url-array-multiline-with-quotes:
  - "https://google.com"
  - "https://microsoft.com"
url-array-multiline-without-quotes:
  - https://google.com
  - https://microsoft.com
---

@giselle197
Copy link
Owner

Thanks for providing useful information! I have released the new version.

These are some of my considerations

  1. URLs in YAML can't be assigned title. This is a difference with URLs in main text (content).
  2. YAML is separated from main text (content), and I wouldn't like to mix URLs from the two regions together.
  3. URLs from frontmatter values are not included in the count. Since they are separated from content region, counting will cause chaos.
  4. This is the main reason. I believe that users write metadata with care, and the order is meaningful. Therefore, I use ordered list rather than unordered list when it comes to array.

I also made update in README.

@mnaoumov
Copy link
Author

@giselle197

  1. URLs in YAML can't be assigned title

Why? Isn't the YAML key is a perfect candidate for the url title? In my examples above: url-with-quotes, url-without-quotes, url-array-with-quotes, url-array-multiline-with-quotes, url-array-multiline-without-quotes

@giselle197
Copy link
Owner

What I refer to is we can't use

---
web: [Google](https://www.google.com/)
---

Based on my understanding, it is illegal in YAML.

Furthermore, I have tested your case (#1 (comment)). It passed!

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