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

Allow selecting static files in MarkdownEditor #565

Merged
merged 5 commits into from
Mar 1, 2020

Conversation

ashmaroli
Copy link
Member

This adds a new button to the MarkdownEditor (with icon paperclip). Clicking the button triggers the staticfilepicker modal.
On selecting a file the editor gets updated depending on the file extension,
If an image file was selected, Markdown image tag is inserted else a Markdown link tag is inserted.

Irrespective of the file-type selected, the injected Markdown includes the static-file's relative_path enclosed in a Liquid object with Jekyll's relative_url filter.
For example, if static-file assets/logo.png is selected, then the inserted Markdown will be:

![]({{ 'assets/logo.png' | relative_url }})

Closes #501

@ashmaroli ashmaroli merged commit 3defeb1 into jekyll:master Mar 1, 2020
@ashmaroli ashmaroli deleted the mdeditor-pick-staticfile branch March 1, 2020 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Select image from static files in the text editor.
2 participants