Open dinever opened 8 years ago
For this feature, should user upload cover image to server or just provide cover image URL from any other web sites?
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!
Sure, I'll take it and try to implement this feature.
@dinever Cover image URL now can be edited & saved in admin panel, I'll create a pull request later.
@TimothyYe Great. Looking forward to it.
It would be great if we can implement a cover image field for each post.