Commit Graph

178 Commits

Author SHA1 Message Date
Sat Naing f0b644de3a feat!: AstroPaper v6 (#631)
* feat: add initial configuration and social icons for AstroPaper theme

* feat: add theme styles and design tokens

* chore: configure Astro with sitemap, i18n, fonts, and tooling

- Set site URL, i18n (single locale, no prefix), sitemap integration
- Add Google Sans Code font via stable fonts API
- Configure Shiki dual-theme markdown (min-light / night-owl)
- Fix astro-paper.config.ts to use relative import (alias not
  available when Vite loads root-level config files)
- Add @astrojs/sitemap and @typescript-eslint/parser dependencies
- Wire @typescript-eslint/parser into ESLint so TypeScript syntax
  in Astro frontmatter (type Props, etc.) parses correctly

* feat: add base styles, dark variant, and typography

- global.css: dark variant via [data-theme], base layer for * / a /
  button selectors, scrollbar tokens, layout utilities (max-w-app,
  app-layout), active-nav as @utility for Tailwind variant support
- html and body classes moved directly onto elements in BaseLayout
  (Tailwind-native approach) so only truly global selectors remain here
- typography.css: prose overrides, Shiki light/dark code block
  switching, diff/highlight/word-highlight transformer styles

* feat: add i18n types, English strings, and useTranslations helper

Plain typed object approach — no third-party i18n library needed.
Paraglide.js was considered but requires SSR output (hard blocker
for a static Astro site).

- UIStrings interface with nav, post, pagination, and a11y groups
- en.ts with `satisfies UIStrings` for literal-type preservation
- useTranslations(locale) helper falls back to English automatically

Adding a new language is a one-file addition; full routing stays
as a registry add-on.

* feat: add client-side theme toggle script

- Reads window.__theme.value set by the inline FOUC-prevention script
  to avoid re-detecting the theme on first load
- Toggles data-theme on <html> and persists to localStorage
- Fills <meta name="theme-color"> with the computed background colour
  so Android's browser chrome matches the page
- Re-runs setup on astro:after-swap for View Transitions navigation
- Carries theme-color across astro:before-swap to prevent navbar
  flicker on Android during page transitions
- Syncs with OS prefers-color-scheme changes at runtime

* feat: add BaseLayout and PostLayout

BaseLayout (replaces scaffold Layout.astro):
- Font, canonical URL via Astro.site, RSS autodiscovery
- FOUC-prevention inline script sets data-theme before first paint
  and exposes window.__theme.value for theme.ts to reuse
- html/body classes on elements directly (Tailwind-native)
- <slot name="head"> for child layout injection
- ClientRouter for View Transitions (respects lightAndDarkMode flag)
- googleVerification rendered from config instead of .env — it is a
  public string, not a secret, and not environment-specific

PostLayout (new):
- Wraps BaseLayout; injects article-specific head content via slot
- Overrides og:type to "article"
- Adds article:published_time / article:modified_time conditionally
- JSON-LD BlogPosting with conditional datePublished/dateModified
  (fixes old bug where absent dates produced "undefined" string)
- Structured data only on actual post pages (not home/archives/tags)

SiteConfig: add optional googleVerification field

* chore: replace scaffold index page with BaseLayout placeholder

* feat: add Header component

* feat: add Footer and Socials component

* chore: install dayjs, slugify, zod, @astrojs/mdx and add MDX integration

* feat: add resolved config that applies defaults in one place

Defaults for posts, features, socials, and shareLinks are merged in
src/config.ts so all consuming code gets non-optional types with no
scattered ?? fallbacks.

* feat: add content schema, blog path, and post utilities

Renames collection blog→posts, moves content to src/content/posts/,
adds .mdx support, and adds a typed pages collection. Includes
getSortedPosts, postFilter, getPath, and slugify utilities.

* feat: add Datetime and Card components

* refactor: switch layouts and components to resolved config

Replaces @/astro-paper.config imports with @/config and removes
optional chaining on feature flags now that the resolved config
guarantees non-optional values.

* feat: add home and footer i18n strings

* feat: implement home page with hero, featured, and recent posts

Replaces the BaseLayout placeholder with the full index page:
hero section with RSS link and social links, featured posts section,
recent posts capped at posts.perIndex, and an All Posts link. All
section labels come from i18n.

* feat: add pagination component

* feat: add Breadcrumb component with locale support

* feat: add Main component

* refactor: update code formatting in Card.astro

* feat: add posts page

* fix: add missing @astrojs/mdx dependency

* refactor: rename meta to pages in i18n

* refactor: improve code formatting in Breadcrumb

* refactor: destructure props in Main component for clarity

* feat: add tag pages

* feat: add About page

* chore: update i18n configuration to use site language from config

* feat: add Archives page

* feat: integrate Pagefind search functionality

* feat: add dynamic Open Graph image generation for posts

* feat: add post detail page

* feat: add Shiki transformers

* chore: remove unused edit link text

* chore: update .gitignore to include generated Pagefind directory

* chore: update site URL in configuration to production link

* chore: replace favicon and remove unused SVG assets, add new Open Graph image

* feat: update site config with default values

* feat: add default OG image path resolution

* fix: ensure edit post feature checks for enabled status correctly

* feat: implement dynamic Open Graph image generation

* feat: add RSS feed generation functionality

* feat: add 404 Not Found page

* feat: add robots.txt generation for SEO optimization

* refactor: change getSortedPosts to a named export

* refactor: change postFilter to a named export

* refactor: rename BaseLayout to Layout

* refactor: standardize locale handling across components

* refactor: update getPostsByGroupCondition location

* chore: remove unused Welcome component

* refactor(i18n): update links using getRelativeLocaleUrl

* refactor(i18n): add dynamic locale loading

* fix: update language attribute to use current locale

* fix: correct wording for updatedAt in post translations

* fix: update layout titles to use correct translation keys for tags pages

* chore: use new colors for better DX and a11y

* feat: add underline icon for active icon nav

* feat: add toc for markdown contents

* refactor: remove unused feature flags in config

* refactor(i18n): enhance locale handling and path management

* fix: ts unused variable hint

* refactor: extract locale stripping logic into a util func

* refactor(i18n): improve locale handling in tag pages

* refactor: update post URL helper functions

* refactor(i18n): replace pathWithBase with getRelativeLocaleUrl for locale handling

* refactor: rename fileWithBase to getAssetPath

* refactor: use runtime agnostic APIs for file paths

* refactor: use transition directive for heading transition

* refactor: remove unused title element from tag page

* fix: decouple ClientRouter from lightAndDarkMode flag

* refactor: rename `postPaths.ts` to `getPostPaths.ts`

* refactor: remove unused `minutesRead` string from post translations

* refactor: simplify AdjacentPostNav component by passing prevPost and nextPost directly

* refactor: remove unused code declaration

* docs: add existing blog posts

* chore: update astro and @astrojs/check dependencies to latest versions

* build: use experimental svg optimizer

* chore(repo): restore project meta files and Docker configs

* refactor: update code formatting with Prettier

* docs: update README and docs

* docs: add JSDoc comments to utility functions

* docs: add JSDoc comments to resolved config file

* fix(og): avoid double slashes when appending index.png

* chore(ci): update Node.js version to 22.12.0 in CI workflow

* feat: improve og image generation with Astro's getFontFileURL API (#632)

* feat: improve og image generation with Astro's getFontFileURL API

- remove @resvg/resvg-js and use sharp to convert SVG to PNG
- update og image generation to use Astro's getFontFileURL API for better font handling

* docs: update README and dynamic OG images documentation

- remove outdated content and clarify dynamic OG image generation process in README.
- add new image example and update instructions for handling non-Latin characters in dynamic OG images.
- adjust copyright year in README to 2026.

* fix(header): adjust icon button alignment in mobile

* feat(docs): add ResponsiveTable to use it in MDX posts (#634)

* feat(docs): add ResponsiveTable to use it in MDX posts

Introduce ResponsiveTable with variant-based styling. Rename docs posts to
.mdx, wrap tables in the component, and remove redundant table `code` rules
from prose typography.

* chore(prettier): ignore .mdx files when checking format

* chore(ci): update Node.js version to 24 in CI workflow

* bump: upgrade Astro and dependencies

* fix: remove redundant backUrl script bug

* fix(header): adjust button and icon alignment

* fix(a11y): improve muted-foreground color contrast

* docs: update predefined color schemes

* chore: support site verification env as fallback for googleVerification

* docs: add astro paper v6 updates in docs

* docs: add AstroPaper-v6.png in astro-paper-6 blog post

* fix: update back-to-top button DOM placement (#641)

Closes #626, #131, #493
2026-05-17 16:17:58 +07:00
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
Sat Naing 7141d82dbd refactor: update component props and improve types (#600)
- stop exporting component Props
- replace interface with type for component Props
- enhance dynamic rendering in several components
2026-01-05 22:56:38 +07:00
Sat Naing f5f863f9d2 fix: improve Tag component by making it entire component clickable (#598)
Update Tag component structure/styles and make the entire
component clickable
2026-01-04 20:43:46 +07:00
Sat Naing 312d1c3eed refactor: improve props usage and dynamic rendering in LinkButton (#599)
- update LinkButton Props by using HTMLAttributes from astro/types
- use dynamic tags for rendering element dynamically
- improve a11y for pagination
2026-01-04 20:37:18 +07:00
Sat Naing ceb406314b refactor: improve semantic by replacing decorative hr with borders (#597)
Replace decorative usage of Hr component with borders to improve
semantic.

- remove Hr component
- replace decorative hr elements with borders
- introduce app-layout utility class
- update layout and spacing
- update docs about border css custom property
2026-01-04 20:24:34 +07:00
Sat Naing a9b9c3acbf fix: remove time from post datetime display (#546) 2025-06-20 23:48:38 +07:00
Sat Naing fa37a477d0 fix: update edit post link styling and text (#545) 2025-06-20 22:49:27 +07:00
Sat Naing f7cb267854 refactor: update tailwind typography css overrides (#538)
* refactor: update tailwind typography css overrides

Update TailwindCSS typography overrides to use less
`important`; and update selectors to make them easier
to read.

* refactor: update focus styles to be consistent
2025-06-14 23:44:03 +07:00
Sat Naing 38ebf6e1b6 feat: add RTL language support (#531)
* feat: add RTL language support

- Add `SITE.dir` config option.
- Replace physical Tailwind classes with logical
property classes.

Resolves #439

* docs: add `dir` section in doc
2025-06-14 00:07:27 +07:00
Sat Naing 0cc647c3d3 fix: improve back-to-top button to adapt layout changes properly (#527)
Update back-to-top button to accommodate properly,
even if the max-width of the blog post is updated.
Uses `fixed` position on mobile and `sticky` position
on large screens.
2025-06-10 08:04:45 +07:00
Sat Naing 5f72b93d92 refactor: extract redundant max-width into utility (#525)
* refactor: extract redundant max-width into utility

Extract redundant max-width into a universal tailwind
utility class. By doing so, the width of the layout
in different pages can be customized easily.

* docs: update docs for modifying `max-w-app` utility
2025-06-09 11:42:33 +07:00
Sat Naing 4d01654471 feat: improve back-to-top button behavior (#520)
Make the back-to-top button appear based on 
scroll position_ improving accessibility and UX.
2025-06-06 13:39:31 +07:00
kakomonn bd948604be fix: add types for constants to avoid type errors when empty (#501)
Add types for `constants` to avoid type errors
when either `SOCIALS` or `SHARE_LINKS` is empty.

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2025-06-05 23:31:37 +07:00
Alexey Poimtsev 21bcca85ac fix: update heading alignment and font-size (#473)
* fix: update heading title to be smaller on mobile

* fix: vertical alignment in heading title

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2025-06-05 12:46:32 +07:00
Sat Naing 793eafa965 fix: adjust nav bar alignment in heading (#492) 2025-03-22 17:22:38 +07:00
Sat Naing 5cff7c50b9 feat: add global and per-post timezone support (#491)
* refactor: replace embedded svg with svg icon

* feat: add global and per-post timezone support

- add `SITE.timezone` in config to define a global default timezone.
- allow per-post timezone overrides via `timezone` in frontmatter.
- update date formatting logic to use the correct timezone when rendering timestamps.
- ensure that posts without a timezone fallback to `SITE.timezone`.
- improve consistency between local and deployed timezones.

* refactor: replace `LOCALE` constant with  `SITE.lang`

* docs: update guides

* fix: update code word-break inside markdown table

Closes #466
2025-03-22 17:21:21 +07:00
Sat Naing 2774045045 fix: broken editPost link and update editPost logic (#487)
* fix: broken editPost link and update editPost logic

Fixed broken editPost link. Removed the ability to update
the editPost link inside each blog post for consistency.
The editPost button per blog post can still be hidden.

* docs: update docs for editPost
2025-03-20 12:41:58 +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 67b9536cce refactor: replace secHeading with variant prop in Card 2025-03-18 07:57:07 +07:00
Alexey Poimtsev 673c00969e fix: align vertically in header nav (#460) 2025-03-09 16:58:19 +07:00
satnaing 39ed4898a3 fix: show light/dark button according to site setting 2025-03-08 18:21:37 +07:00
satnaing 79c7df45e5 feat: update back button logic
Instead of saving back url in the param, save the
back url info inside session.
2025-03-08 18:21:37 +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 172e14b5f4 build!: upgrade to Tailwind CSS v4 2025-03-08 18:21:37 +07:00
George Zhao a56b28bc2c fix: use tag name for display in tags page (#438)
Instead of slugified tags, original tag names will
be used for displaying tag names in the tags page.
2025-02-08 11:52:36 +07:00
Sébastien Monterisi 63fe796eac fix: focus search input on mount (#414) 2024-12-29 16:04:20 +07:00
Erison Silva cac8ba05f4 fix: replace twitter with x (#407) 2024-11-05 18:12:10 +07:00
Erison Silva ec1060978c feat: add pencil icon before suggestion changes text (#405)
* feat: Add pencil icon before suggestion changes text

* fix: update class to className and adjust icon scale

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2024-10-29 13:00:13 +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
Patrick Wilson 0bc8eeeac8 feat: add edit post feature in blog posts (#384)
* feat: add edit post feature

* fix: remove edit button except on post detail pages

* docs: update site config docs for editPost

Resolves #191
---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2024-10-11 18:14:17 +07:00
Timon Jurschitsch 08b1676cdd refactor: replace pagination logic with Astro built-in pagination (#376) 2024-09-16 13:05:50 +07:00
Sat Naing 6bbe177566 chore: upgrade ESLint to v9 and update configurations (#356)
* chore: upgrade ESLint to v9 and update configurations

Upgrade ESLint and configure and update ESLint rules.

* refactor: update code to comply with new ESLint v9 rules
2024-08-19 12:58:16 +07:00
Sat Naing 8762650c60 fix(a11y): remove aria-labels from non-interactive elements (#346)
Remove aria-label from `<h1>` of 404 page and disabled LinkButton.

Resolves #263
2024-08-04 14:50:31 +07:00
Sat Naing be172efa17 refactor: update tailwind classes to v3 syntax (#345)
Updated background/border opacity to the new syntax:
- border-skin-fill border-opacity-40 => border-skin-fill/40
- selection:bg-skin-accent selection:bg-opacity-70 => selection:bg-skin-accent/70
2024-08-04 10:49:13 +07:00
87xie 227fcf21e7 refactor: avoid using unnecessary class-name in the pagination component (#274) 2024-07-14 15:59:27 +07:00
87xie e252506493 fix: avoid undefined when passing class-name as prop (#270)
- avoid `undefined` when passing class-name as prop
- use built-in `class:list` directive
2024-07-14 15:21:49 +07:00
Parinya T 25a640b728 fix: display Updated in posts only when modDatetime > pubDatetime (#258)
* refactor: show update time when modDatetime more recently than pubDatetime

* fix: show wrong date when compare with null modeDate

* refactor: modDatetime type checking & rewrite myDatetime
2024-02-19 10:38:43 +06:30
面条 b3a1d9d369 fix: add trailing slash to links to avoid extra redirects (#246)
Add trailing slash to links for improved consistency with RSS links and to avoid unnecessary redirects.

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
2024-01-25 10:24:28 +06:30
satnaing a7abab4372 refactor: update code formatting with prettier 2024-01-24 09:23:16 +06:30
Mario Davó 742314e0ac fix: remove extra padding if lightAndDarkMode is false (#230)
Remove the extra "right-padding" inside the header search icon when lightAndDarkMode is false so UI is consistent.
This is done by including <li> tag inside if statement
2024-01-12 22:03:19 +06:30
satnaing 940deb6d3f fix(a11y): resolve accessibility issues
A11y Improvements
- add screen-reader only texts
- remove autoFocus on search box
- replace disabled link with span text in LinkButton
2024-01-09 15:49:50 +06:30
satnaing 43f716054b fix: update twitter ShareLink title 2024-01-08 15:16:49 +06:30
immodded 1e2c5e82d8 feat: add share links in blog post (#215)
* Add share links

* refactor: update and rename Sharebutton to ShareLinks

- rename SOCIALS to shareLinks to avoid confusion with `src/config.ts > SOCIALS`
- fix type error related with shareLinks
- add `linkTitle` in shareLinks for better accessibility
- update styles to looks good in all devices

* refactor: place ShareLinks next to `back to top`

- place ShareLinks at the bottom (next to `back to top`)
- update styles for ShareLinks and Back to Top button

---------

Co-authored-by: Sat Naing <satnaingdev@gmail.com>
2024-01-08 15:11:10 +06:30
May Kittens Devour Your Soul 1b4164226a refactor: update breadcrumbs delimiter to "»" (#213) 2024-01-06 23:43:18 +06:30
satnaing d929ce1fef fix: solve modDatetime type errors
Update modDatetime props type to have null type for components that have modDatetime as props.
2024-01-05 10:32:31 +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