Commit Graph

58 Commits

Author SHA1 Message Date
Sat Naing fb63d96011 fix: slugify supports better acronyms and preserve non-latin char (#606)
* fix: slugify supports better acronyms and preserve non-latin char

Update slugify function to handle better acronyms and preserve non-latin characters.
- uses slugify (simov) for Latin-only strings to fix acronym issue (eg: e2e-testing)
- uses lodash.kebabcase for strings with non-latin characters to preserve them

* fix: remove dots in slugified titles for view transitions

Fixes #584
2026-01-14 05:20:25 +07:00
Sebastian Arrieta c5a34c7838 fix: skip invalid code block metadata without key-value pairs (#561)
This ensures compatibility with transformers like `transformerMetaHighlight`, which may include metadata without key-value formatting.

Previously, metadata entries without an = would cause [key, value] to be undefined, potentially introducing invalid entries into the map. We now skip such entries to ensure only valid key-value pairs are parsed.
2025-07-20 00:13:44 +07:00
Sat Naing c863c8219d feat: enhance file name transformer with additional options (#555)
- Add v2 badge-style option as alternative to v1 tab-style
- v2 features: border, rounded corners, positioned with CSS custom property
- v1 features: tab-style with rounded top corners, muted background
- Add hideDot option to control green dot indicator visibility
- Include comprehensive JSDoc documentation with usage examples
- Support both styling variants with configuration parameters
2025-07-09 23:35:41 +07:00
Sat Naing cb8a4794be feat: add file name transformer for fenced code blocks (#535)
* feat: add file name transformer for fenced code blocks

* chore: update file names in fenced code blocks
2025-06-14 00:14:07 +07:00
satnaing feaf5e122a feat: allow blog posts to be organized by subdirectories
Blog posts can now be structured into subdirectories, which determine their slugs.

Example:
- `/src/data/blog/2025/testing.md` → `/posts/2025/testing`

Directories prefixed with `_` will be excluded from the slug.

Example:
- `/src/data/blog/_examples/tailwind-typography.md` → `/posts/tailwind-typography`

Closes #470, #366
2025-03-18 07:57:07 +07:00
satnaing a4a5ced8a6 fix: correct Google Fonts API URL construction for proper weight fetching 2025-03-09 17:54:05 +07:00
Pujan Modha e08618ad3c fix: add font-weight param in og image card style (#453) 2025-03-09 16:50:00 +07:00
Sat Naing 35429176e0 refactor!: remove react dependency for UI interactions (#457)
Remove react as a dependency for UI interactions.
Update jsx components such as Search and Datetime
with astro components.
2025-03-08 18:21:37 +07:00
satnaing 53c79dd4c1 refactor: update import alias in files 2025-03-08 18:21:37 +07:00
Patrick Wilson 7573617e79 feat: add archives page with configurable menu (#386)
* feat: add archives page with configurable menu

* optimize: compat mobile layout

* fix: update archive menu layout

* fix: hide archives page from URL if showArchives is false

* docs: add `showArchives` option in docs

Resolves #361

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2024-10-14 18:49:40 +07:00
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