kopia lustrzana https://github.com/FacilMap/facilmap
Add OpenSearch
rodzic
e96e259ab7
commit
b5be1ce382
|
@ -32,7 +32,9 @@ module.exports = function() {
|
|||
}
|
||||
|
||||
if (file.isBuffer()) {
|
||||
var $ = cheerio.load(String(file.contents));
|
||||
var $ = cheerio.load(String(file.contents), {
|
||||
xmlMode: mime.lookup(file.path) == "application/xml"
|
||||
});
|
||||
|
||||
$('img').each(function() {
|
||||
$(this).attr('src', replacePath($(this).attr('src'), file));
|
||||
|
@ -42,6 +44,10 @@ module.exports = function() {
|
|||
$(this).attr('href', replacePath($(this).attr('href'), file));
|
||||
});
|
||||
|
||||
$('OpenSearchDescription Image').each(function() {
|
||||
$(this).text(replacePath($(this).text(), file));
|
||||
});
|
||||
|
||||
file.contents = new Buffer($.html());
|
||||
|
||||
return callback(null, file);
|
||||
|
|
|
@ -107,7 +107,10 @@ gulp.task("all", [ "deps", "app" ], function() {
|
|||
concat("all.css"),
|
||||
sourcemaps.write("./sourcemaps")
|
||||
),
|
||||
gulp.src("deref.html")
|
||||
combine(
|
||||
gulp.src([ "deref.html", "opensearch.xml" ]),
|
||||
img64()
|
||||
)
|
||||
),
|
||||
gulp.dest("build")
|
||||
);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<meta name="robots" content="index,nofollow" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<link rel="shortcut icon" href="assets/img/favicon.png">
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="FacilMap" href="https://facilmap.org/opensearch.xml">
|
||||
<!-- inject:css -->
|
||||
<!-- endinject -->
|
||||
<style type="text/css">
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
|
||||
<ShortName>FacilMap</ShortName>
|
||||
<Description>A fully-featured OpenStreetMap-based map where markers and lines can be added with live collaboration.</Description>
|
||||
<Image width="16" height="16" type="image/png">assets/img/favicon.png</Image>
|
||||
<Url type="text/html" template="https://facilmap.org/#q={searchTerms}" />
|
||||
<moz:SearchForm>https://facilmap.org/</moz:SearchForm>
|
||||
</OpenSearchDescription>
|
Ładowanie…
Reference in New Issue