@anyblades/blades 2.4.3 → 2.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,42 +1,42 @@
1
- {% comment %}<!--section:code-->```liquid{% endcomment %}
1
+ {% comment %}<!--section:code-->```liquid {% endcomment %}
2
2
  <!doctype html>
3
3
  <html lang="{{ site.lang | default: 'en' }}">
4
4
  <head>
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
7
- <link rel="icon" href="{{ site.favicon | default: '/favicon.svg' }}">
8
- {% if site.favicon_alt %}
9
- <link rel="alternate icon" href="{{ site.favicon_alt }}" type="image/png">
10
- {% endif %}
11
- <title>
12
- {%- if title %}{{ title | strip_html | append: ' | ' }}{% endif -%}
13
- {{- site.title -}}
14
- </title>
7
+ {% # prettier-ignore %}
8
+ <title>{{ title | strip_html }}{% if title and site.title %} | {% endif %}{{ site.title }}</title>
15
9
  <meta name="description" content="{{ description | strip_html }}">
16
10
 
11
+ <link rel="icon" href="{{ site.favicon | default: '/favicon.ico' }}">
17
12
  {%- for href in site.styles %}
18
13
  <link rel="stylesheet" href="{{ href | relative_url }}">
19
14
  {%- endfor %}
20
- <style>
21
- {{ site.inline_styles | join: '\n' }}
22
- </style>
23
-
24
15
  {%- for src in site.scripts %}
25
16
  <script src="{{ src }}" defer></script>
26
17
  {%- endfor %}
27
- <script type="module">
28
- {{ site.inline_scripts | join: '\n' }}
29
- </script>
30
18
 
31
19
  {{ content_for_header }}
20
+ {{ site.head_extras | default: '' | join: '\n' }}
32
21
  </head>
33
22
 
34
- <body>
35
- {{ body }}
23
+ <body {{ site.body_attrs }}>
24
+ {% if body %}
25
+ {{ body }}
26
+ {% else %}
27
+ <main>
28
+ <h1>{{ title }}</h1>
29
+ {{ content }}
30
+ </main>
31
+ {% endif %}
32
+
33
+ {{ site.body_extras | default: '' | join: '\n' }}
36
34
  </body>
37
35
  </html>
36
+ {% # prettier-ignore %}
38
37
  {% comment %}```
39
38
  <!--section:docs-->
39
+
40
40
  Usage in Liquid layout:
41
41
 
42
42
  ```liquid
@@ -45,5 +45,6 @@ Usage in Liquid layout:
45
45
  {% include blades/html.liquid %}
46
46
  ```
47
47
 
48
- Living example: https://github.com/anyblades/bladeswitch/blob/main/_includes/default.liquid
49
- <!--section-->{% endcomment %}
48
+ Live example: https://github.com/anyblades/buildawesome-starters/blob/main/site-liquid/_includes/default.liquid
49
+
50
+ {% endcomment %}
@@ -1,45 +1,39 @@
1
- {# <!--section:code-->```jinja2 #}
1
+ {#<!--section:code-->```jinja2 #}
2
2
  <!doctype html>
3
3
  <html lang="{{ site.lang | d('en') }}">
4
4
  <head>
5
5
  <meta charset="utf-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover" />
7
- <link rel="icon" href="{{ site.favicon | d('/favicon.svg') }}" />
8
- {% if site.favicon_alt %}
9
- <link rel="alternate icon" href="{{ site.favicon_alt }}" type="image/png" />
10
- {% endif %}
11
- <title>
12
- {{- title | string | striptags ~ ' | ' if title -}}
13
- {{- site.title -}}
14
- </title>
7
+
8
+ <title>{{ title | striptags }}{% if title and site.title %}|{% endif %}{{ site.title }}</title>
15
9
  <meta name="description" content="{{ description | striptags }}" />
16
10
 
11
+ <link rel="icon" href="{{ site.favicon | d('/favicon.ico') }}" />
17
12
  {%- for href in site.styles %}
18
13
  <link rel="stylesheet" href="{{ href }}" />
19
14
  {%- endfor %}
20
- {# prettier-ignore-start #}<style>
21
- {{ site.inline_styles | d([]) | join('\n') | safe }}
22
- </style>{# prettier-ignore-end #}
23
-
24
15
  {%- for src in site.scripts %}
25
16
  <script src="{{ src }}" defer></script>
26
17
  {%- endfor %}
27
- {# prettier-ignore-start #}<script type="module">
28
- {{ site.inline_scripts | d([]) | join('\n') | safe }}
29
- </script>{# prettier-ignore-end #}
30
18
 
31
19
  {{ content_for_header | safe }}
20
+ {{ site.head_extras | d([]) | join('\n') | safe }}
32
21
  </head>
33
22
 
34
- <body>
23
+ <body {{ site.body_attrs | safe }}>
35
24
  {% block body %}
25
+ <main>
26
+ <h1>{{ title }}</h1>
27
+ {{ content | safe }}
28
+ </main>
36
29
  {% endblock %}
30
+
31
+ {{ site.body_extras | d([]) | join('\n') | safe }}
37
32
  </body>
38
33
  </html>
39
34
  {#```
40
- - `title | string` avoids error with `| striptags` when you pass a pure number.
41
-
42
35
  <!--section:docs-->
36
+
43
37
  Usage in Nunjucks layout:
44
38
 
45
39
  ```jinja2
@@ -48,5 +42,8 @@ Usage in Nunjucks layout:
48
42
  {% block body %}...{% endblock %}
49
43
  ```
50
44
 
51
- Living example: https://github.com/anyblades/build-awesome-starter/blob/main/_includes/default.njk
52
- <!--section--> #}
45
+ Live examples:
46
+ - https://github.com/anyblades/buildawesome-starters/blob/main/_includes/default.njk
47
+ - https://github.com/anyblades/subtle/blob/main/.11ty/_includes/default.njk
48
+
49
+ #}
@@ -1,45 +1,39 @@
1
- {# <!--section:code-->```twig #}
1
+ {#<!--section:code-->```twig #}
2
2
  <!doctype html>
3
3
  <html lang="{{ site.lang|default('en') }}">
4
4
  <head>
5
5
  <meta charset="utf-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover" />
7
- <link rel="icon" href="{{ site.favicon|default('/favicon.svg') }}" />
8
- {% if site.favicon_alt %}
9
- <link rel="alternate icon" href="{{ site.favicon_alt }}" type="image/png" />
10
- {% endif %}
11
- <title>
12
- {{- title ? title|striptags ~ ' | ' -}}
13
- {{- site.title -}}
14
- </title>
7
+
8
+ <title>{{ title|striptags }}{% if title and site.title %} | {% endif %}{{ site.title }}</title>
15
9
  <meta name="description" content="{{ description|striptags }}" />
16
10
 
11
+ <link rel="icon" href="{{ site.favicon|default('/favicon.ico') }}" />
17
12
  {%- for href in site.styles %}
18
13
  <link rel="stylesheet" href="{{ href }}" />
19
14
  {%- endfor %}
20
- <style>
21
- {{ site.inline_styles|default([])|join('\n')|raw }}
22
- </style>
23
-
24
15
  {%- for src in site.scripts %}
25
16
  <script src="{{ src }}" defer></script>
26
17
  {%- endfor %}
27
- <script type="module">
28
- {{ site.inline_scripts|default([])|join('\n')|raw }}
29
- </script>
30
18
 
31
- {{ content_for_header|default('')|raw }}
19
+ {{ content_for_header|raw }}
20
+ {{ site.head_extras|default([])|join('\n')|raw }}
32
21
  </head>
33
22
 
34
- <body>
23
+ <body {{ site.body_attrs|raw }}>
35
24
  {% block body %}
25
+ <main>
26
+ <h1>{{ title }}</h1>
27
+ {{ content|raw }}
28
+ </main>
36
29
  {% endblock %}
30
+
31
+ {{ site.body_extras|default([])|join('\n')|raw }}
37
32
  </body>
38
33
  </html>
39
34
  {#```
40
- - `title ? …` renders the prefix only when a title is set, mirroring the Nunjucks `if title` guard.
41
-
42
35
  <!--section:docs-->
36
+
43
37
  Usage in Twig layout:
44
38
 
45
39
  ```twig
@@ -49,4 +43,5 @@ Usage in Twig layout:
49
43
  ```
50
44
 
51
45
  Pass `site`, `title` and `description` via the render context.
52
- <!--section--> #}
46
+
47
+ #}
package/blades.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "blades"
5
- spec.version = "2.4.1"
5
+ spec.version = "2.4.5"
6
6
 
7
7
  spec.authors = ["Anton Staroverov"]
8
8
  spec.homepage = "https://blades.ninja/"
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@anyblades/blades",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
4
4
  "exports": {
5
5
  ".": "./src/blades.css",
6
6
  "./standalone": "./src/blades.standalone.css",
7
7
  "./standalone/core": "./src/blades.standalone.core.css",
8
8
  "./standalone/theme": "./src/blades.standalone.theme.css",
9
+ "./ninja": "./src/blades.ninja.css",
9
10
  "./float-label": "./src/float-label.css"
10
11
  },
11
12
  "=== DEV ONLY": "===",