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

Markdown-Hugo: Option to put images in the same directory as exported file #170

Open
aviskase opened this issue Mar 13, 2024 · 0 comments
Open

Comments

@aviskase
Copy link

aviskase commented Mar 13, 2024

Hi. Currently, when running export to markdown-hugo, the end result for me looks like this:

➜ tree
.
├── scratchpad
│   └── 5802d43f298e15b95cbc5caf2a9a2116c2660b59.png
└── scratchpad.md

scratchpad.md content:

<figure>
<span class="image placeholder"
data-original-image-src="../scratchpad/5802d43f298e15b95cbc5caf2a9a2116c2660b59.png"
data-original-image-title="wikilink">histomf.png</span>
<figcaption>histomf.png</figcaption>
</figure>

Here is my command setup:

-f ${fromFormat}  --resource-path="${currentDir}" --resource-path="${vaultDir}/${attachmentFolderPath}" --lua-filter="${luaDir}/markdown+hugo.lua" --lua-filter admonition.lua -s -o "${outputPath}" -t commonmark_x-attributes
  1. I'm not sure it's correct behavior to go up ../scratchpad. I'd expect ./scratchpad
  2. In my hugo blog all images are stored in the same directory as the markdown file. So the expected result is:
➜ tree
.
├── 5802d43f298e15b95cbc5caf2a9a2116c2660b59.png
└── scratchpad.md

scratchpad.md content:

<figure>
<span class="image placeholder"
data-original-image-src="./5802d43f298e15b95cbc5caf2a9a2116c2660b59.png"
data-original-image-title="wikilink">histomf.png</span>
<figcaption>histomf.png</figcaption>
</figure>

Is it possible to achieve this with some kind of export options or it needs to be implemented as an option in the plugin? If the latter, I'm happy to work on PR, my guess is that I need to change something in markdown.lua and add setting somewhere.

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

1 participant