passing relpermalink so after edit it goes straight to the page...
This commit is contained in:
parent
0f8c43885b
commit
8386ab5dcf
1 changed files with 11 additions and 2 deletions
|
@ -3,18 +3,27 @@
|
||||||
let v = "loading...";
|
let v = "loading...";
|
||||||
let path = "loading...";
|
let path = "loading...";
|
||||||
|
|
||||||
function generateFrontMatter(frontmatter, path, protocol) {
|
function generateFrontMatter(frontmatter, path, relpermalink, protocol) {
|
||||||
let dvm = document.querySelector('form')
|
let dvm = document.querySelector('form')
|
||||||
|
|
||||||
|
var hiddenRelPath = document.createElement('input')
|
||||||
|
hiddenRelPath.setAttribute('type', 'hidden')
|
||||||
|
hiddenRelPath.setAttribute('name', 'relpermalink')
|
||||||
|
hiddenRelPath.value = relpermalink
|
||||||
|
dvm.prepend(hiddenRelPath)
|
||||||
|
|
||||||
var hiddenPath = document.createElement('input')
|
var hiddenPath = document.createElement('input')
|
||||||
hiddenPath.setAttribute('type', 'hidden')
|
hiddenPath.setAttribute('type', 'hidden')
|
||||||
hiddenPath.setAttribute('name', 'relpath')
|
hiddenPath.setAttribute('name', 'relpath')
|
||||||
hiddenPath.value = path
|
hiddenPath.value = path
|
||||||
dvm.prepend(hiddenPath)
|
dvm.prepend(hiddenPath)
|
||||||
|
|
||||||
var hiddenProtocol = document.createElement('input')
|
var hiddenProtocol = document.createElement('input')
|
||||||
hiddenProtocol.setAttribute('type', 'hidden')
|
hiddenProtocol.setAttribute('type', 'hidden')
|
||||||
hiddenProtocol.setAttribute('name', 'protocol')
|
hiddenProtocol.setAttribute('name', 'protocol')
|
||||||
hiddenProtocol.value = protocol
|
hiddenProtocol.value = protocol
|
||||||
dvm.prepend(hiddenProtocol)
|
dvm.prepend(hiddenProtocol)
|
||||||
|
|
||||||
Object.keys(frontmatter).forEach((fm)=>{
|
Object.keys(frontmatter).forEach((fm)=>{
|
||||||
if (Array.isArray(frontmatter[fm])) {
|
if (Array.isArray(frontmatter[fm])) {
|
||||||
console.log("Array:", frontmatter[fm])
|
console.log("Array:", frontmatter[fm])
|
||||||
|
@ -64,7 +73,7 @@
|
||||||
}
|
}
|
||||||
path = repo.path;
|
path = repo.path;
|
||||||
console.log(JSON.stringify(repo))
|
console.log(JSON.stringify(repo))
|
||||||
generateFrontMatter(repo.frontmatter, path, document.location.protocol.substring(0,4))
|
generateFrontMatter(repo.frontmatter, path, repo.relpermalink, document.location.protocol.substring(0,4))
|
||||||
}
|
}
|
||||||
el.src = `../js/repo/${location.hash.substring(1)}.js`
|
el.src = `../js/repo/${location.hash.substring(1)}.js`
|
||||||
document.body.appendChild(el)
|
document.body.appendChild(el)
|
||||||
|
|
Loading…
Add table
Reference in a new issue