-
Notifications
You must be signed in to change notification settings - Fork 6
/
post_edit.tmpl
61 lines (61 loc) · 2.47 KB
/
post_edit.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{{define "content"}}
<form method="POST" class="post-form">
<input type="hidden" name="token" value="{{.token}}">
<p>
<label for="id_title">Title</label>
<input type="text" name="title" value="{{.ptitle}}" maxlength="200" required id="id_title">
</p>
<p>
<label for="id_slug">Permalink:</label>
<input type="text" name="slug" value="{{.url}}" required id="id_slug">
<span class="helptext">eg: 'why-i-like-bears'</span>
</p>
<p>
<label for="id_canonical_url">Canonical url (optional):</label>
<input type="text" name="canonical_url" id="id_canonical_url" value="{{.canonical}}">
<span class="helptext">
<a href='https://ahrefs.com/blog/canonical-tags/#what-is-a-canonical-tag' target='_blank'>Learn more</a>
</span>
</p>
<p>
<label for="id_published_date">Date:</label>
<input type="date" name="published_date" value="{{.timestamp | Stamp}}" id="id_published_date">
<span class="helptext">eg: '2021-03-31' (leave empty to post now)</span>
</p>
<p>
<label for="id_content">Content (markdown):</label>
<textarea name="content" cols="40" rows="20" required id="id_content">{{.body}}</textarea>
{{if EnableStackEdit}}
<span class="helptext">
<button type="button" onclick="openStackEditor('content');">Markdown editor</button>
</span>
|
{{end}}
<span class="helptext">
<a href='https://www.markdownguide.org/cheat-sheet/' target='_blank'>Markdown cheatsheet</a>
</span>
|
<span class="helptext">
<a href='https://www.iemoji.com/emoji-cheat-sheet/all' target='_blank'>Emoji cheatsheet</a>
</span>
</p>
<p>
<label for="id_tags">Tags:</label>
<input type="text" name="tags" id="id_tags" value="{{.tags}}">
<span class="helptext">A comma-separated list of tags.</span>
</p>
<p>
<label for="id_is_page">Is page:</label>
<input type="checkbox" name="is_page" id="id_is_page" {{if .page}}checked{{end}}>
</p>
<p>
<label for="id_publish">Publish:</label>
<input type="checkbox" name="publish" id="id_publish" {{if .published}}checked{{end}}>
</p>
<button type="submit" class="save btn btn-default">Save</button>
</form>
<p>
<a href="/{{.url}}?preview=true" target="_blank">Preview post</a> |
<a href="/dashboard/posts/{{.id}}/delete">Delete post</a>
</p>
{{end}}