Hugo go go go

Made a hugo setup from scratch to generate a static blog and portfolio webpage.
The old stuff may still be found in static/old.
This commit is contained in:
2022-03-29 22:52:36 +00:00
parent 1e418219e9
commit d64efb5fb4
60 changed files with 658 additions and 33 deletions

View File

@@ -0,0 +1,34 @@
class Comment {
constructor(name, message, id=0) {
this.name = name,
this.message = message,
this.cfid = id
}
toString() {
return this.name+': '+this.message
}
toHtml(elm) {
elm.append('<p class="kommentar"></p>')
$($('.kommentar')[$('.kommentar').length-1]).text(this.toString())
firebase.auth().currentUser?$($('.kommentar')[$('.kommentar').length-1]).append(' &nbsp; <a class="btn btn-primary" href="javascript: remove(\''+this.cfid+'\')">Slett</a>'):undefined
}
}
commentConverter = {
toFirestore: function(comment) {
return {
navn: comment.name,
melding: comment.message
}
},
fromFirestore: function(snapshot, options) {
const data = snapshot.data(options)
return new Comment(
data.navn,
data.melding,
snapshot.id
)
}
}