Skip to content

Commit

Permalink
add favico
Browse files Browse the repository at this point in the history
  • Loading branch information
0xvoidmain committed Feb 13, 2019
1 parent 70c65f8 commit 7154c4c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>TomoMaster APIs</title>

<link rel="shortcut icon" href="source/images/favico.ico" />
<style>
</style>
<link rel="stylesheet" media="screen" href="pub/css/screen.css">
Expand Down
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,17 @@ function render(inputStr, options, callback) {
return '<img src="'+imageSource+'" class="' + className + '" alt="' + altText + '">';
}
};
locals.favico = function(image) {
var imageSource = "source/images/favico.ico";
if (image) {
imageSource = "source/images/" + image;
}
if (globalOptions.inline) {
var imgContent = safeReadFileSync(path.join(__dirname, imageSource));
imageSource = getBase64ImageSource(imageSource, imgContent);
}
return '<link rel="shortcut icon" href="' + imageSource + '" />';
};
locals.logo_image_tag = function () {
if (!globalOptions.logo) return locals.image_tag('logo.png', 'Logo', 'logo', true);
var imageSource = path.resolve(process.cwd(), globalOptions.logo);
Expand Down
Binary file added source/images/favico.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion source/layouts/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ under the License.
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><%= current_page.data.title || "API Documentation" %></title>
<%- favico() %>
<style>
</style>
<%- stylesheet_link_tag('screen','screen') %>
Expand Down

0 comments on commit 7154c4c

Please sign in to comment.