Compare commits
2 Commits
a0e4db0d08
...
6b72450c24
Author | SHA1 | Date | |
---|---|---|---|
6b72450c24 | |||
0e71c26051 |
@ -1,10 +1,15 @@
|
||||
{
|
||||
"name": "mma_website_docker",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"description": "Generic Website",
|
||||
"author": "Mahesh Asolkar <mahesh@mahesha.com>",
|
||||
"main": "website.js",
|
||||
"scripts": {
|
||||
"start": "node website.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.heshapps.com/asolkar/mma-website.git"
|
||||
}
|
||||
}
|
||||
|
19
siteinfo.js
19
siteinfo.js
@ -18,6 +18,25 @@ module.exports = {
|
||||
ret.title = process.env.SITE_TITLE;
|
||||
}
|
||||
|
||||
// Links on the site header
|
||||
var links = [];
|
||||
if (("SITE_LINK_NAME_1" in process.env) && ("SITE_LINK_URL_1" in process.env)) {
|
||||
links.push({'name': process.env.SITE_LINK_NAME_1, 'url': process.env.SITE_LINK_URL_1});
|
||||
}
|
||||
if (("SITE_LINK_NAME_2" in process.env) && ("SITE_LINK_URL_2" in process.env)) {
|
||||
links.push({'name': process.env.SITE_LINK_NAME_2, 'url': process.env.SITE_LINK_URL_2});
|
||||
}
|
||||
if (("SITE_LINK_NAME_3" in process.env) && ("SITE_LINK_URL_3" in process.env)) {
|
||||
links.push({'name': process.env.SITE_LINK_NAME_3, 'url': process.env.SITE_LINK_URL_3});
|
||||
}
|
||||
if (("SITE_LINK_NAME_4" in process.env) && ("SITE_LINK_URL_4" in process.env)) {
|
||||
links.push({'name': process.env.SITE_LINK_NAME_4, 'url': process.env.SITE_LINK_URL_4});
|
||||
}
|
||||
if (("SITE_LINK_NAME_5" in process.env) && ("SITE_LINK_URL_5" in process.env)) {
|
||||
links.push({'name': process.env.SITE_LINK_NAME_5, 'url': process.env.SITE_LINK_URL_5});
|
||||
}
|
||||
ret.links = links;
|
||||
|
||||
return ret;
|
||||
},
|
||||
site_ga_stub: function (req) {
|
||||
|
13
website.js
13
website.js
@ -17,7 +17,7 @@ function getPage(req) {
|
||||
|
||||
console.log(`Serving route ${route}`);
|
||||
|
||||
return `<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
var page = `<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
|
||||
<title>${website.title}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
@ -255,7 +255,14 @@ function toggle_play () {
|
||||
</script>
|
||||
</head><body onload="initialize()">
|
||||
<div id="nav_strip">
|
||||
<a href="${website.url}" title="Home">Home</a>
|
||||
<a href="${website.url}" title="Home">Home</a>`;
|
||||
|
||||
website.links.forEach((lnk) => {
|
||||
page += `
|
||||
• <a href="${lnk.url}" title="${lnk.name}">${lnk.name}</a>`;
|
||||
});
|
||||
|
||||
page += `
|
||||
</div>
|
||||
<div id="osc_txt">
|
||||
${website.name}
|
||||
@ -280,6 +287,8 @@ ${ga_tracking_stub}
|
||||
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user