mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-25 02:32:52 -05:00
Added logo support
This commit is contained in:
parent
277f1023c9
commit
a6fe4a1516
4 changed files with 46 additions and 18 deletions
|
@ -18,14 +18,6 @@ a:hover {
|
|||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
|
||||
a, a:visited {
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -37,6 +29,7 @@ header {
|
|||
width: 100%;
|
||||
background: #FFF;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
|
||||
#header-inner {
|
||||
max-width: @contentWidth + @headerPadding*2;
|
||||
|
@ -50,6 +43,21 @@ header {
|
|||
padding: 20px;
|
||||
}
|
||||
|
||||
#logo {
|
||||
margin: 20px auto;
|
||||
width: 400px;
|
||||
height: 200px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
|
||||
a, a:visited {
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
|
||||
/*** Setup ***/
|
||||
#setup {
|
||||
background: #DB4141;
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
<body>
|
||||
<header>
|
||||
<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'>
|
||||
<article id='setup'>
|
||||
|
|
13
lib/index.js
13
lib/index.js
|
@ -137,7 +137,8 @@ module.exports = function(config_hash) {
|
|||
res.send(template({
|
||||
name: config.title || "Sinopia",
|
||||
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
|
||||
app.get('/-/search/:query', function(req, res, next) {
|
||||
var results = search.query(req.params.query),
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue