I don't know why, but GitHub is telling me that my website is developed in JavaScript by 80+% which is absolute nonsense. The site is at least 60% pure Astro code. Is it some kind of a bug?
I saw that you simply removed the files in additional commits. One can do this, but a cleaner way is to use a git rebase or removing files entirely from the history the history is more complex (although the second option needs to be handled with care!).
This leads to smaller repo sizes (& faster git commands!) and prevents users from restoring the deleted files.
And in case you already knew this, I am letting this comment hang around for some folks in the future xD.
I'm aware that it is possible, but I have no experience with Git history manipulation (because I'm afraid I'll break it). But, maybe it is the best solution to clean up commit mess in the repo.
Thank you for your feedback and the articles, it is time for me to learn how to use Git properly XD
You might want to go even further and only allow file types you actually want in your project in the .gitignore file:
# First disallow everything.
*
# Then use exclamation marks to only allow the folders and file types you want to include:
!.gitignore
!.gitattributes
!README.md
!LICENSE.md
!astro.config.mjs
!notes.txt
!package.json
!src/
!src/config.json
!src/*.astro
!src/**/
!src/**/*.astro
You can add folders and file types similarly for other languages. The symbol * can be used as a wildcard, and ** as a recursive wildcard.
pick relevant tages, then you get an url like my example above, copy all and insert in .gitignore file, then add custom rules at the end (e.g.: .wrangler/)
I just want to say thanks for the great comment. This information is something that needs to be said more often. Very good to know and understand how .gitignore files work. It's something I often forget hehe
why would anyone keep those cancer blobs in github, they're just security issues waiting to happen
edit: that isnt meant as a dig at anyone! i mean in a general sense, how did we allow it to happen and for those files to become even common, makes me sad
Interactive python notebooks are useful and used frequently for learning, temporary stuff and in the machine learning field
where else would you store them if not git-track them? Yes they are super annoying to git track but the only other alternative is Google cola and similar sites where you are then also provisioning compute from that platform to run them on some random server
Because you only git-track prod codebases? In most envornoments I worked in we always git tracked basically all code even if nobody other then myself ever even read it.
Astro is a web framework and static site generator build on top of Node.js. The Astro code is simply HTML, CSS and JavaScript under the same document with some tweaks and shortcuts. If you know for example 11ty or Jekyll, it is very similar. Astro allows you develop your website faster, with clear project structure and you can code parts of a website as components, create dynamic layouts and set rules, how your page should generate. In the end during build, Astro compile your entire project to simple, lightweight, pure static .html document.
That is the definition of a javascript framework… a JAVASCRIPT, the github code analysis is just the endings e.g. .js => javascript it doesnt check for framework)
Do you have an example of how you would do this? I have repos that I have to commit both source TS and SCSS and their compiled JS and CSS, but I’d prefer the latter be ignored in some cases because it’s essentially counting the same code twice. Could gitattributes allow me to fix that somehow?
69
u/phenxdesign Aug 03 '26
Not sure .wrangler/ should be push to git... It contains all the js that github counts as source code
37
u/Lots-o-bots Aug 03 '26
you included your .wrangler dir in the repo. it should have been in your .gitignore
3
u/wqonart Aug 03 '26
Thank you all for the feedback. The problem was .wrangler output and it is solved now 🙏🏻
156
u/ferrybig Aug 03 '26
You can click on the labels "JavaScript" and "Astro" to see what it sees as those files:
Your Javascript files are way longer than your Astro files, so it inflates the score for JavaScript (the languages tab is based on line counts)
1
u/throw4w4y40 Aug 07 '26
Am I the only one asking "what the hell is astro?"
8
u/T-J_H Aug 03 '26
Honestly, who cares. But if you want to dive into it, try running linguist yourself
3
u/RenegadeSultaNGG Aug 03 '26
JavaScript in your repo contains more Bytes than Astro. It counts Bytes, not lines of code.
3
u/Minecraft_Lets_Play Aug 03 '26
It’s the file extensions and in many projects you have hidden files that have other extensions that contribute to the few % of other languages.
But in your case… Don’t know
2
u/Wonderful-Writer146 Aug 03 '26
You need to set .gitattributes in order to avoid JS taking taking higher priority. This happens because JS files are of more bytes