Start integrating Hugo in the new plugin
This commit is contained in:
26 files changed
+837
-2497
No files matched your search
@@ -0,0 +1,26 @@
|
||||
|
||||
hugo.schedule = function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
let date = document.getElementById('date').value;
|
||||
if(document.getElementById('publishDate')) {
|
||||
date = document.getElementById('publishDate').value;
|
||||
}
|
||||
|
||||
buttons.setLoading('publish');
|
||||
|
||||
let data = JSON.stringify(form2js(document.querySelector('form'))),
|
||||
headers = {
|
||||
'Kind': document.getElementById('editor').dataset.kind,
|
||||
'Schedule': 'true'
|
||||
};
|
||||
|
||||
webdav.put(window.location.pathname, data, headers)
|
||||
.then(() => {
|
||||
buttons.setDone('publish');
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e);
|
||||
buttons.setDone('publish', false)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user