-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e58b09
commit 7440db5
Showing
5 changed files
with
128 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * | ||
Disallow: | ||
|
||
Sitemap: https://open-bus-map-search.hasadna.org.il/sitemap.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.629Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/dashboard</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/timeline</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/gaps</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/gaps_patterns</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/map</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/single-line-map</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/about</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/public-appeal</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/report-a-bug</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
|
||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il/data-research</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>2024-06-09T12:59:28.630Z</lastmod> | ||
</url> | ||
|
||
</urlset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const sitemap = () => { | ||
const app = fs.readFileSync(path.join(__dirname, "/src/routes/index.tsx"), "utf8"); | ||
const routes = app.match(/'\/[a-z_-]*'/g); | ||
const urls = routes.map((route) => { | ||
const url = route.slice(1, -1); | ||
return url; | ||
}); | ||
|
||
const sitemap = `<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
${urls | ||
.map( | ||
(url) => ` | ||
<url> | ||
<loc>https://open-bus-map-search.hasadna.org.il${url}</loc> | ||
<changefreq>weekly</changefreq> | ||
<priority>0.8</priority> | ||
<lastmod>${new Date().toISOString()}</lastmod> | ||
</url> | ||
` | ||
) | ||
.join("\n")} | ||
</urlset>`; | ||
fs.writeFileSync(path.join(__dirname, "/public/sitemap.xml"), sitemap); | ||
}; | ||
|
||
sitemap(); | ||
|
||
// credit https://blog.redsols.us/blog/how-to-create-a-dynamic-sitemap-in-react/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters