Prototype links page
This commit is contained in:
parent
304e17ab66
commit
2061680593
7 changed files with 61 additions and 8 deletions
18
assets/js/links.js
Normal file
18
assets/js/links.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const data = get_data()
|
||||
|
||||
function populate_links() {
|
||||
data.links.forEach(link => {
|
||||
const links = document.getElementById('links')
|
||||
links.innerHTML = ''
|
||||
const item = document.createElement('li')
|
||||
const anchor = document.createElement('a')
|
||||
anchor.innerText = link.title
|
||||
anchor.href = link.url
|
||||
item.appendChild(anchor)
|
||||
links.appendChild(item)
|
||||
})
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
populate_links()
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue