Skip to content

Add Tailwind integration, stabilize build asset paths, improve image handling and layout - #8

Open
alaster-t34 wants to merge 2 commits into
codex-3svvsofrom
codex/merge-3svvso-and-main-branches-and-fix-layout-issues-eya8bi
Open

Add Tailwind integration, stabilize build asset paths, improve image handling and layout#8
alaster-t34 wants to merge 2 commits into
codex-3svvsofrom
codex/merge-3svvso-and-main-branches-and-fix-layout-issues-eya8bi

Conversation

@alaster-t34

Copy link
Copy Markdown
Owner

Motivation

  • Integrate Tailwind and simplify PostCSS configuration to streamline styling and enable Tailwind features.
  • Ensure deterministic asset paths for production (GitHub Pages) by customizing build output and adding .nojekyll so generated assets are served correctly.
  • Fix dynamic/local image imports and typings so local images from assets and content resolve at runtime.
  • Improve responsive layout and TOC/sidebar/footer grid behavior to avoid overflow and layout regressions.

Description

  • Added Tailwind integration in astro.config.mjs and adjusted build.assets and Vite rollupOptions.output to emit assets under assets/ with safe file names, and configured Tailwind integration options.
  • Simplified postcss.config.mjs to only include postcss-import, and added public/.nojekyll to disable Jekyll processing on static hosts.
  • Reworked ImageWrapper.astro to use node:path, stronger ImageMetadata typing, and expanded import.meta.glob to include assets/**/* and content/**/* with improved path normalization and error logging.
  • Adjusted MainGridLayout.astro grid/column/span classes and ordering so the sidebar, main content, TOC and footer layout behave correctly across breakpoints, and reorganized imports and constants formatting.
  • Updated markdown link styling in src/styles/markdown.css to add rounded padding and transitions for inline links.
  • Minor TypeScript formatting and typing fixes in src/utils/content-utils.ts (consistent object typing and generics usage).

Testing

  • TypeScript type check via tsc --noEmit was run and succeeded.
  • Production build via astro build was executed and completed successfully with assets emitted under assets/.
  • There is no repository unit test suite modified or added as part of this change.

Codex Task

…grid layout

### Motivation
- Add Tailwind as an integration and adjust build asset handling for the static site.
- Improve robustness of local image imports and path normalization to reliably resolve images from `assets` and `content` folders.
- Fix responsive grid and column spans so the sidebar, main content, and footer behave correctly across breakpoints.
- Tidy up styling and small TypeScript/type formatting issues for consistency.

### Description
- Update `astro.config.mjs` to add the `@astrojs/tailwind` integration, set `build.assets` to `assets`, and configure Tailwind options (`applyBaseStyles: false`, `nesting: true`).
- Simplify `postcss.config.mjs` to only register `postcss-import` and remove redundant Tailwind plugin entries.
- Add `public/.nojekyll` to prevent GitHub Pages from processing generated asset paths.
- Rewrite `src/components/misc/ImageWrapper.astro` to use `node:path`, type the `img` variable, expand `import.meta.glob` to include both `../../assets/**/*` and `../../content/**/*`, normalize paths, and improve error logging.
- Modify `src/layouts/MainGridLayout.astro` to reorganize imports, include `ImageWrapper` and `TOC`, import constants cleanly, and change grid class definitions and column/span assignments for correct responsive behavior (including adjustments to `SideBar`, `main`, and footer spans).
- Update `src/styles/markdown.css` to adjust link styling by adding `rounded-md p-1 -m-1 transition` to inline link rules.
- Make small TypeScript/type formatting changes and remove unnecessary generic annotations in `src/utils/content-utils.ts`.

### Testing
- Performed a local site build with `pnpm build` (Astro build) and the build completed successfully.
- Started the dev server with `pnpm dev` to sanity-check layout and image resolution, and the server started with pages rendering as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant