fix: make successful build if missing favicon (#5290)

This commit is contained in:
Alexey Pyltsyn 2021-08-05 11:43:14 +03:00 committed by GitHub
parent 33b88ab717
commit bc6c67720a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -60,7 +60,7 @@ function theme(context) {
renderOpenSearchTemplate({
title,
url: url + baseUrl,
favicon: normalizeUrl([url, baseUrl, favicon]),
favicon: favicon ? normalizeUrl([url, baseUrl, favicon]) : null,
}),
);
} catch (err) {

View file

@ -12,7 +12,9 @@ module.exports = `
<ShortName><%= it.title %></ShortName>
<Description>Search <%= it.title %></Description>
<InputEncoding>UTF-8</InputEncoding>
<% if (it.favicon) { _%>
<Image width="16" height="16" type="image/x-icon"><%= it.favicon %></Image>
<% } _%>
<Url type="text/html" method="get" template="<%= it.url %>search?q={searchTerms}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="<%= it.url %>opensearch.xml" />
<moz:SearchForm><%= it.url %></moz:SearchForm>