@@ -28,31 +28,62 @@ module.exports = (eleventyConfig) => {
28
28
29
29
This plugin comes with two mechanisms to create an inline link favicon. You can use a [ paired shortcode] ( https://www.11ty.dev/docs/shortcodes/#paired-shortcodes ) or a [ filter] ( https://www.11ty.dev/docs/filters/ ) , both referenced as ` ai ` . ` ai ` is short for anchor-image.
30
30
31
- ## Paired Shortcode
31
+ ### Paired Shortcode
32
32
33
- ``` md
33
+ <!-- CODEBLOCK_START {"value": "demo/paired-shortcode.njk", "hideValue": true} -->
34
+ <!-- prettier-ignore -->
35
+ ~~~~~~~~~~ njk
34
36
{% ai "https://front-end.social/@brian" %}@brian{% endai %}
35
- ```
37
+ ~~~~~~~~~~
38
+
39
+ <!-- CODEBLOCK_END -->
36
40
37
41
returns
38
42
39
- ``` html
43
+ <!-- CODEBLOCK_START {"value": "_site/demo/paired-shortcode/index.html", "hideValue": true} -->
44
+ <!-- prettier-ignore -->
45
+ ~~~~~~~~~~ html
40
46
<a href =" https://front-end.social/@brian"
41
47
><img
42
- style =" max-height : 1em ; position : relative ; top : .2em ; margin-right : .2em "
43
- src =" https://t1.gstatic.com/faviconV2?client=SOCIAL& ; type=FAVICON& ; fallback_opts=TYPE,SIZE,URL& ; url=https://front-end.social/@brian& ; size=1"
48
+ alt =" favicon for https://front-end.social/@brian"
49
+ loading =" lazy"
50
+ style =" max-height : 1em ; position : relative ; top : 0.2em ; margin-right : 0.2em "
51
+ src =" https://t1.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://front-end.social/@brian&size=128"
44
52
/>@brian</a
45
53
>
46
- ```
54
+ ~~~~~~~~~~
47
55
48
- ## Filter
56
+ <!-- CODEBLOCK_END -->
49
57
50
- ``` md
58
+ ### Filter
59
+
60
+ <!-- CODEBLOCK_START {"value": "demo/filter.njk", "hideValue": true} -->
61
+ <!-- prettier-ignore -->
62
+ ~~~~~~~~~~ njk
51
63
{{ "https://front-end.social/@brian" | ai("@brian") | safe }}
52
- ```
64
+ ~~~~~~~~~~
65
+
66
+ <!-- CODEBLOCK_END -->
53
67
54
68
returns the same as above.
55
69
70
+ ### Snippets / Completions
71
+
72
+ Authoring content with this plugin is aided by user-defined snippets:
73
+
74
+ - [ Visual Studio Code] ( https://code.visualstudio.com/docs/editor/userdefinedsnippets )
75
+
76
+ ``` json
77
+ {
78
+ "ai" : {
79
+ "scope" : " markdown,nunjucks" ,
80
+ "prefix" : " ai" ,
81
+ "body" : [" {% ai \" $1\" %}$2{% endai %}$0" ],
82
+ "description" : " add an inline link favicon"
83
+ }
84
+ }
85
+ ```
86
+
56
87
## Credits
57
88
58
89
- Thanks to [ 5t3ph/eleventy-plugin-template] ( https://github.com/5t3ph/eleventy-plugin-template ) for inspiration
0 commit comments