Commit Graph

48 Commits

Author SHA1 Message Date
Timon Jurschitsch 08b1676cdd refactor: replace pagination logic with Astro built-in pagination (#376) 2024-09-16 13:05:50 +07:00
Xuân Nghĩa 28f886b4d6 fix(og): add the missing SITE.website to loadGoogleFonts (#360) 2024-09-08 14:48:09 +07:00
Alejandro Ñáñez Ortiz 2b617b20a3 refactor: replace github-slugger with lodash.kebabcase (#357)
Previously, `github-slugger` omitted emojis when generating slugs, transforming tags like "🌱-my-tag" into "-my-tag". This change replaces `github-slugger` with `lodash.kebabcase` to ensure that emojis are preserved in the generated slugs, improving the accuracy and consistency of tag representations.
2024-08-19 12:52:59 +07:00
u8b19 2f82febff4 fix: resolve non-latin char issue in generated OG images (#318)
Changes made
- update font source with Google font
- add error handling in font fetching logic
- update docs in dynamic-og-images blog post

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2024-07-27 14:36:52 +07:00
David Legrand 3efa05cc10 feat: hide posts in Prod with future pubDatetime (#234)
* Hide posts when PubDateTime is not reached

* refactor: extract filter logic into a file

* docs: update SITE config docs

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2024-01-15 19:40:02 +06:30
Sat Naing 581826a5af feat: add pagination in tag posts (#201)
* feat: add pagination in tag posts

Implement pagination in tag posts. Refactor and extract pagination logic and pagination component.

Closes: #152

* fix: update breadcrumbs for updated tag pagination
2023-12-29 10:26:02 +06:30
Sat Naing b05b8fb842 feat: replace slugified title with unslugified tag name (#198)
Update slugified titles to be unslugified in the tag page. This is for better SEO and better a11y. Url and tag elelemnts will still be slugified.

Closes: #179
2023-12-28 14:16:40 +06:30
Sat Naing 2827d4e7d8 refactor: replace postSlug with Astro content slug
* refactor: replace postSlug with Astro content slug

Remove postSlug from blog schema. Refactor articles that use postSlug. Remove slugify function from slugify util file. Replace slugify logic with Astro's content collections slug logic.

Closes: #186

* docs: update docs for removed slugify contents

* refactor: remove unused import
2023-12-27 10:20:55 +06:30
Sat Naing 80e67a1dca feat: add modified datetime in blog posts
* feat: add modified datetime in blog posts

Add modDatetime in blogSchema. Update Datetime component to accept modDatetime. Update sorting logic. Rename datetime to pubDatetime in Datetime component.

Closes: #134

* feat: add published_time & modified_time meta tags

* docs: update related blog posts to be up-to-date

* fix: remove extra spaces in breadcrumbs
2023-12-26 10:11:26 +06:30
tanishqmanuja 3032c18321 feat: generate og image using templates 2023-09-26 02:04:11 +06:30
tanishqmanuja 80fcc93954 feat: use post author in og template 2023-09-26 02:04:11 +06:30
tanishqmanuja 4380a7b290 refactor: og templates 2023-09-26 02:04:11 +06:30
tanishqmanuja 1cc51c00a7 refactor: use astro generated CollectionEntry type 2023-09-26 02:04:11 +06:30
satnaing 1933a6beae fix: update auto-gen OG images to allow special char usage in title
Update the implementation of og image generation code to allow special character usage in title.

fix #103, fix #88
2023-09-26 02:04:11 +06:30
satnaing e486687610 feat: upgrade to astro v3
Upgrade to astro v3. Update dependencies. Fix codes and features due to migration.

BREAKING CHANGE: Astro v3

resolve #111
2023-09-26 02:04:11 +06:30
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