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

Images are not placed in the "notes/assets/" directory for compatibility with publishing #6

Open
sirkus7 opened this issue Jul 27, 2022 · 2 comments · May be fixed by #12
Open

Images are not placed in the "notes/assets/" directory for compatibility with publishing #6

sirkus7 opened this issue Jul 27, 2022 · 2 comments · May be fixed by #12

Comments

@sirkus7
Copy link

sirkus7 commented Jul 27, 2022

When pasting images, the dendron-paste-image extension places the image in "notes/" directory. However, these need to be placed in "notes/assets/" in order for them to publish correctly. Though the images appear correctly in the VSCodium/VSCode dendron preview pane, when published, the images are broken, presumably because they're not placed in the "notes/assets/" directory.

Replicating the problem:

(Assuming you have Dendron and the Dendron Paste Image extension installed:)

  1. Create a new Dendron workspace
  2. Copy and image to the clipboard, then use the "Paste Image" feature from the command pallet to insert an image into an dendron note.
  3. Look at the file structure, note that the image is stored in the notes/ directory.

To test the publishing result:

(Assuming you have the dendron-cli installed)
5. At the command line, in the worspace directory initialize for publishing: npx dendron publish init
6. preview the site: npx dendron publish dev
7. View it in a browser at "localhost:3000"
8. View the site. In my case, the images are broken. The links refer to "/image.png", but no images appear.

Tested with:

  • VSCodium: 1.68.0
  • Dendron v0.105.0
  • dendron-cli 0.105.1
  • Dendron Paste Image: v1.1.0
  • Linux Mint 20.2
@ScriptAutomate
Copy link
Contributor

Can reproduce. Images go into notes/*.png instead of notes/assets/*.png in self-contained vaults. Haven't tested legacy vaults.

  • VSCode: 1.69.2
  • Dendron v0.105.1
  • dendron-cli 0.105.1
  • Dendron Paste Image: v1.1.0
  • OS: Pop!_OS 22.04 (Linux / Ubuntu deriv)

@ScriptAutomate
Copy link
Contributor

@sirkus7 For you and others in the meantime, looks like you can change this in the extension settings:

  • Go to the Dendron Paste Image extension in your editor
  • Click on the gear icon -> Extension Settings
  • Go down to Paste Image: Path and change the value
    • Current value: ${currentFileDir}
    • New value: ${currentFileDir}/assets
  • This should ensure it goes to the proper assets directory
  • In case you want an extra prompt, can also enable the Paste Image: Show File Path Confirm Input Box option

The fix for this repo would be to probably update the default value used in Paste Image: Path to be ${currentFileDir}/assets so that others don't run into the same problem.

@ScriptAutomate ScriptAutomate linked a pull request Dec 9, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants