Added logo support
This commit is contained in:
parent
277f1023c9
commit
a6fe4a1516
|
@ -18,14 +18,6 @@ a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
a, a:visited {
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +29,7 @@ header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
#header-inner {
|
#header-inner {
|
||||||
max-width: @contentWidth + @headerPadding*2;
|
max-width: @contentWidth + @headerPadding*2;
|
||||||
|
@ -50,6 +43,21 @@ header {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
margin: 20px auto;
|
||||||
|
width: 400px;
|
||||||
|
height: 200px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
a, a:visited {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*** Setup ***/
|
/*** Setup ***/
|
||||||
#setup {
|
#setup {
|
||||||
background: #DB4141;
|
background: #DB4141;
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<div id='header-inner'>
|
<div id='header-inner'>
|
||||||
<h1><a href='/'>{{ name }}</a></h1>
|
{{#if logo}}
|
||||||
|
<a href='/'><img id='logo' alt='{{ name }}' title='{{ name }}' src='/-/logo' /></a>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class='center'>
|
<div class='center'>
|
||||||
<article id='setup'>
|
<article id='setup'>
|
||||||
|
|
13
lib/index.js
13
lib/index.js
|
@ -137,7 +137,8 @@ module.exports = function(config_hash) {
|
||||||
res.send(template({
|
res.send(template({
|
||||||
name: config.title || "Sinopia",
|
name: config.title || "Sinopia",
|
||||||
packages: packages,
|
packages: packages,
|
||||||
baseUrl: config.root || req.protocol + '://' + req.get('host') + '/'
|
baseUrl: config.root || req.protocol + '://' + req.get('host') + '/',
|
||||||
|
logo: config.logo
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -242,6 +243,16 @@ module.exports = function(config_hash) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.get('/-/logo', function(req, res, next) {
|
||||||
|
if(config.logo) {
|
||||||
|
res.sendfile(config.logo);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res.status(404);
|
||||||
|
res.send("File Not Found");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
app.get('/-/search/:query', function(req, res, next) {
|
app.get('/-/search/:query', function(req, res, next) {
|
||||||
var results = search.query(req.params.query),
|
var results = search.query(req.params.query),
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue