diff --git a/.prettierrc b/.prettierrc index 10a23cc..0d8bfa2 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,5 +5,14 @@ "bracketSpacing": false, "quoteProps": "consistent", "trailingComma": "none", - "arrowParens": "avoid" + "arrowParens": "avoid", + "plugins": ["prettier-plugin-jinja-template"], + "overrides": [ + { + "files": "*.njk", + "options": { + "parser": "jinja-template" + } + } + ] } diff --git a/package-lock.json b/package-lock.json index 96d1bb8..c468fb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,6 +46,7 @@ "postcss-import": "^16.0.0", "postcss-import-ext-glob": "^2.0.1", "postcss-js": "^4.0.0", + "prettier-plugin-jinja-template": "^1.3.2", "rimraf": "^5.0.0", "sanitize-html": "^2.7.2", "slugify": "^1.6.5" @@ -5378,6 +5379,31 @@ "node": ">=6" } }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-jinja-template": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-jinja-template/-/prettier-plugin-jinja-template-1.3.2.tgz", + "integrity": "sha512-ROglSKajIA4TRxM5othKfhc+dZrWYaVoJW/0EHlN0WwCXS1FmF/2mtfDkJW4wSTBqu7re1svsYMAu+oMGf6T9Q==", + "dev": true, + "peerDependencies": { + "prettier": "^3.0.0" + } + }, "node_modules/pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", diff --git a/package.json b/package.json index f0fad14..2f9b101 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "postcss-import": "^16.0.0", "postcss-import-ext-glob": "^2.0.1", "postcss-js": "^4.0.0", + "prettier-plugin-jinja-template": "^1.3.2", "rimraf": "^5.0.0", "sanitize-html": "^2.7.2", "slugify": "^1.6.5" diff --git a/src/_includes/components/card.njk b/src/_includes/components/card.njk index f77911d..0198002 100644 --- a/src/_includes/components/card.njk +++ b/src/_includes/components/card.njk @@ -1,21 +1,23 @@
  • {% if headingContext === "h2" %} -

    - {{ item.data.title }} -

    +

    + {{ item.data.title }} +

    {% else %} -

    - {{ item.data.title }} -

    +

    + {{ item.data.title }} +

    {% endif %}
    - {% set definedDate = item.date %} {% include "components/date.njk" %} {% if - activateTags and item.data.tags.length > 1 %} - + {% set definedDate = item.date %} + {% include "components/date.njk" %} + {% + if + activateTags and item.data.tags.length > 1 + %} + {% endif %}
    diff --git a/src/_includes/components/date.njk b/src/_includes/components/date.njk index 44799d3..4599c93 100644 --- a/src/_includes/components/date.njk +++ b/src/_includes/components/date.njk @@ -1,5 +1,3 @@ diff --git a/src/_includes/components/details.njk b/src/_includes/components/details.njk index 99060a2..5728534 100644 --- a/src/_includes/components/details.njk +++ b/src/_includes/components/details.njk @@ -4,10 +4,10 @@ {% for item in itemList %} -
    - {{ item.data.title }} - {{ item.templateContent | safe }} -
    +
    + {{ item.data.title }} + {{ item.templateContent | safe }} +
    {% endfor %} {% include "schemas/base-schema.njk" %} - {% if schema == 'blog' %} {%- include "schemas/blogpost-schema.njk" %} {% endif %} + {% if schema == 'blog' %}{%- include "schemas/blogpost-schema.njk" -%}{% endif %} @@ -52,12 +57,12 @@ /> - {% if preloads -%} - - + {% endif %} @@ -65,18 +70,19 @@ {% if masonry %} - - {% endif %} {% if youtube %} - - + + {% endif %} + {% if youtube %} + + {% endif %} {% if meta.easteregg %} - + {% endif %} diff --git a/src/_layouts/blog.njk b/src/_layouts/blog.njk index 84ed3dc..9116ab3 100644 --- a/src/_layouts/blog.njk +++ b/src/_layouts/blog.njk @@ -20,15 +20,17 @@ masonry: true @@ -37,7 +39,7 @@ masonry: true {% set metaKey = "blog" %} {% if collectionToPaginate.length > pagination.size %} - - {% include 'components/pagination.njk' %} {% endif %} + + {% include 'components/pagination.njk' %} + {% endif %} - diff --git a/src/_layouts/home.njk b/src/_layouts/home.njk index 63c6211..625499b 100644 --- a/src/_layouts/home.njk +++ b/src/_layouts/home.njk @@ -12,9 +12,7 @@ masonry: true
    -
    - {{ content | safe }} -
    +
    {{ content | safe }}
    @@ -23,7 +21,7 @@ masonry: true {% if blog.intro %} -

    {{ blog.intro }}

    +

    {{ blog.intro }}

    {% endif %}
      - {% set itemList = collections.posts %} {% for item in itemList.slice(0, 4) %} - - {% set activateTags = true %} - - {% set headingContext = "h3" %} - - {% include 'components/card.njk' %} {% endfor %} + {% set itemList = collections.posts %} + {% for item in itemList.slice(0, 4) %} + + {% set activateTags = true %} + + {% set headingContext = "h3" %} + + {% include 'components/card.njk' %} + {% endfor %}
    diff --git a/src/_layouts/post.njk b/src/_layouts/post.njk index f43ed48..978a59c 100644 --- a/src/_layouts/post.njk +++ b/src/_layouts/post.njk @@ -8,23 +8,29 @@ schema: blog

    {{ title }}

    {% if image %} - - {% eleventyImage image, alt or title, null, "eager", "feature" %} {% endif %} {% if - credit %} - -

    © {{ credit }}

    + + {% eleventyImage image, alt or title, null, "eager", "feature" %} + {% endif %} + {% + if + credit + %} + +

    © {{ credit }}

    {% endif %}

    - {% set definedDate = date %} {% include "components/date.njk" %} {% if tags.length > - 1 %} - - {% for tag in tags %} {% if tag != "posts" %} - - {% endif %} {% endfor %} {% endif %} + {% set definedDate = date %} {% include "components/date.njk" %} + {% + if tags.length > + 1 + %} + + {% for tag in tags %}{% if tag != "posts" %} + + {% endif %}{% endfor %} + {% endif %}

    {{ content | safe }} diff --git a/src/pages/built-with.njk b/src/pages/built-with.njk index 0f46ef8..0529ecf 100644 --- a/src/pages/built-with.njk +++ b/src/pages/built-with.njk @@ -9,9 +9,7 @@ grid: ---

    - A list of sites based on / built with Eleventy Excellent.
    - - Add yours by submitting a + A list of sites based on / built with Eleventy Excellent. Add yours by submitting a {{ designTokens.colors.description }}

    Custom colors

    in variables.css. Some only change for dark theme.

    Gradients

    @@ -84,16 +84,16 @@ customGradients:

    Fonts

    @@ -107,22 +107,24 @@ customGradients:

    - {%- for size in designTokens.sizes.items %} - - - - - - {%- endfor %} + {%- for size in designTokens.sizes.items -%} + + + + + + {%- endfor -%}
    -

    {{ size.name }}

    -
    - -

    {{ size.min }}px to {{ size.max }}px

    - var(--size-{{ size.name | slugify }}) -
    -
    -

    {{ size.name }}

    -
    +

    {{ size.name }}

    +
    + +

    {{ size.min }}px to {{ size.max }}px

    + var(--size-{{ size.name | slugify }}) +
    +
    +

    + {{ size.name }} +

    +
    @@ -137,27 +139,25 @@ customGradients:

    - {%- for space in designTokens.spacing.items %} - - - - - - {%- endfor %} + {%- for space in designTokens.spacing.items -%} + + + + + + {%- endfor -%}
    -

    {{ space.name }}

    -
    - -

    {{ space.min }}px to {{ space.max }}px

    - var(--space-{{ space.name | slugify }}) -
    -
    -
    -
    +

    {{ space.name }}

    +
    + +

    {{ space.min }}px to {{ space.max }}px

    + var(--space-{{ space.name | slugify }}) +
    +
    +
    +
    diff --git a/src/posts/2023-01-25-opengraph-images.md b/src/posts/2023-01-25-opengraph-images.md index e7b3a7f..404c06a 100644 --- a/src/posts/2023-01-25-opengraph-images.md +++ b/src/posts/2023-01-25-opengraph-images.md @@ -17,4 +17,4 @@ The fallback and default image for all other pages is the image set as `opengrap {% eleventyImage "./src/" + meta.opengraph_default, meta.opengraph_default_alt, "This is what the general OG image for non-blog posts looks like" %} -A more detailed explanation can be found in the [docs](/get-started/#docs). \ No newline at end of file +A more detailed explanation can be found in the [docs](/get-started/#open-graph-images). diff --git a/tailwind.config.js b/tailwind.config.js index edce48f..62fe7d6 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -66,8 +66,20 @@ module.exports = { // Disables Tailwind's reset etc corePlugins: { - preflight: false + preflight: false, + textOpacity: false, + backgroundOpacity: false, + borderOpacity: false }, + + // Prevents Tailwind's core components + blocklist: ['container'], + + // Prevents Tailwind from generating that wall of empty custom properties + experimental: { + optimizeUniversalDefaults: true + }, + plugins: [ // Generates custom property values from tailwind config plugin(function ({addComponents, config}) {