Skip to content

wry-red/site

Repository files navigation

πŸ“„ wry.red

wry.red Typescript GitHub Conventional Commits Commitizen friendly

Welcome! This is the site of wry.

The code and design are directly derived from Sat Naing πŸ‘¨πŸ»β€πŸ’»'s fantastic astro-paper. Project structure like client scripting, full-text search, route generation are heavily modified to suit personal taste.

This theme is written in vanilla TypeScript for SSG and a sprinkling of client-side JavaScript and libraries to add some interactions for a better experience when navigating the site. TailwindCSS is used for styling and Markdown for blog content. While not thoroughly tested, the site works mostly fine with JavaScript disabled.

πŸ“Š PageSpeed Insights

PageSpeed Insights

πŸ”₯ Features

  • type-safe markdown
  • progressive enhencement
  • accessible (Keyboard/VoiceOver)
  • responsive (mobile ~ desktops)
  • SEO-friendly
  • light & dark mode
  • full-text search
  • draft posts & pagination
  • sitemap & rss feed
  • dynamic OG image generation for blog posts

πŸš€ Project Structure

/
β”œβ”€β”€ public/
β”‚   └── favicon.ico
β”‚   └── toggle-theme.js
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ content/
β”‚   β”‚   |  blog/
β”‚   β”‚   |    └── some-blog-posts.md
β”‚   β”‚   └── config.ts
β”‚   β”œβ”€β”€ icons/
β”‚   β”œβ”€β”€ layouts/
β”‚   └── pages/
β”‚   └── styles/
β”‚   └── utils/
β”‚   └── config.ts
β”‚   └── env.d.ts
└── package.json

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

Any static assets, like images, can be placed in the public/ directory.

All blog posts are stored in src/content/blog directory.

πŸ’» Tech Stack

πŸ‘¨πŸ»β€πŸ’» Running Locally

The easiest way to run this project locally is to run the following command in your desired directory.

bun create astro --template wry-red/site

πŸ”‘ Google Site Verification (optional)

You can easily add your Google Site Verification HTML tag in your site using environment variable. This step is optional. If you don't add the following env variable, the google-site-verification tag won't appear in the html <head> section.

# in your environment variable file (.env)
PUBLIC_GOOGLE_SITE_VERIFICATION=<your-google-site-verification-value>

🧞 Commands

All commands are run from the root of the project, from a terminal:

Note! For Docker commands we must have it installed in your machine.

Command Action
bun install Installs dependencies
bun run dev Starts local dev server at localhost:4321
bun run check Check code typing
bun run build Build your production site to ./dist/
bun run preview Preview your build locally, before deploying
bun run format:check Check code format with Prettier
bun run format Format codes with Prettier
bun run sync Generates TypeScript types for all Astro modules. Learn more.
bun run commit Commit code changes with commitizen
bun run lint Lint with ESLint
docker compose up -d Run Astro on docker, You can access with the same hostname and port informed on dev command.
docker compose run app bun install You can run any command above into the docker container.

Warning! Windows PowerShell users may need to install the concurrently package if they want to run diagnostics during development (astro check --watch & astro dev).

✨ Feedback & Suggestions

If you have any suggestions/feedback, feel free to open an issue if you find bugs or want to request new features.

πŸ“œ License

Licensed under the MIT License, Copyright Β© 2023


Made with ❀️ by wry, Derived from Sat Naing πŸ‘¨πŸ»β€πŸ’»'s fantastic astro-paper.