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

Absolute image paste #30

Open
MRog40 opened this issue Jun 2, 2020 · 2 comments
Open

Absolute image paste #30

MRog40 opened this issue Jun 2, 2020 · 2 comments

Comments

@MRog40
Copy link

MRog40 commented Jun 2, 2020

I use the static site generator Hugo. The inside of a Hugo site looks like this:

content
├── L1
│   ├── L1.md
│   └── L2
│      ├── L2.md
│      └── L3
│         └── L3.md
└── L1_2
    ├── L1_2.md
    └── L1_3.md

static
└── img
    └── imagepaste.png

All images are saved in /static/img and referenced in markdown as ![](/static/img/imagepaste.png)

Is it possible to make this plugin work such that in any "level" of markdown file in the content directory, the image is pasted in the /static/img directory?

@ferrine
Copy link
Collaborator

ferrine commented Sep 22, 2020

I see your proposal. Looks like you need a per project image folder, not sure how this goes along with current design. Any API you imagine for that use case?

@cheng3100
Copy link

cheng3100 commented Oct 19, 2020

HI @MRog40 , I have similar situation on Jekylly and I fonud a way to work greate.
Just apply this configuration .

let cwd = $PWD . 'static/img'
let g:mdip_imgdir_absolute = cwd
let g:mdip_imgdir_intext = '/static/img'

When you type blog1/test1. It will show as ![blog1/test1](/static/img/blog1/test1.png) in md file and save the picture in $PWD/static/img/blog1/test1.png . The $PWD is where you open vim and can be changed by :cd. It will not change if you just move to another file. So if you just open you vim in the root dir of Hugo and everything will be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants