2019-07-28 20:49:01 +00:00
|
|
|
'use strict'
|
2019-06-27 20:36:43 +00:00
|
|
|
const {
|
|
|
|
a,
|
|
|
|
body,
|
|
|
|
head,
|
|
|
|
html,
|
|
|
|
link,
|
2019-06-30 19:59:32 +00:00
|
|
|
meta,
|
2019-06-27 20:36:43 +00:00
|
|
|
nav,
|
2019-06-30 18:56:20 +00:00
|
|
|
main,
|
2019-06-27 20:36:43 +00:00
|
|
|
title
|
|
|
|
} = require('hyperaxe')
|
|
|
|
|
|
|
|
var doctypeString = '<!DOCTYPE html>'
|
|
|
|
|
2019-06-30 19:59:32 +00:00
|
|
|
const toAttributes = (obj) =>
|
|
|
|
Object.entries(obj).map(entry =>
|
|
|
|
`${entry[0]}=${entry[1]}`
|
|
|
|
).join(', ')
|
|
|
|
|
2019-06-27 20:36:43 +00:00
|
|
|
module.exports = (...elements) => {
|
2019-06-29 20:24:44 +00:00
|
|
|
const nodes =
|
|
|
|
html({ lang: 'en' },
|
|
|
|
head(
|
2019-08-14 00:45:14 +00:00
|
|
|
title('🏝️ Oasis'),
|
2019-06-29 20:24:44 +00:00
|
|
|
link({ rel: 'stylesheet', href: '/assets/style.css' }),
|
2019-06-30 19:59:32 +00:00
|
|
|
link({ rel: 'stylesheet', href: '/highlight/github.css' }),
|
|
|
|
meta({ name: 'description', content: 'friendly neighborhood scuttlebutt interface' }),
|
|
|
|
meta({ name: 'viewport', content: toAttributes({ width: 'device-width', 'initial-scale': 1 }) })
|
2019-06-27 20:36:43 +00:00
|
|
|
),
|
2019-06-29 20:24:44 +00:00
|
|
|
body(
|
|
|
|
nav(
|
|
|
|
a({ href: '/' }, 'home'),
|
2019-07-26 17:06:47 +00:00
|
|
|
a({ href: '/mentions' }, 'mentions'),
|
2019-06-29 20:24:44 +00:00
|
|
|
a({ href: '/profile' }, 'profile'),
|
|
|
|
a({ href: '/status' }, 'status'),
|
|
|
|
a({ href: 'https://github.com/fraction/oasis' }, 'source'),
|
|
|
|
a({ href: 'https://github.com/fraction/oasis/issues/new' }, 'help')
|
|
|
|
),
|
2019-06-30 18:56:20 +00:00
|
|
|
main({ id: 'content' }, ...elements)
|
2019-06-29 20:24:44 +00:00
|
|
|
)
|
2019-06-27 20:36:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const result = doctypeString + nodes.outerHTML
|
|
|
|
|
|
|
|
return result
|
|
|
|
}
|