-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: generate sitemap #790
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7440db5
feat: make us SEO compatible (#745)
EtayZaslavsky b1c58d7
fix: added eslint ignore from sitemap.xml
EtayZaslavsky c68b46e
fix: removed sitemap.xml from repo, and added it to gitignore
EtayZaslavsky 35c886e
Merge branch 'main' of https://github.com/hasadna/open-bus-map-search…
EtayZaslavsky 6cb4c7e
Merge branch 'main' into feat/make-us-seo-compatible
NoamGaash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ module.exports = [ | |
'eslint.config.js', | ||
'.nx', | ||
'jest.config.ts', | ||
'sitemap.js', | ||
], | ||
}, | ||
] |
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> |
NoamGaash marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ignore this file on git, it's autogenerated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also delete this file