website/src/layouts/Main.astro
Moritz Huber 17ba055ed4
update astro to 4 (#1)
* build(deps): bump json5 from 2.2.1 to 2.2.3

Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): update patch dependencies

* build(deps): update minor dependencies

* build(deps): bump @astrojs/rss to 2.0.0

* perf: test font performance

* Revert "build(deps): bump @astrojs/rss to 2.0.0"

This reverts commit 9840cf7b66.

* perf: update font load strategy for better performance

* docs: add lighthouse score in README

* build(deps): bump @types/react from 18.0.26 to 18.0.27

* build(deps): bump commitizen from 4.2.6 to 4.3.0

* build(deps): bump astro and its packages to v2

BREAKING CHANGE: Migration of Astro to version 2

* chore: add .astro directory in .gitignore

* chore: add new script cmd 'astro sync'

* chore(types): update astro types

* chore: add content collections configuration

* refactor: define blog schema and clean up config

* refactor: remove Frontmatter type

* refactor: modify slugger for blog content collection

* refactor: update getSortedPosts func for blog content collections

* refactor: update frontmatter type and change React to Astro

* refactor: update fetch method and frontmatter type

* revert: revert back to JSX Card component

* refactor: move blog posts under content directory

* feat: define blog schema and add blog collection

* refactor: refactor relative import to alias

* refactor: update imports and frontmatter types

* refactor: refactor relative import to alias

* refactor: update datetime prop type to string and date

* refactor: refactor relative imports to aliases

* fix: resolve initial onChange input value bug

URL and search results don't get updated when input box value is removed after reload the page. Fix
this problem.

* refactor: update to AstroV2 and remove headings on search result

Update imports and types according to Astro v2 content collections. Remove headings on search result
for better search accuracy.

* refactor: update querying logic with content collections api

* refactor: update collection type and new schema property name

* refactor: update for new content collection api

* fix: exclude draft posts in specific tag page

* fix: make the last part of breadcrumb lowercase in specific tag page

* fix: fix broken tags in PostDetails page

* refactor: remove unnessary types and refactor excluding draft

Exclude types of postResult and pagePaths  which can be inferred. Filtered draft posts in
getCollection function.

* refactor: move filtering draft to getCollection func

* refactor: update blog schema's author to be optional

* refactor: rename blogCollection to blog

* refactor: update blog schema by removing ogImage alt

* docs: add caution about forestry discontinuing

* refactor: mark featured and draft properties as optional

* refactor: update ogImage.src to ogImage

* refactor: add default tag if no tag is specified in post

* refactor: remove unnecessary comment

* docs: add a blog link to predefined color schemes

* refactor: remove extra blog post

* docs: add external ogImage url information

* docs: update frontmatter properties for AstroPaper v2

* build: exclude README from prettier ignore list

* docs: update README for AstroPaper v2

* docs: add AstroPaper v2 release blog post

* docs: mark as featured and add search logic paragraph

* feat: add new predefined color scheme 'astro dark'

* docs: add info about new predefined color scheme

* docs: add main image in astro-paper-2 blog post

* style: add Tailwind prettier plugin

* style: format styles with Tailwind Prettier plugin

* docs: add info about automatic class sorting feat

* build(deps): update patch dependencies

* refactor: change default dark theme

* docs: add AstroPaper 2 dark theme lower contrast

* fix: update card bg color

* docs: update card bgColor in lower contrast new dark theme

* docs: update OG/desc image and info of predefined color scheme

* chore: add env type file

* docs: add AstroPaper v1 docs and live url

* chore(release): 2.0.0

* docs: update CHANGELOG

* fix: make schema(s) strict (#23)

If schema(s) are made with strict, it will disallow extra keys in the markdown frontmatter.

* docs: fix typo in blog post (#24)

Change spelling of criteria.

* refactor: remove unnecessary comments (#25)

Remove unnecessary comments in `src/utils/generateOgImage.tsx`.

* feat: add ESLint and update linting errors (#26)

* Install ESLint and Astro ESLint plugin

* Configure 2 plugins

* Improve ignore files

* Add lint script

* Install astro-eslint-parser

* Add parser and fix linting errors

* docs: mention eslint in README (#29)

* style: format README markdown

* build(deps): bump astro 2.0.4 to 2.0.6

* chore(linting): ignore dist folder when linting

* build(deps): update patch dependencies

Bump astro from 2.0.6 to 2.0.8. Bump prettier from 2.8.3 to 2.8.4. Bump lint-staged from 13.1.0 to
13.1.1.

* build(deps): update minor dependencies

Bump @typescript-eslint/parser from 5.50.0 to 5.51.0. Bump satori from 0.1.2 to 0.2.3.

* chore(release): 2.1.0

* docs: update CHANGELOG

* fix: slugifyAll typo

* fix: add plugin-search-dir in prettier write for pnpm

Fix error 'No parser could be inferred for file' (#34)

* fix: correct typo in blog posts

Fix typo (#35)

* fix: add plugin-search-dir in format & format:check

* build(deps): bump undici from 5.16.0 to 5.19.1

Bumps [undici](https://github.com/nodejs/undici) from 5.16.0 to 5.19.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.16.0...v5.19.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* 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.

* build(deps-dev): add jampack for performance optimization (#46)

Add new package "jampack" to devDependencies to optimize performance for production build.

* refactor: remove unnecessary pseudo styles in svg

* build(deps): update Astro to v2.1.3 and enable type checking in dev

Bump Astro from v2.0.8 to v2.1.3. Enable TypeScript type checking during development.

* chore(deps-dev): update dev dependencies

* chore(deps): update dependencies

* refactor: add type to SITE object for better type safety

* refactor: replace astro.config site value with SITE.website

* chore(release): 2.2.0

* docs: update CHANGELOG

* fix: sort rss feed from latest to oldest (#38)

* Sorted the rss feed from latest to oldest. Which is crucial for RSS readers.

* sorted rss using util func

* refactor: remove redundant draft filter and update import positions

---------

Co-authored-by: Saif71 <>
Co-authored-by: Sat Naing <satnaingdev@gmail.com>

* fix: build error astro@2.1.4 && update astro@2.1.5 (#49)

* fix: build error astro@2.1.4 && update astro@2.1.5

* fix: remove @scripts from tsconfig.json

* refactor: update imports paths

* chore(dev-deps): update linting and prettier packages

* style: format file with prettier

* feat: add locale configuration for Datetime component (#59)

* fix: update lint-staged configuration

Configure lint-staged to format only non-image files while making a commit.

fix #52

* fix: update menu element with svg and refactor toggle logic

Replace div element in menu button with svg. Refactor toggle-menu JS logic to be more concise.

* refactor: update LinkButton role type

Fix Subtype missing error on 'a' element.

* fix(ignore): added yarn directories to ignorefiles

Added yarn files and directories to gitignore and eslintignore.

* Fix: slugify tags in post detail page

* fix: tailwind jsdoc for intellisense

* fix: replace history entries when searching (#62)

* refactor: update slugify logic inside the component itself

* fix: add missing sitemap in head (#69)

* perf: memoize fuse search results with useMemo (#71)

Memoise the value of fuse based off of the search list to prevent reinstantiating it on search keypress.

* chore: add jsx compiler option in tsconfig

* chore(patch-deps): update prettier, lint-staged, astro/react and astro/tailwind

* chore(deps): update dependencies

* chore(release): 2.3.0

* build(deps): bump vite from 4.3.5 to 4.3.9

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.5 to 4.3.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.3.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump fast-xml-parser from 4.0.11 to 4.2.4

Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.0.11 to 4.2.4.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* 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

* chore: update dependencies

* style: format files with prettier

* build: update lint-staged to only format certain file types

resolved #79

* build(deps): bump semver from 6.3.0 to 6.3.1

Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump fast-xml-parser from 4.2.4 to 4.2.6

Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.2.4 to 4.2.6.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.2.4...v4.2.6)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: #72 replace SITE.website with a URL in astro.config site value

Using SITE.website in astro.config.mjs causes the problem . Thus, change back to the original url string in site value of .

Closes: #72

* docs: add a blog post for updating AstroPaper and dependencies

Add an article to show how to update project dependencies and AstroPaper template.

resolve #68

* docs: add a blog post for adding estimated reading time

Add an article for adding estimated reading time. #74

resolve #74

* docs: update "adding new post" tutorial with...

...info about canonical URLs

* feat: support custom canonical URLs (#83)

Adding an optional attribute in the posts' frontmatter that allows the user to set a custom canonical URL

* docs: update schema code in docs for new canonicalURL property

* fix: sort posts in [tag] page (#101)

* fix: sorted posts in tags page

* fix(css): text wrap in code blocks

* fix: update title of the blog nowrap

* feat: update theme-color tag on theme switch

* chore: add astro prettier plugin

* feat: upgrade to astro v3

Upgrade to astro v3. Update dependencies. Fix codes and features due to migration.

BREAKING CHANGE: Astro v3

resolve #111

* feat: add ViewTransitions from Astro

Integrate ViewTransitions API from Astro v3.

resolve #96

* refactor: display only non-featured posts in Recent Section

* chore: upgrade to astro v3.1

Upgrade astro version from v3.0.13 to v3.1 to solve the issue of ViewTransitions api not working properly on prod mode.

* 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

* fix: update tailwind base styles config (#116)

* feat: add transition effect if light/dark changes

* feat: add view transitions for card on search page (#118)

* feat: use predictable slug for card transition

* feat: enable view transitions in search card

* refactor: use Card.tsx instead of Card.astro

* refactor: handle card styling in component

* refactor: remove unused class name

---------

Co-authored-by: Sat Naing <satnaingdev@gmail.com>

* fix: prevent white flash in dark mode when navigate

* fix: resolve single-line code block wrapping issue (#121)

white-space should be pre-wrap - or else, a single long line of code block may break the layout of whole page on mobile devices

use word break for code and blockquote, white-space: pre for fenced code

* refactor: use astro generated CollectionEntry type

* refactor: move schema to config file

* feat: add image validation to schema

* feat: default post author to site author

* refactor: post slug routing

* fix: og image src

related to: 3e0109c12e708351df60df7b938e8bcc07807540

* chore: remove unused file

* refactor: og templates

* feat: use post author in og template

* fix: remove empty string as ogImage

* fix: get og image url correctly

* chore: remove unused file

* feat: generate og image using templates

* feat: og image routes

* feat: use new og images in layout

* build: remove astro check cmd in dev script

* style: update nav list style to be more flexible

* docs: update README for v3

Update file structure section. Add concurrent command running method for Windows PowerShell users.
Update footer credit to acknowledge the contributions of other contributors.

resolve #113

* docs: update docs for astro-papaer v3

Make docs articles up to date with the latest version of AstroPaper. Add a section for storing
images for blog posts. Rename rec-2 to example-draft-post and update its content.

resolve #117

* docs: update reading-time post for astro-paper v3

* docs: update generated svg image to generated OG image

* docs: add AstroPaper v3 release blog post

* docs: remove AstroPaper-2 post from featured posts

* docs: add upgrade section for AstroPaper v3

* docs: add a new theme and add main image in v3 post

* chore: update dependencies and format code

* chore(release): 3.0.0

* feat: dynamically generate robots.txt

* fix: anchor oveflow on small screen size

* fix(layout): use 100svh for min-height on body instead of 100vh

Address a mobile layout issue where using 100vh caused unexpected behavior. Switching to 100svh
resolves this problem by accounting for the mobile browser's UI components. This change ensures a
consistent and improved user experience on smaller screens.

resolves #127

* refactor: update site URL to be single source of truth (#143)

* wip: astro config to use .ts instead of .mjs

* fix: remove invalid prop in astro config

* refactor: single source of truth for site url

* refactor: make minor updates due to astro.config.ts

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>

* build(deps): bump postcss from 8.4.29 to 8.4.31

Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.29...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: solve invisible text code block issue in light-mode (#163)

* fix: pre > code font color

Co-authored-by: Nomango <nomango@qq.com>
Co-authored-by: shuaixr <1025sxr@gmail.com>

* refactor: extend other css properties besides typography

Update theme extend to include other properties like textColor etc, to clarify confusion.

---------

Co-authored-by: shuaixr <1025sxr@gmail.com>
Co-authored-by: Sat Naing <satnaingdev@gmail.com>

* build(deps): bump undici from 5.24.0 to 5.26.3

Bumps [undici](https://github.com/nodejs/undici) from 5.24.0 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.24.0...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @babel/traverse from 7.22.17 to 7.23.2

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.17 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump sharp from 0.32.5 to 0.32.6

Bumps [sharp](https://github.com/lovell/sharp) from 0.32.5 to 0.32.6.
- [Release notes](https://github.com/lovell/sharp/releases)
- [Changelog](https://github.com/lovell/sharp/blob/main/docs/changelog.md)
- [Commits](https://github.com/lovell/sharp/compare/v0.32.5...v0.32.6)

---
updated-dependencies:
- dependency-name: sharp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump vite from 4.4.9 to 4.5.1

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.9 to 4.5.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.1/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: decode unicode tag chars in breadcrumb (#175)

* feat: add docker-compose file (#174)

* feat: Add docker-compose file

- Add `docker-compose.yml` file
- Add docker commands into the README.md file

Close #172

* docs: update README for style consistency

---------

Co-authored-by: Erison Silva <erison.silva@power.cloud>
Co-authored-by: Sat Naing <satnaingdev@gmail.com>

* feat: implement back-to-top button in blog post page

Implement back-to-top button under tags in PostDetails page. Update html scroll-behavior to smooth.

Closes: #156

* fix: #133 update LOCALE config to cover overall locales

Update LOCALE inside config.ts to include html lang value and datetime locale values. Updated respective files and blog post.

Closes: #133

* build(deps): bump zod, astro and @astrojs/sitemap

Bumps [zod](https://github.com/colinhacks/zod) to 3.22.4 and updates ancestor dependencies [zod](https://github.com/colinhacks/zod), [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) and [@astrojs/sitemap](https://github.com/withastro/astro/tree/HEAD/packages/integrations/sitemap). These dependencies need to be updated together.


Updates `zod` from 3.21.1 to 3.22.4
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Changelog](https://github.com/colinhacks/zod/blob/master/CHANGELOG.md)
- [Commits](https://github.com/colinhacks/zod/compare/v3.21.1...v3.22.4)

Updates `astro` from 3.1.3 to 3.6.4
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@3.6.4/packages/astro)

Updates `@astrojs/sitemap` from 3.0.0 to 3.0.3
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/sitemap/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/sitemap@3.0.3/packages/integrations/sitemap)

---
updated-dependencies:
- dependency-name: zod
  dependency-type: indirect
- dependency-name: astro
  dependency-type: direct:production
- dependency-name: "@astrojs/sitemap"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* 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

* 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

* 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

* 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

* refactor: reduce main layout content margin bottom

* build!(deps): upgrade Astro and related packages to v4

Bump astro v3.6.4 to v4.0.9 (major upgrade). Bump astrojs/rss v3.0.0 to 4.0.1 (major upgrade). Upgrade other astro related packages.

BREAKING CHANGE: Astro v4 upgrade

Closes: #187

* build(deps): upgrade dependencies

* fix: update rss pubDate to prioritize modDatetime if exists

* refactor: enable scroll-smooth only in post detail page

* feat: add code-snippets for content creation (#206)

* Create astro-paper.code-snippets

* feat: allow nullable modDatetime

this is needed to allow the snippet to work with a blank date time, and is a precursor of adding in a modified date time setting hook

* Update astro-paper.code-snippets to make feat false by default

* docs: #205 update estimated-reading-time article

Fix typo. Update await files in getSortedPosts.

Closes: #205

* docs: add new color scheme for AstroPaper v4

* style: remove unnecessary margin

* docs: adds an article about git hook date setting (#211)

* feat: adds post on git hook date setting

* fix: make necessary adjustments and fix typo

---------

Co-authored-by: Sat Naing <satnaingdev@gmail.com>

* docs: add  an AstroPaper v4 announcement post

* chore(release): 4.0.0

* fix: solve modDatetime type errors

Update modDatetime props type to have null type for components that have modDatetime as props.

* refactor: update breadcrumbs delimiter to "»" (#213)

* feat: add copy buttons for code blocks (#217)

* feat: copy button on snippet code

* refactor: update func name, styles and refactor backToTop

Rename the function name `copyButton` to `attachCopyButtons`. Update copy button styles. Fix broken `backToTop` function by attaching `astro:after-swap` event listener.

---------

Co-authored-by: Sat Naing <satnaingdev@gmail.com>

* 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>

* fix: update twitter ShareLink title

* docs: updates the hook post with a smarter updateHook (#222)

* refactor: remove SocialObjects type and update SocialObjects type

- remove SocialMedia type from src/types.ts
- generate each social icon type from socialIcons object instead

* docs: adds blog post for how to add a social icon (#221)

* docs: adds blog post for how to add a social icon

* refactor: update the blog post

---------

Co-authored-by: Sat Naing <satnaingdev@gmail.com>

* 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

* build(deps): update Astro and its related dependencies

* build(deps): upgrade dependencies

* chore(release): 4.1.0

* 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

* feat: add heading links to PostDetails page (#232)

- implement easy links to headings (h2-h6) on post details
- the links are aria-hidden and only show on hover

* 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>

* fix: reduce margin-bottom on markdown images (#235)

* Disable margin bottom on image

The result is better on images with caption defined as: 
```
![alt text](/path/to/img)
*caption*
```

* refactor: combine mt and mb into my-2

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>

* fix: resolve broken line break in inline code (#237)

* fix: remove recent posts section if there's no post (#238)

Changes made:
- Removed the recent posts section if there's no post under the recent section.
- Eliminated unnecessary <Hr /> tags when there's no recent post.
- Extracted all-links from the recent section and put it above the footer.

Closes: #204

* fix: update back button to redirect to home when no route history (#241)

Update back button in PostDetails.astro to redirect to home page when
there's no route history.
If a blog post url is pasted in the browser and there's no route history
,prior to this commit, back button did not work as expected.
Now, if there's somewhere to go back, the back button will go back to the
previous route.
If not, the back button will redirect to home page.

* build(deps): bump vite from 4.5.1 to 5.0.12 (#243)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 5.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: update incorrect typo in predefined-color-schemes.md (#245)

* build(deps): upgrade astro and other dependencies

* refactor: update code formatting with prettier

* chore: add astro extension in lint-staged code formatting

* chore: update outdated prettier script

* chore(release): 4.2.0

* refactor: update post detail script codes

Updates:
- add optional chaining in possible null variables
- remove unnecessary after-swap event listeners

* 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>

* fix: add SITE.title in PostDetails title tag for consistent look (#247)

Add `SITE.title` in PostDetails page to be the same as other page title tags.

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>

* feat: add scroll indicator in blog posts (#249)

* 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

* fix: add $CURRENT_TIMEZONE_OFFSET in custom code snippets (#264)

* remove unneccessary items

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sat Naing <satnaingdev@gmail.com>
Co-authored-by: Sha Mwe La <62544170+shamwela@users.noreply.github.com>
Co-authored-by: B. Burt <beeburrt@outlook.com>
Co-authored-by: Michael Alaev <Alaev@users.noreply.github.com>
Co-authored-by: John Hooks <bitmachina@outlook.com>
Co-authored-by: Carles Barreda <9409275+carlesbarreda@users.noreply.github.com>
Co-authored-by: Mahesh Rijal <62394512+maheshrjl@users.noreply.github.com>
Co-authored-by: Min Adwaita <127674713+minadwaita@users.noreply.github.com>
Co-authored-by: Salman Hossain Saif <epbd.saif@gmail.com>
Co-authored-by: Parinya T <50407646+pickyzz@users.noreply.github.com>
Co-authored-by: Andrea Mignone <14820600+floatingpurr@users.noreply.github.com>
Co-authored-by: Rob Rose <RobRoseKnows+Git@gmail.com>
Co-authored-by: Jingwei Gao <gjw2014sis@pku.edu.cn>
Co-authored-by: AriPerkkio <ari.perkkio@gmail.com>
Co-authored-by: Nihaal Sangha <nihaal.git@gmail.com>
Co-authored-by: Gabriel Kanev <contact@mrgkanev.eu>
Co-authored-by: Chris Kerr <chriskerr@me.com>
Co-authored-by: Ajit Panigrahi <ajitzero@gmail.com>
Co-authored-by: Nahuel Garbezza <n.garbezza@gmail.com>
Co-authored-by: Mateus Abelli <mateusabelli@gmail.com>
Co-authored-by: Luks17 <48810778+Luks17@users.noreply.github.com>
Co-authored-by: Tanishq Manuja <tanishqmanuja@gmail.com>
Co-authored-by: Tanjim Hossain <tangimhossain1@gmail.com>
Co-authored-by: Haibo <nomango@qq.com>
Co-authored-by: shuaixr <1025sxr@gmail.com>
Co-authored-by: YUE <275233+yueim@users.noreply.github.com>
Co-authored-by: Erison Silva <hey@erison.work>
Co-authored-by: Erison Silva <erison.silva@power.cloud>
Co-authored-by: Simon Smale <simon@smalemail.net>
Co-authored-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>
Co-authored-by: Qisthi Ramadhani <dizzy.leaps_0f@icloud.com>
Co-authored-by: immodded <75246338+immodded@users.noreply.github.com>
Co-authored-by: Mario Davó <66087392+mdmrk@users.noreply.github.com>
Co-authored-by: Benjamin Rae <63359209+benjaminrae@users.noreply.github.com>
Co-authored-by: David Legrand <1110600+davlgd@users.noreply.github.com>
Co-authored-by: vrabe <git@vrabe.tw>
Co-authored-by: Jahseh J <139241743+JahsehJ@users.noreply.github.com>
Co-authored-by: 面条 <2959393+ccbikai@users.noreply.github.com>
Co-authored-by: Alan Ye <45558679+AlanYe-Dev@users.noreply.github.com>
Co-authored-by: Yenru Chin <danielthank@gmail.com>
2024-03-16 16:03:17 +01:00

48 lines
873 B
Text

---
import Breadcrumbs from "@components/Breadcrumbs.astro";
interface StringTitleProp {
pageTitle: string;
pageDesc?: string;
}
interface ArrayTitleProp {
pageTitle: [string, string];
titleTransition: string;
pageDesc?: string;
}
export type Props = StringTitleProp | ArrayTitleProp;
const { props } = Astro;
---
<Breadcrumbs />
<main id="main-content">
{
"titleTransition" in props ? (
<h1>
{props.pageTitle[0]}
<span transition:name={props.titleTransition}>
{props.pageTitle[1]}
</span>
</h1>
) : (
<h1>{props.pageTitle}</h1>
)
}
<p>{props.pageDesc}</p>
<slot />
</main>
<style>
#main-content {
@apply mx-auto w-full max-w-3xl px-4 pb-4;
}
#main-content h1 {
@apply text-2xl font-semibold sm:text-3xl;
}
#main-content p {
@apply mb-6 mt-2 italic;
}
</style>