Skip to content

Add CNAME and robots.txt to the public folder #309

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

Closed
1 task
obulat opened this issue Jan 20, 2021 · 5 comments · Fixed by #310
Closed
1 task

Add CNAME and robots.txt to the public folder #309

obulat opened this issue Jan 20, 2021 · 5 comments · Fixed by #310
Labels
💻 aspect: code Concerns the software code in the repository 🌟 goal: addition Addition of new feature ✨ goal: improvement Improvement to an existing feature good first issue New-contributor friendly help wanted Open to participation from the community 🟩 priority: low Low priority and doesn't need to be rushed 🏁 status: ready for work Ready for work

Comments

@obulat
Copy link
Contributor

obulat commented Jan 20, 2021

Problem

Currently, Chooser's SEO score in Google Chrome's Lighthouse report is lowered because we don't have a robots.txt file.
Another problem is that we need to copy CNAME file to the docs folder to make sure that the beta Chooser is deployed properly. Currently, it is done using the npm:build script, but it makes the script unnecessarily long, and there is a better solution.

Description

VueJS copies everything from the public directory into the final build directory. We can use this behavior to add robots.txt and simplify the CNAME file copying. There are four things that we need to do:

  1. Create robots.txt file in the public directory with the following content:
User-agent: *
Disallow:

(There is blank space after disallow to allow every page to be crawled)

  1. Copy CNAME file from the docs directory to the public directory.

  2. Simplify the npm:build script to remove the CNAME copying, as it will be copied automatically by VueJS.

  3. Read through the README.md and make changes regarding the build process, if necessary.

Implementation

  • I would be interested in implementing this feature.
@obulat obulat added help wanted Open to participation from the community good first issue New-contributor friendly 🟩 priority: low Low priority and doesn't need to be rushed 🏁 status: ready for work Ready for work 🌟 goal: addition Addition of new feature ✨ goal: improvement Improvement to an existing feature 💻 aspect: code Concerns the software code in the repository labels Jan 20, 2021
@Cronus1007
Copy link
Member

Cronus1007 commented Jan 20, 2021

@obulat Shall I implement this one.
We can implement a bash script to do the same and this will simplify our scripts.

@obulat
Copy link
Contributor Author

obulat commented Jan 20, 2021

@Cronus1007 I think you should finish the current PR before taking on other issues.

Bash scripts only work on Unix machines, so implementing this in a bash script would make our code not cross-platform, and I strongly oppose that.

The solution I describe in the issue description is much simpler, and it simplifies the scripts.

The npm build scripts will change from:
"vue-cli-service build && shx rm -rf ./docs && shx cp -r ./dist ./docs && shx echo chooser-beta.creativecommons.org > ./docs/CNAME"
to
"vue-cli-service build && shx rm -rf ./docs && shx cp -r ./dist ./docs

@rohan-goel
Copy link
Contributor

@obulat I would like to work on this issue.

@Cronus1007
Copy link
Member

@obulat No I am going to implement this issue side by side. So thought of commenting.

Bash scripts only work on Unix machines, so implementing this in a bash script would make our code not cross-platform, and I strongly oppose that.

Yes I agree with this part of yours.

@obulat
Copy link
Contributor Author

obulat commented Jan 20, 2021

@rohan-goel Sure, go ahead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🌟 goal: addition Addition of new feature ✨ goal: improvement Improvement to an existing feature good first issue New-contributor friendly help wanted Open to participation from the community 🟩 priority: low Low priority and doesn't need to be rushed 🏁 status: ready for work Ready for work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants