Add Tailwind integration, stabilize build asset paths, improve image handling and layout - #8
Open
alaster-t34 wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
.nojekyllso generated assets are served correctly.assetsandcontentresolve at runtime.Description
astro.config.mjsand adjustedbuild.assetsand ViterollupOptions.outputto emit assets underassets/with safe file names, and configured Tailwind integration options.postcss.config.mjsto only includepostcss-import, and addedpublic/.nojekyllto disable Jekyll processing on static hosts.ImageWrapper.astroto usenode:path, strongerImageMetadatatyping, and expandedimport.meta.globto includeassets/**/*andcontent/**/*with improved path normalization and error logging.MainGridLayout.astrogrid/column/span classes and ordering so the sidebar, main content, TOC and footer layout behave correctly across breakpoints, and reorganized imports and constants formatting.src/styles/markdown.cssto add rounded padding and transitions for inline links.src/utils/content-utils.ts(consistent object typing and generics usage).Testing
TypeScripttype check viatsc --noEmitwas run and succeeded.astro buildwas executed and completed successfully with assets emitted underassets/.Codex Task