oleeskild / obsidian-digital-garden

MIT License
1.38k stars 125 forks source link

Stupid question: How should the path to a custom favicon look like? #99

Closed amperag closed 1 year ago

amperag commented 1 year ago

Sorry to even create an issue for this. But I'm feeling really dumb. I just can't get the custom favicon to work:

image

How should the path look like? My favicon is stored in the following folder/path:

[vaultname]\99 Meta\Attachments\favicon.svg

oleeskild commented 1 year ago

Don't be sorry, this is exactly the kind of issues that I usually don't run into, but probably a lot of other people do. The path should be "99 Meta/Attachments/favicon.svg", but I just tested it myself and I think you've found a bug. If the path has any spaces in any of the folder name, it won't work.

I feel like I've seen something like a "File selector" in other plugins, where you begin to write the path, and it autocompletes. I'll see if I can figure out how to implement that, instead of free text.

amperag commented 1 year ago

Alright I see, thanks for the timely response. Since the space in the folder path is apparently the problem I tried ...

99%20Meta/Attachments/favicon.svg and "99%20Meta/Attachments/favicon.svg"

Yet, both didn't work:

image

timjore commented 1 year ago

@amperag Did you figure this out? Does 99\ Meta/Attachments/favicon.svg work?

amperag commented 1 year ago

@amperag Did you figure this out? Does 99\ Meta/Attachments/favicon.svg work?

Hey @timjore, as far as I'm aware this issue hasn't been fixed. Right, @oleeskild (sorry to bother you)?

oleeskild commented 1 year ago

I've just released version 2.35.0 of the plugin, which adds a searchable dropdown menu when inputing the svg file path. @amperag, can you try to update to the latest version, and try to select the path using that, and see if that helps? Sorry for this fix has taken a while to be shipped.

amperag commented 1 year ago

Mh... I chose the new favicon from the Digital Garden menu in Obsidian and then applied the new site settings. But it seems Netlify is bugging out on me:

image

See selection of deploy details below. For the (4) deploy I choose do not use a custom theme but the standard Obsidian theme. To see if that helps.

You got any ideas on what the problem could be, @oleeskild? I can ofc provide more info if needed.


Deploy details (1)

4:00:22 PM: ​
4:00:23 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
4:00:22 PM:   "build.command" failed                                        
4:00:22 PM: ────────────────────────────────────────────────────────────────
4:00:22 PM: ​
4:00:22 PM:   Error message
4:00:22 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
4:00:22 PM: ​
4:00:22 PM:   Error location
4:00:22 PM:   In build.command from netlify.toml:
4:00:22 PM:   npm install && npm run build
4:00:22 PM: ​
4:00:22 PM:   Resolved config
4:00:22 PM:   build:
4:00:22 PM:     command: npm install && npm run build
4:00:22 PM:     commandOrigin: config
4:00:22 PM:     publish: /opt/build/repo/dist
4:00:22 PM:     publishOrigin: config
4:00:22 PM:   functionsDirectory: /opt/build/repo/netlify/functions
4:00:22 PM:   redirects:
4:00:23 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts

Deploy details (2)

4:01:51 PM: ​
4:01:51 PM:   "build.command" failed                                        
4:01:51 PM: ────────────────────────────────────────────────────────────────
4:01:51 PM: ​
4:01:51 PM:   Error message
4:01:51 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
4:01:51 PM: ​
4:01:51 PM:   Error location
4:01:51 PM:   In build.command from netlify.toml:
4:01:51 PM:   npm install && npm run build
4:01:51 PM: ​
4:01:51 PM:   Resolved config
4:01:51 PM:   build:
4:01:51 PM:     command: npm install && npm run build
4:01:51 PM:     commandOrigin: config
4:01:51 PM:     publish: /opt/build/repo/dist
4:01:51 PM:     publishOrigin: config
4:01:51 PM:   functionsDirectory: /opt/build/repo/netlify/functions
4:01:51 PM:   redirects:
4:01:52 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts

Deploy details (3)

4:02:38 PM: ​
4:02:39 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
4:02:38 PM:   "build.command" failed                                        
4:02:38 PM: ────────────────────────────────────────────────────────────────
4:02:38 PM: ​
4:02:38 PM:   Error message
4:02:38 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
4:02:38 PM: ​
4:02:38 PM:   Error location
4:02:38 PM:   In build.command from netlify.toml:
4:02:38 PM:   npm install && npm run build
4:02:38 PM: ​
4:02:38 PM:   Resolved config
4:02:38 PM:   build:
4:02:38 PM:     command: npm install && npm run build
4:02:38 PM:     commandOrigin: config
4:02:38 PM:     publish: /opt/build/repo/dist
4:02:38 PM:     publishOrigin: config
4:02:38 PM:   functionsDirectory: /opt/build/repo/netlify/functions
4:02:38 PM:   redirects:
4:02:38 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts

Deploy details (4)

4:07:28 PM: ​
4:07:28 PM:   "build.command" failed                                        
4:07:28 PM: ────────────────────────────────────────────────────────────────
4:07:28 PM: ​
4:07:28 PM:   Error message
4:07:29 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
4:07:28 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
4:07:28 PM: ​
4:07:28 PM:   Error location
4:07:28 PM:   In build.command from netlify.toml:
4:07:28 PM:   npm install && npm run build
4:07:28 PM: ​
4:07:28 PM:   Resolved config
4:07:28 PM:   build:
4:07:28 PM:     command: npm install && npm run build
4:07:28 PM:     commandOrigin: config
4:07:28 PM:     publish: /opt/build/repo/dist
4:07:28 PM:     publishOrigin: config
4:07:28 PM:   functionsDirectory: /opt/build/repo/netlify/functions
4:07:28 PM:   redirects:
4:07:29 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts
oleeskild commented 1 year ago

Hmm, what happens if you leave the favicon path empty, and click "Apply settings to site". Does the build work then?

amperag commented 1 year ago

Still failing:

image

Obsidian:

image

image

Did a new PR for the newest template today:

image


Deploy details (1)

9:34:24 PM: ​
9:34:24 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:34:24 PM:   "build.command" failed                                        
9:34:24 PM: ────────────────────────────────────────────────────────────────
9:34:24 PM: ​
9:34:24 PM:   Error message
9:34:24 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
9:34:24 PM: ​
9:34:24 PM:   Error location
9:34:24 PM:   In build.command from netlify.toml:
9:34:24 PM:   npm install && npm run build
9:34:24 PM: ​
9:34:24 PM:   Resolved config
9:34:24 PM:   build:
9:34:24 PM:     command: npm install && npm run build
9:34:24 PM:     commandOrigin: config
9:34:24 PM:     publish: /opt/build/repo/dist
9:34:24 PM:     publishOrigin: config
9:34:24 PM:   functionsDirectory: /opt/build/repo/netlify/functions
9:34:24 PM:   redirects:
9:34:24 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts

Deploy details (2)

9:34:52 PM: ​
9:34:52 PM:   "build.command" failed                                        
9:34:53 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:34:52 PM: ────────────────────────────────────────────────────────────────
9:34:52 PM: ​
9:34:52 PM:   Error message
9:34:52 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
9:34:52 PM: ​
9:34:52 PM:   Error location
9:34:52 PM:   In build.command from netlify.toml:
9:34:52 PM:   npm install && npm run build
9:34:52 PM: ​
9:34:52 PM:   Resolved config
9:34:52 PM:   build:
9:34:52 PM:     command: npm install && npm run build
9:34:52 PM:     commandOrigin: config
9:34:52 PM:     publish: /opt/build/repo/dist
9:34:52 PM:     publishOrigin: config
9:34:52 PM:   functionsDirectory: /opt/build/repo/netlify/functions
9:34:52 PM:   redirects:
9:34:53 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts
oleeskild commented 1 year ago

Did you use the latest version of the plugin when updating the template?

amperag commented 1 year ago

Did you use the latest version of the plugin when updating the template?

The last successful PR was for v1.32 of the template:

image

So I guess I'm on v1.32 of the template which seems outdated. That might have been the source of the original issue above.

Now a second problems appears: When I try to start another PR for v1.33 it fails:

image image

4:33:52 PM:   "build.command" failed                                        
4:33:52 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
4:33:52 PM: ────────────────────────────────────────────────────────────────
4:33:52 PM: ​
4:33:52 PM:   Error message
4:33:52 PM:   Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1)
4:33:52 PM: ​
4:33:52 PM:   Error location
4:33:52 PM:   In build.command from netlify.toml:
4:33:52 PM:   npm install && npm run build
4:33:52 PM: ​
4:33:52 PM:   Resolved config
4:33:52 PM:   build:
4:33:52 PM:     command: npm install && npm run build
4:33:52 PM:     commandOrigin: config
4:33:52 PM:     environment:
4:33:52 PM:       - REVIEW_ID
4:33:52 PM:     publish: /opt/build/repo/dist
4:33:52 PM:     publishOrigin: config
4:33:52 PM:   functionsDirectory: /opt/build/repo/netlify/functions
4:33:52 PM:   redirects:
4:33:52 PM:     - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /*
      status: 404
      to: /404
  redirectsOrigin: config
Caching artifacts
amperag commented 1 year ago

I tried to update now everything:

Builds still failing:

image

Also on GitHub:

image

Plug-in version:

image

The problem could be in a possibly outdated template version. But I don't know how to check that. (Also apparently I can't update the template atm, see above pictures)

oleeskild commented 1 year ago

Hmm, this is hard to debug without having access to the garden. Would it be possible for you to make the repo with your garden public for a little bit, so I can try building it locally and see what's going wrong?

oleeskild commented 1 year ago

Or maybe paste the entire build log when it is failing. Looking at the others you’ve posted, I think you are missing a lot from the start? Or is that the entire build log?

amperag commented 1 year ago

Hmm, this is hard to debug without having access to the garden. Would it be possible for you to make the repo with your garden public for a little bit, so I can try building it locally and see what's going wrong?

Hey @oleeskild thanks for the offer. I gave you direct access to the repo. Can you check it out?

image

oleeskild commented 1 year ago

Thanks! Found the error. In your "Template Digital Garden" file, you have the following tag: "tags":[[99 Meta/Templates/Template Digital Garden\|]] The last \| causes some issues when generating the file used to search the garden, as \| isn't a valid JSON string because the \ is a special string in JSON. I'll see if I can create a workaround, so that this doesn't break the build of the entire site.

To fix the site right away, removing the \ in that tag should fix it.

Could you post a picture or a copy-paste of how that note looks in your Obsidian vault? And what is the reason behind using that tag? Is there some plugin that needs that \| at the end or something?

oleeskild commented 1 year ago

I've released version 1.36.1 of the template, which should fix your issue. If you update the template to the latest version your site should start working again 🤞

amperag commented 1 year ago

Thanks! Found the error. In your "Template Digital Garden" file, you have the following tag: "tags":[[99 Meta/Templates/Template Digital Garden\|]] The last \| causes some issues when generating the file used to search the garden, as \| isn't a valid JSON string because the \ is a special string in JSON. I'll see if I can create a workaround, so that this doesn't break the build of the entire site.

To fix the site right away, removing the \ in that tag should fix it.

Could you post a picture or a copy-paste of how that note looks in your Obsidian vault? And what is the reason behind using that tag? Is there some plugin that needs that \| at the end or something?

Ok, very interesting. Good catch @oleeskild!

Actually the Template Digital Garden file is looking like this for me in Obsidian.

---
title: {{title}}
date: {{date:YYYY-MM-DD}}
categories: 
  - []
tags: 
  - []
dg-publish: true
dg-permalink: ""
---
# {{title}}

...

But you are right, on Github it looks completely different:

image

I don't know where that tags is coming from actually since in the markdown file it's just an empty [].

For the moment I'll just set dg-publish: FALSE and update the template.

amperag commented 1 year ago

Ok, what I did now:

  1. Deleted the Template Digital Garden.md file. --> Works! ✔
  2. From Appearance > Manage:
  3. Updated the theme --> Works! ✔
  4. Updated the favicon --> Works now! ✔
  5. Updated the digital garden template via Manage site template. --> Works! ✔

So now it seems that "everything" works. Wuhu! 🎉

But since I deleted the buggy template file from the published notes beforehand I don't know if it was the deletion of the Template Digital Garden.md file or if the new version 1.36.1 of the site template that did the trick.

Maybe both. 😉

oleeskild commented 1 year ago

Awesome, glad you finally got it working 😄 It seems there is an obscure bug here. Because of the

tags:
 - []

syntax, the tags translatesi into this, when reading the frontmatter: tags: [[]]. This then gets picked up as a linked file, and the plugin tries to convert it. So that is why you got that weird behaviour. I'm pushing out a fix now, where I'm ignoring whatever is in the frontmatter when converting wikilinks. Thanks for helping me figure this one out 😄