add favicon and OpenGraph image

This commit is contained in:
D. Scott Boggs 2023-10-05 07:29:48 -04:00
parent 67aa1be4a0
commit 2b07401d28
4 changed files with 15 additions and 2 deletions

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View file

@ -7,8 +7,9 @@
<meta property="og:title" content="Tech Workers' Syndicate" /> <meta property="og:title" content="Tech Workers' Syndicate" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:url" content="https://techwork.zone/"> <meta property="og:url" content="https://techwork.zone/">
<meta property="og:image" content="/pfp.png" />
<meta property="og:description" <meta property="og:description"
content="Matrix space: matrix.to/#/#tws:matrix.org; blog.techwork.zone; Mastodon: @syndicate@tams.tech; Bluesky: @techwork.zone; Source code: git.techwork.zone" /> content="Chat: matrix.to/#/#tws:matrix.org; blog.techwork.zone; Mastodon: @syndicate@tams.tech; BlueSky: @techwork.zone; Source code: git.techwork.zone" />
<title>Tech Workers' Syndicate</title> <title>Tech Workers' Syndicate</title>
<style> <style>
html, html,

View file

@ -3,8 +3,20 @@ const { Server } = require('http')
async function main() { async function main() {
const webPage = await readFile('index.html', { encoding: 'utf-8' }) const webPage = await readFile('index.html', { encoding: 'utf-8' })
const pfp = await readFile('pfp.png')
const favicon = await readFile('favicon.ico')
const server = new Server( const server = new Server(
(_, res) => res.writeHead(200, {'Content-Type': 'text/html'}).end(webPage) (req, res) => {
if (req.url === '/pfp.png')
req.writeHead(200, { 'Content-Type': 'image/png' })
.end(pfp)
else if (req.url === '/favicon.ico')
req.writeHead(200, { 'Content-Type': 'image/vnd.microsoft.icon' })
.end(favicon)
else
res.writeHead(200, { 'Content-Type': 'text/html' })
.end(webPage)
}
) )
server.listen(1312, () => { server.listen(1312, () => {

BIN
pfp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB