diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk index cebf438..df8e3b7 100644 --- a/_includes/layouts/base.njk +++ b/_includes/layouts/base.njk @@ -14,31 +14,25 @@ {#- #} {#- - Choices for CSS: + CSS bundles are provided via the eleventy-plugin-bundle plugin: + 1. You can add to them using `{% css %}` + 2. You can get from them using `{% getBundle "css" %}` or `{% getBundleFileUrl "css" %}` - 1. External files (best with local dev server live reload) - - - - - - - 2. Inlined (fastest site performance in production) -#} - -{# - 3. You could even swap between the two methods above using {% if eleventy.env.runMode === "serve" %} - 4. Concatenate CSS to one file (site performance is slower than 2 but faster than 1): - https://www.11ty.dev/docs/quicktips/concatenate/ - 5. Use a bundler - e.g. Vite https://www.11ty.dev/docs/server-vite/ - Or search for additional community plugins for esbuild, rollup, webpack, etc. + Learn more: https://github.com/11ty/eleventy-plugin-bundle #} + + {#- Add to the CSS bundle #} + {%- css %}{% include "public/css/index.css" %}{% endcss %} + {%- css %}{# add your own CSS! #}{% endcss %} + + {#- Render the CSS bundle #} + {%- if eleventy.env.runMode === "serve" %} + {# External files (local dev live reload will refresh without page reload) #} + + {%- else %} + {# Inlined CSS (fastest site performance in production) #} + + {%- endif %} Skip to main content diff --git a/_includes/layouts/home.njk b/_includes/layouts/home.njk index 5f9c02d..16e9819 100644 --- a/_includes/layouts/home.njk +++ b/_includes/layouts/home.njk @@ -2,6 +2,7 @@ layout: layouts/base.njk --- +{%- css %}{% include "public/css/message-box.css" %}{% endcss %}
  1. Edit the _data/metadata.json with your blog’s information.
  2. diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 68228ea..bf4fa82 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -1,6 +1,11 @@ --- layout: layouts/base.njk --- +{%- css %} +/* Only include the syntax highlighter CSS on blog posts */ +{% include "node_modules/prismjs/themes/prism-okaidia.css" %} +{% include "public/css/prism-diff.css" %} +{%- endcss %}

    {{ title }}