Skip to content
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

KANBAN-490 #1257

Merged
merged 6 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ package-lock.json
/dist
/build
/src/dist
/src/public/sitemap.xml
/src/public/main-sitemap.xml
/public/sitemap.xml
/public/robots.txt
/public/main-sitemap.xml
/src/resourceDescriptors.js

# IDEs and editors
Expand Down
130 changes: 0 additions & 130 deletions apps/main-app/webpack.config.babel.js

This file was deleted.

28 changes: 28 additions & 0 deletions bin/build_robots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const fs = require('fs');
const env = process.env.NODE_ENV;
const directory = './public';
const filename = 'robots.txt';

const PROD_CONTENT = `User-agent: *
Allow: /
Disallow: /search
Disallow: /alliancemine
Disallow: /jbrowse
Sitemap: https://www.alliancegenome.org/sitemap.xml
Sitemap: https://www.alliancegenome.org/api/sitemap.xml`;

const OTHER_CONTENT = `# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow: /
`;

const content = env === 'production' ? PROD_CONTENT : OTHER_CONTENT;

console.log(`writing to... ${directory}/${filename}`)
fs.writeFile(`${directory}/${filename}`, content, (err) => {
if (err) {
console.error('Error writing robots.txt file:', err);
} else {
console.log('robots.txt file written successfully');
}
});
4 changes: 2 additions & 2 deletions bin/build_sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var sitemapindex = sm.buildSitemapIndex({
]
});

fs.writeFileSync('src/public/sitemap.xml', sitemapindex.toString());
fs.writeFileSync('public/sitemap.xml', sitemapindex.toString());

var sitemap = sm.createSitemap({
hostname: 'https://www.alliancegenome.org',
Expand All @@ -29,4 +29,4 @@ var sitemap = sm.createSitemap({
]
});

fs.writeFileSync('src/public/main-sitemap.xml', sitemap.toString());
fs.writeFileSync('public/main-sitemap.xml', sitemap.toString());
121 changes: 0 additions & 121 deletions libs/app-shell/src/lib/sitemap.js

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"test": "react-scripts test",
"eject": "react-scripts eject",
"prebuild": "npm run resource-descriptors",
"postbuild": "npm run sitemap",
"postbuild": "npm run sitemap && npm run robots",
"robots": "node bin/build_robots.js",
"sitemap": "node bin/build_sitemap.js",
"resource-descriptors": "node bin/build_resource_descriptors.js"
},
Expand Down
File renamed without changes
3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

31 changes: 0 additions & 31 deletions src/public/index.html

This file was deleted.

Loading