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

Leaderboards don't display sites that have dots in the _data filename #639

Closed
Dermah opened this issue Jun 9, 2020 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@Dermah
Copy link
Contributor

Dermah commented Jun 9, 2020

The entry that came in at Performance Rank Number 42 exists in the author's page and the fastestSites.json, but is missing from the Performance Leaderboard. Probably because the site's data filename has a . in it.

A screenshot of the performance leaderboard showing entry 41 and 43. Entry 42 Is missing between the two.

This bug affects a couple of other sites cough one of which is mine cough.

This is the line that populates the information for perf ranks:

{%- set site = perf.url | findSiteDataByUrl(sites) %}

So in the findSiteDataByUrl filter I added a log to see what sites looks like. Most of the key-values in sites look like:

  everylayout:
   { name: 'Every Layout',
     url: 'https://every-layout.dev/',
     description:
      'Through a series of simple, composable layouts, Every Layout will teach you how to better harness the built-in algorithms that power browsers and CSS.',
     twitter: 'layoutplusplus',
     authoredBy: [ 'hankchizljaw', 'heydonworks' ],
     featured: true },

but the object for timseverien's site looks like

  timseverien:
   { com:
      { url: 'https://timseverien.com',
        name: 'Tim Severien’s Blog',
        description: 'A blog about web development and creative coding',
        twitter: 'timseverien',
        source_url: 'https://github.com/timseverien/timseverien.com' } },

I'm guessing this is because their _data/sites/ files is named timseverien.com.json and the object gets pathed by the dots in the filename. Replacing the .'s in the filename with -'s makes the site show up.

The Global Data Files docs mention how to make sub-objects using folders, but I wasn't sure if using dots to achieve the same thing is expected behaviour. Happy to open an issue and PR over in eleventy if this is a bug from there.

This change to how eleventy handles template data folders makes the missing sites appear on the leaderboard.

@zachleat
Copy link
Member

zachleat commented Sep 7, 2020

Going to close this as it’s a duplicate of the bug you filed at 11ty/eleventy#1242 —thank you!

@zachleat zachleat closed this as completed Sep 7, 2020
@zachleat zachleat added the duplicate This issue or pull request already exists label Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants