-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into AboutYouTubeModal
- Loading branch information
Showing
18 changed files
with
137 additions
and
63 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
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
# production | ||
/dist | ||
sitemap.xml | ||
|
||
# misc | ||
.DS_Store | ||
|
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 |
---|---|---|
|
@@ -85,6 +85,7 @@ module.exports = [ | |
'eslint.config.js', | ||
'.nx', | ||
'jest.config.ts', | ||
'sitemap.js', | ||
'public', | ||
], | ||
}, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,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
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 was deleted.
Oops, something went wrong.
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,18 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import { GlobalOutlined } from '@ant-design/icons' | ||
import { useTheme } from '../ThemeContext' | ||
|
||
export const LanguageToggleButton = () => { | ||
const { toggleLanguage } = useTheme() | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<button | ||
className="header-link" | ||
onClick={toggleLanguage} | ||
aria-label={t('Change Language')} | ||
title={t('Change Language')}> | ||
<GlobalOutlined /> | ||
</button> | ||
) | ||
} |
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
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.