-
Notifications
You must be signed in to change notification settings - Fork 478
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
fix: update Twitter URL and improve functionality/fix: resolved various data and calculation errors #996
base: main
Are you sure you want to change the base?
Conversation
- Fixed an issue in `calculateDailyIncrease`, ensuring correct time range calculation - Added a check for `values.length < 2` before computing daily increase - Fixed `totalSize` handling to avoid errors with empty data - Improved error handling for `axios` requests - Added API response format validation to prevent failures - Fixed `getWeekNumber` logic for correct week number calculation - Improved JSON file handling to prevent overwriting with corrupted data - Added additional logs for better error diagnostics Node size data is now processed and saved correctly.
- Enhanced `sanitizeSlug` function to support Unicode and properly clean special characters - Fixed `splitTitleIntoLines` logic to prevent text loss and improve line splitting - Added validation to check if the template image exists before processing (`generateSocialCard`) - Improved error handling and logging for better debugging - Optimized MDX file processing by ensuring changes are written only when necessary - Improved directory processing to recursively handle all subdirectories
Updated the Twitter URL from https://twitter.com to https://x.com to reflect the platform's rebranding.
@sergeypanin1994 is attempting to deploy a commit to the Consensys Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sergeypanin1994. Just the one thing to catch — TIL how week numbering works 😅
I'll tag in @sammysango to take a look at the social card function.
}; | ||
|
||
// Helper function to get week number | ||
function getWeekNumber(d) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to retain line 31 in this function otherwise there's a risk that week numbering will be wrong. The ISO system uses Thursday as an anchor day (hence the +4
, where 0
is Monday, the week start) to ensure that the week 1 is actually the first week of the year that has at least 4 days in the calendar year. See here.
@sergeypanin1994 Card script improvements looking great! One question, for this point: Fixed As far as I can tell, this removes the logic that handles long titles by truncating them with I don't think this actually affects any of the docs/cards at their current title length, but it'd be preferable to retain as a safeguard against future lengthy titles, if they occur. |
fix: update Twitter URL and improve functionality
sanitizeSlug
function to support Unicode and clean special characterssplitTitleIntoLines
logic to prevent text lossgenerateSocialCard
fix: resolved various data and calculation errors
calculateDailyIncrease
time range calculationvalues.length < 2
in daily increase computationtotalSize
handling to avoid empty data errorsaxios
request error handling and added API response validationgetWeekNumber
logic for accurate week number calculationNode size data is now processed and saved correctly.