close #64
This commit is contained in:
parent
d41e4cc047
commit
012cd383a0
File diff suppressed because one or more lines are too long
|
@ -186,7 +186,7 @@ $(document).on('page:browse', function() {
|
||||||
|
|
||||||
if (request.status == 200) {
|
if (request.status == 200) {
|
||||||
$.pjax({
|
$.pjax({
|
||||||
url: data.Location,
|
url: request.Location,
|
||||||
container: '#content'
|
container: '#content'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
{{ if eq $value.HTMLType "textarea" }}
|
{{ if eq $value.HTMLType "textarea" }}
|
||||||
<textarea class="scroll" name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" data-parent-type="{{ $value.Parent.Type }}">{{ $value.Content }}</textarea>
|
<textarea class="scroll" name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" data-parent-type="{{ $value.Parent.Type }}">{{ $value.Content }}</textarea>
|
||||||
{{ else if eq $value.HTMLType "datetime" }}
|
{{ else if eq $value.HTMLType "datetime" }}
|
||||||
<input name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" value="{{ $value.Content.Format "2006-01-02T15:04:05" }}" type="datetime-local" data-parent-type="{{ $value.Parent.Type }}"></input>
|
<input name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" value="{{ $value.Content.Format "2006-01-02T15:04" }}" type="datetime-local" data-parent-type="{{ $value.Parent.Type }}"></input>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<input name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" value="{{ $value.Content }}" type="{{ $value.HTMLType }}" data-parent-type="{{ $value.Parent.Type }}"></input>
|
<input name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" value="{{ $value.Content }}" type="{{ $value.HTMLType }}" data-parent-type="{{ $value.Parent.Type }}"></input>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -135,9 +135,13 @@ func parseCompleteFile() ([]byte, int, error) {
|
||||||
// Removes the main content from the rest of the frontmatter
|
// Removes the main content from the rest of the frontmatter
|
||||||
delete(data.Content, "content")
|
delete(data.Content, "content")
|
||||||
|
|
||||||
|
if _, ok := data.Content["date"]; ok {
|
||||||
|
data.Content["date"] = data.Content["date"].(string) + ":00"
|
||||||
|
}
|
||||||
|
|
||||||
// Schedule the post
|
// Schedule the post
|
||||||
if data.Schedule {
|
if data.Schedule {
|
||||||
t := cast.ToTime(data.Content["date"].(string))
|
t := cast.ToTime(data.Content["date"])
|
||||||
|
|
||||||
scheduler := cron.New()
|
scheduler := cron.New()
|
||||||
scheduler.AddFunc(t.In(time.Now().Location()).Format("05 04 15 02 01 *"), func() {
|
scheduler.AddFunc(t.In(time.Now().Location()).Format("05 04 15 02 01 *"), func() {
|
||||||
|
|
Loading…
Reference in New Issue