dingo icon indicating copy to clipboard operation
dingo copied to clipboard

Cover image

Open dinever opened this issue 9 years ago • 5 comments

It would be great if we can implement a cover image field for each post.

  • [x] Cover image text input field in editor page.
  • [ ] Drag & drop upload.

dinever avatar Mar 26 '16 01:03 dinever

For this feature, should user upload cover image to server or just provide cover image URL from any other web sites?

TimothyYe avatar May 21 '16 05:05 TimothyYe

Hi @TimothyYe,

I think we can just add an input field in /view/admin/edit_post.html to indicate a cover image URL first, and implement a drag-and-drop upload feature later.

If you are interested in working on this one, you may find out that there is already an Image field in post.go#L43, and what we need to do is to add a line in post.go#L216 to read image link from form data:

p.Image = r.FormValue("image")

And also add an input field in /view/admin/edit_post.html like this:

<input class="mdl-textfield__input" type="url" name="image" id="image" value="{{ .Post.Image }}">

Thanks!

dinever avatar May 21 '16 11:05 dinever

Sure, I'll take it and try to implement this feature.

TimothyYe avatar May 21 '16 12:05 TimothyYe

@dinever Cover image URL now can be edited & saved in admin panel, I'll create a pull request later.

TimothyYe avatar May 23 '16 05:05 TimothyYe

@TimothyYe Great. Looking forward to it.

dinever avatar May 23 '16 05:05 dinever