Skip to content

Commit

Permalink
✨ Add support for robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jan 22, 2021
1 parent ecfada6 commit 6ec7d61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions post-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const postProcess = async () => {
let config: {
"status-website"?: {
cname?: string;
robotsText?: string;
baseUrl?: string;
};
} = load(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any;
Expand All @@ -23,6 +24,13 @@ export const postProcess = async () => {

if (config["status-website"] && config["status-website"].cname)
await writeFile(join(".", "__sapper__", "export", "CNAME"), config["status-website"].cname);

if (config["status-website"] && config["status-website"].robotsText)
await writeFile(
join(".", "__sapper__", "export", "robots.txt"),
config["status-website"].robotsText
);

await copyFile(
join(".", "__sapper__", "export", "service-worker-index.html"),
join(".", "__sapper__", "export", "404.html")
Expand Down

0 comments on commit 6ec7d61

Please sign in to comment.