Skip to content

Parsing of zenodo badge latestdoi URL creates invalid DOI #27

@dcamron

Description

@dcamron

const zenodo: Resolver = {
test(url) {
return (
url.hostname.endsWith('zenodo.org') &&
!!url.pathname.match(/^\/(?:record|badge\/latestdoi)\//)
);
},
parse(url) {
return `10.5281/zenodo.${url.pathname.replace(/^\/(?:record|badge\/latestdoi)\//, '')}`;
},
};

On all Pythia Cookbooks, we use https://zenodo.org/badge/latestdoi/<github_id> to automate badge link generation for each cookbook before release.

eg for metpy-cookbook, github id 620944317,

https://zenodo.org/badge/latestdoi/620944317

302 redirects to

https://zenodo.org/records/15538696

where the record number is not the same as our github repo id. I believe the snippet above is trying to create invalid DOIs from our github id in our badge links. These DOIs then fail mystmd's DOI link resolution (doi-link-valid) and general link checker (link-resolves).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions