Skip to content

refactor(eleventy): use dynamic path resolution for prismjs css#401

Merged
pablodiehl merged 2 commits into
devfrom
fix/eleventy-static-pnpm
May 27, 2026
Merged

refactor(eleventy): use dynamic path resolution for prismjs css#401
pablodiehl merged 2 commits into
devfrom
fix/eleventy-static-pnpm

Conversation

@jcbsfilho
Copy link
Copy Markdown
Contributor

This pull request updates the Eleventy static site template to improve dependency handling and asset management, particularly for the Prism syntax highlighter CSS. It also makes minor housekeeping updates to version control files.

Asset management and dependency handling:

  • Updated the passthrough copy in eleventy.config.js to dynamically resolve the path to prism-okaidia.css using Node's path module, ensuring compatibility regardless of where dependencies are installed. (eleventy.config.js) [1] [2]
  • Updated all references to the Prism CSS file in Nunjucks templates to use the copied _site/css/prism-okaidia.css path instead of referencing node_modules directly. (_includes/layouts/base.njk, _includes/layouts/post.njk) [1] [2]

Version control and housekeeping:

  • Added yarn.lock and pnpm-lock.yaml to .gitignore to prevent accidental commits of lockfiles from alternative package managers. (.gitignore)
  • Removed the .nvmrc file, which previously specified Node.js version 16, to avoid enforcing a specific Node version. (.nvmrc)

@jcbsfilho jcbsfilho requested a review from a team as a code owner May 25, 2026 16:52
@pablodiehl pablodiehl merged commit ed920db into dev May 27, 2026
8 checks passed
@pablodiehl pablodiehl deleted the fix/eleventy-static-pnpm branch May 27, 2026 12:44
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants