1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-09-19 18:57:30 +00:00

Add JavaScript licenses page

This commit is contained in:
Cadence Ember 2021-04-16 16:31:54 +12:00
parent 998bd3d7cb
commit 6f8e03e506
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
7 changed files with 46 additions and 1 deletions

View File

@ -7,5 +7,10 @@ module.exports = [
const mobile = userAgent.toLowerCase().includes("mobile")
return render(200, "pug/home.pug", {mobile})
}
},
{
route: "/js-licenses", methods: ["GET"], code: async () => {
return render(200, "pug/js-licenses.pug")
}
}
]

View File

@ -43,4 +43,4 @@ html
h3.footer__colhead About
ul.footer__list
li: a(href="/privacy") Privacy policy
// li: a(href="/js-licenses") JavaScript licenses
li: a(href="/js-licenses" data-jslicense=1) JavaScript licenses

22
pug/js-licenses.pug Normal file
View File

@ -0,0 +1,22 @@
extends includes/layout.pug
block head
title JavaScript license information
block content
main.js-licenses-page
h1 JavaScript license information
table#jslicense-labels1
thead
tr
th(scope="col") File
th(scope="col") License
th(scope="col") Source
tbody
each path of static.keys()
if path.match(/^html\/static\/js\/.*\.js$/)
- const file = path.replace(/^html/, "")
tr
td: a(href=file)= file
td: a(href="http://www.gnu.org/licenses/agpl-3.0.html") GNU-AGPL-3.0-or-later
td: a(href=file)= file

View File

@ -66,3 +66,16 @@ details
&[open] summary
margin-bottom: 16px
table
background-color: c.$bg-darker
table, td, th
border: 1px solid c.$edge-grey
border-collapse: collapse
td, th
padding: 4px 8px
thead, tr:nth-child(even)
background-color: c.$bg-darkest

View File

@ -0,0 +1,3 @@
.js-licenses-page
max-width: 600px
margin: 0 auto

View File

@ -9,6 +9,7 @@
@use "includes/settings-page.sass"
@use "includes/cant-think-page.sass"
@use "includes/privacy-page.sass"
@use "includes/js-licenses-page.sass"
@use "includes/forms.sass"
@use "includes/nav.sass"
@use "includes/footer.sass"

View File

@ -18,6 +18,7 @@ const {setInstance} = require("pinski/plugins")
server.addPugDir("pug", ["pug/includes"])
server.addRoute("/cant-think", "pug/cant-think.pug", "pug")
server.addRoute("/privacy", "pug/privacy.pug", "pug")
server.addRoute("/js-licenses", "pug/js-licenses.pug", "pug")
server.addStaticHashTableDir("html/static/js")
server.addStaticHashTableDir("html/static/js/elemjs")