Skip to content

Commit b279743

Browse files
committed
updating npm package
1 parent 347a9e0 commit b279743

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/repo-widget/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "repowidget",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"type": "module",
55
"description": "A lightweight, customizable widget to showcase GitHub repositories on any website",
66
"homepage": "https://www.repowidget.com",

packages/repo-widget/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function createRepoWidget({
66
textStyles = {}, // Optional custom styles for text and icon colors
77
scaleOnHover = 1.05, // Default scale factor on hover; set to 0 or false to disable
88
maxRepos = columns.desktop === 1 ? 10 : columns.desktop * 2, // Default maxRepos is double the desktop column count
9-
sortBy = 'stars', // Sorting parameter; options: "stars", "forks", "size", "name"
9+
sortBy = 'stars', // Sorting parameter; options: "stars", "forks", "size", "name", "updated"
1010
}) {
1111
const repoContainer = document.getElementById(containerId);
1212

@@ -103,6 +103,8 @@ function createRepoWidget({
103103
return repos.sort((a, b) => b.size - a.size);
104104
case 'name':
105105
return repos.sort((a, b) => a.name.localeCompare(b.name));
106+
case 'updated':
107+
return repos.sort((a, b) => new Date(b.updated_at) - new Date(a.updated_at));
106108
default:
107109
return repos;
108110
}

0 commit comments

Comments
 (0)