Commit Graph

33 Commits

Author SHA1 Message Date
Ajit Panigrahi d383439c4e perf: update getUniqueTags func for better efficiency
* refactor: getUniqueTags should perform conversions exactly once per tag

Previously, the `forEach` loop was spreading the tags list and updating it on every iteration. So for every post, the slugify operation was happening on previously converted data again.

Similarly, the last filter operation to remove duplicates was repeated for every post (`O(N * log N)`) instead of checking once at the end (`O(N)`).

* feat: Sort the tags in ascending order (lexicographic)

As per feedback from: https://github.com/satnaing/astro-paper/pull/78#issuecomment-1593979458
2023-06-21 10:00:54 +06:30
Sat Naing 27507d1d78 feat: generate og images in png format (#43)
* feat: generate og images in png format

In production mode, generate og images from svg to png format.

fix #40

* refactor: update og image format from svg to png

Update OG image format in post detail to png. Update twitter og images to auto-generated dynamic og
images.
2023-03-01 18:46:42 +06:30
John Hooks bcae985671 fix: slugifyAll typo 2023-02-10 05:30:18 -08:00
Michael Alaev 29e07761f7 refactor: remove unnecessary comments (#25)
Remove unnecessary comments in `src/utils/generateOgImage.tsx`.
2023-02-01 18:40:20 +06:30
satnaing a2f572eadf refactor: refactor relative import to alias 2023-01-28 00:47:59 +06:30
satnaing c19f3a0e5a refactor: update imports and frontmatter types 2023-01-28 00:47:21 +06:30
satnaing 57bf6d77a8 refactor: update getSortedPosts func for blog content collections 2023-01-26 22:43:35 +06:30
satnaing e7b93c560f refactor: modify slugger for blog content collection 2023-01-26 22:42:15 +06:30
satnaing 93221239dd fix: add embedFont option for Satori 2022-12-29 22:07:55 +06:30
Sat Naing ce3f1dc4a0 feat: generate dynamic og image for blog posts (#15)
* feat: add dynamic og image using satori
* feat: add og card styling
* feat: add dynamic paths for ogTitle
* feat: add default og url
* ci: change config site url for testing purpose
* fix: update original auto-generate og image style
* refactor: move ogImage jsx inside generateOgImage
* fix: add conditions for filtering draft posts & ogImages
* build: update minor and major dependency updates
* build: update site option in config file
2022-12-28 09:09:57 +06:30
satnaing 57c3f796d4 feat(a11y): improve voiceover a11y for datetime component
Remove formatDatetime function. Created a JSX function component (FormattedDatetime) inside Datetime
component. This component returns formatted date and time with better voiceover enhancements.
2022-11-26 15:53:26 +06:30
AkaraChen 4d5a560dd4 fix: slug generate 2022-10-28 10:57:11 +08:00
AkaraChen 55425d4504 chore: update github-slugger 2022-10-28 10:33:33 +08:00
Sat Naing 20822c422a chore: format files with prettier 2022-10-16 23:53:16 +06:30
Sat Naing 3f52daf865 Slugify not only frontmatter.title but also frontmatter.slug 2022-09-25 19:27:53 +06:30
Sat Naing 013a3299d6 Reposition slugifyAll import 2022-09-25 19:05:30 +06:30
Sat Naing bd6fb0ac91 Update slugify function with new function slugifyStr 2022-09-25 19:04:59 +06:30
Sat Naing 191798217f Modify slufigy with GithubSlugger 2022-09-25 19:02:18 +06:30
Sat Naing b8b7aaef7d Add filter for draft posts 2022-09-22 23:36:44 +06:30
Sat Naing 300fd568e9 Replace env variable with SITE config object 2022-09-22 21:32:02 +06:30
Sat Naing eb27fbd33c Replace socialLinks array with SOCIALS config 2022-09-22 21:17:56 +06:30
Sat Naing 9e351fe26d Move types definition under src directory 2022-09-22 20:39:51 +06:30
Sat Naing a9464fbbfb Add optional ogImage type in Frontmatter interface 2022-09-21 14:08:04 +06:30
Sat Naing a619529157 Add getPageNumbers function for retrieving page numbers array 2022-09-20 20:48:45 +06:30
Sat Naing 4d2332ddbc Add socialLinks array of object 2022-09-19 12:46:48 +06:30
Sat Naing 30bf56ccf8 Create getPostsByTag util function 2022-09-11 16:39:37 +06:30
Sat Naing 22f21782da Create slugifyAll function for array 2022-09-11 16:39:06 +06:30
Sat Naing 5632b9bcf8 Create getUniqueTags function 2022-09-11 14:08:04 +06:30
Sat Naing 831999ca17 Create slugify function 2022-09-11 14:05:52 +06:30
Sat Naing 15a0bd04c3 Replace internal type with external Frontmatter type 2022-09-11 14:05:17 +06:30
Sat Naing c6c4927638 Extract Frontmatter type 2022-09-11 14:04:25 +06:30
Sat Naing a0d850c130 Create getSortedPosts util function 2022-09-10 16:22:30 +06:30
Sat Naing 4ca7b5c52a Add util function formatDatetime 2022-09-09 23:50:09 +06:30