denoland / dotland

[Archived] deno.land website
https://deno.land
MIT License
957 stars 626 forks source link

wrong readme selected to be shown #2069

Closed panva closed 2 years ago

panva commented 2 years ago

Expectation: When present, the root readme file is rendered in favour of other subpath-present readme files.

Reality: The first README.md file found in the dir listing regardless of it being in a subpath is used.

See https://deno.land/x/doauth where docs/README.md file is used, instead of the README.md in the root of the project.

crowlKats commented 2 years ago

the reason this happens is because we have special handling to also use docs/ & .github/ READMEs. maybe we should prioritize root README, and then go to those aforementioned directories

panva commented 2 years ago

maybe we should prioritize root README, and then go to those aforementioned directories

I agree. If you'd point me to the right place I'd give a PR a shot.

crowlKats commented 2 years ago

maybe we should prioritize root README, and then go to those aforementioned directories

I agree. If you'd point me to the right place I'd give a PR a shot.

https://github.com/denoland/dotland/blob/main/util/registry_utils.ts#L336-L351, this is the function that finds the readme

panva commented 2 years ago

Alright, I can give replace that find with a filter, then sort (root first, then docs, then .github?) and take the first one present?