Skip to content

Commit

Permalink
Revert "Remove sites without a category" / fix the underlying bug (#6518
Browse files Browse the repository at this point in the history
)

* Revert "make parentSpan args optional in source-node (#6513)"

This reverts commit f6fdb12.

* Revert "Remove sites without a category (#6515)"

This reverts commit 67cee1b.

* Check if categories exist first
  • Loading branch information
KyleAMathews committed Jul 18, 2018
1 parent c939809 commit dc03e31
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 9 deletions.
64 changes: 64 additions & 0 deletions docs/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@
featured: false
categories:
- Marketing
- title: Beach Hut Poole
main_url: 'https://www.beachhutpoole.co.uk/'
url: 'https://www.beachhutpoole.co.uk/'
featured: false
- title: Bricolage.io
main_url: 'https://www.bricolage.io/'
url: 'https://www.bricolage.io/'
Expand Down Expand Up @@ -1031,6 +1035,66 @@
categories:
- News
- Technology
- title: Smakosh (source)
featured: false
- title: Philipp Czernitzki - Blog/Website
featured: false
- title: WebGazer
featured: false
- title: Joe Seifi's Blog
featured: false
- title: Bartosz Dominiak Blog/Portfolio (source)
featured: false
- title: HBTU MUN 2018 (source)
featured: false
- title: Jamie Henson's Blog (source)
featured: false
- title: Ruben's Blog (source)
featured: false
- title: Thao Am Private Enterprise
featured: false
- title: Bakadono
featured: false
- title: Travellers.cafe
featured: false
- title: Oliver Benns' Portfolio (source)
featured: false
- title: angeloocana.com (source)
featured: false
- title: Overlap.show (source)
featured: false
- title: smartive Company Website
featured: false
- title: Haboba Find Jobs at Phu Quoc Island
featured: false
- title: Song Wang’s website (source)
featured: false
- title: Magicly's blog (source)
featured: false
- title: Phu Quoc Works
featured: false
- title: Kabir Goel's website (source)
featured: false
- title: David James' Portfolio (source)
featured: false
- title: Tic Tac Toe AI (source)
featured: false
- title: Random Screencast
featured: false
- title: Phu Quoc Tea & Coffee Store
featured: false
- title: Steven Natera's blog
featured: false
- title: LekoArts - Graphic Designer
featured: false
- title: Georgi Yanev (source)
featured: false
- title: Hallingdata
featured: false
- title: '@swyx (source)'
featured: false
- title: 伊撒尔の窝
featured: false
- title: 杨二小的博客
main_url: 'https://blog.yangerxiao.com/'
url: 'https://blog.yangerxiao.com/'
Expand Down
20 changes: 11 additions & 9 deletions www/src/views/showcase/filtered-showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ class FilteredShowcase extends Component {
// create map of categories with totals
const aggregatedCategories = data.allSitesYaml.edges.reduce(
(categories, edge) => {
edge.node.categories.forEach(category => {
// if we already have the category recorded, increase count
if (categories[category]) {
categories[category] = categories[category] + 1
} else {
// record first encounter of category
categories[category] = 1
}
})
if (edge.node.categories) {
edge.node.categories.forEach(category => {
// if we already have the category recorded, increase count
if (categories[category]) {
categories[category] = categories[category] + 1
} else {
// record first encounter of category
categories[category] = 1
}
})
}

return { ...categories }
},
Expand Down

0 comments on commit dc03e31

Please sign in to comment.