Adding robots.txt override via admin control panel
This is a requested low priority feature in #418 - I created the changes to follow similarly to how the Instance Description is handled.
This commit is contained in:
parent
4b104879cd
commit
993532bc1f
10 changed files with 62 additions and 1 deletions
|
|
@ -488,7 +488,14 @@ export class ClientServerService {
|
|||
});
|
||||
|
||||
fastify.get('/robots.txt', async (request, reply) => {
|
||||
return await reply.sendFile('/robots.txt', staticAssets);
|
||||
if (this.meta.robotsTxt) {
|
||||
let content = '';
|
||||
content += this.meta.robotsTxt;
|
||||
reply.header('Content-Type', 'text/plain');
|
||||
return await reply.send(content);
|
||||
} else {
|
||||
return await reply.sendFile('/robots.txt', staticAssets);
|
||||
}
|
||||
});
|
||||
|
||||
// OpenSearch XML
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue