Add fontawesome support to emojis
This commit is contained in:
parent
90a1d9d4fe
commit
b70c43d765
3
config/filters/arrays.js
Normal file
3
config/filters/arrays.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = function(eleventyConfig) {
|
||||||
|
eleventyConfig.addFilter('take', (list, n) => list.slice(0, n));
|
||||||
|
}
|
@ -1,5 +1,7 @@
|
|||||||
const dateFilters = require('./dates');
|
const dateFilters = require('./dates');
|
||||||
|
const arrayFilters = require('./arrays');
|
||||||
|
|
||||||
module.exports = function(eleventyConfig) {
|
module.exports = function(eleventyConfig) {
|
||||||
eleventyConfig.addPlugin(dateFilters);
|
eleventyConfig.addPlugin(dateFilters);
|
||||||
|
eleventyConfig.addPlugin(arrayFilters);
|
||||||
}
|
}
|
1858
config/plugins/icons.json
Normal file
1858
config/plugins/icons.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@ const markdownItFootnote = require('markdown-it-footnote');
|
|||||||
const markdownitMark = require('markdown-it-mark');
|
const markdownitMark = require('markdown-it-mark');
|
||||||
const markdownitAbbr = require('markdown-it-abbr');
|
const markdownitAbbr = require('markdown-it-abbr');
|
||||||
const markdownItEleventyImg = require('markdown-it-eleventy-img');
|
const markdownItEleventyImg = require('markdown-it-eleventy-img');
|
||||||
|
const icons = require('./icons.json');
|
||||||
const { slugifyString } = require('../utils');
|
const { slugifyString } = require('../utils');
|
||||||
const markdownLib = markdownIt({
|
const markdownLib = markdownIt({
|
||||||
html: true,
|
html: true,
|
||||||
@ -44,7 +45,7 @@ const markdownLib = markdownIt({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.use(markdownItEmoji)
|
.use(markdownItEmoji, { defs: icons })
|
||||||
.use(markdownItFootnote)
|
.use(markdownItFootnote)
|
||||||
.use(markdownitMark)
|
.use(markdownitMark)
|
||||||
.use(markdownitAbbr)
|
.use(markdownitAbbr)
|
||||||
@ -64,6 +65,10 @@ const markdownLib = markdownIt({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
markdownLib.renderer.rules.emoji = function(token, idx) {
|
||||||
|
return `<span class="fa-li"><i class="fa-solid fa-${token[idx].markup}"></i></span>`;
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = function(eleventyConfig) {
|
module.exports = function(eleventyConfig) {
|
||||||
eleventyConfig.setLibrary('md', markdownLib);
|
eleventyConfig.setLibrary('md', markdownLib);
|
||||||
};
|
};
|
@ -2,7 +2,9 @@
|
|||||||
<html lang={{data.page.lang}}>
|
<html lang={{data.page.lang}}>
|
||||||
<head>
|
<head>
|
||||||
<title>{{ title }} | {{ metadata.site.name }}</title>
|
<title>{{ title }} | {{ metadata.site.name }}</title>
|
||||||
|
{% if includeFA %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="/assets/css/fontawesome.css" />
|
||||||
|
{% endif %}
|
||||||
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css" />
|
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
</head>
|
</head>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
layout: base.njk
|
layout: base.njk
|
||||||
|
includeFA: true
|
||||||
---
|
---
|
||||||
|
|
||||||
<main class="wrapper-lg stack-md">
|
<main class="wrapper-lg stack-md">
|
||||||
|
9
src/assets/css/fontawesome.css
vendored
Normal file
9
src/assets/css/fontawesome.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
src/assets/fonts/fa-brands-400.ttf
Normal file
BIN
src/assets/fonts/fa-brands-400.ttf
Normal file
Binary file not shown.
BIN
src/assets/fonts/fa-brands-400.woff2
Normal file
BIN
src/assets/fonts/fa-brands-400.woff2
Normal file
Binary file not shown.
BIN
src/assets/fonts/fa-regular-400.ttf
Normal file
BIN
src/assets/fonts/fa-regular-400.ttf
Normal file
Binary file not shown.
BIN
src/assets/fonts/fa-regular-400.woff2
Normal file
BIN
src/assets/fonts/fa-regular-400.woff2
Normal file
Binary file not shown.
BIN
src/assets/fonts/fa-solid-900.ttf
Normal file
BIN
src/assets/fonts/fa-solid-900.ttf
Normal file
Binary file not shown.
BIN
src/assets/fonts/fa-solid-900.woff2
Normal file
BIN
src/assets/fonts/fa-solid-900.woff2
Normal file
Binary file not shown.
BIN
src/assets/fonts/fa-v4compatibility.ttf
Normal file
BIN
src/assets/fonts/fa-v4compatibility.ttf
Normal file
Binary file not shown.
BIN
src/assets/fonts/fa-v4compatibility.woff2
Normal file
BIN
src/assets/fonts/fa-v4compatibility.woff2
Normal file
Binary file not shown.
@ -11,6 +11,10 @@
|
|||||||
font-size: var(--text-size-3xl);
|
font-size: var(--text-size-3xl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: var(--text-size-xl);
|
||||||
|
}
|
||||||
|
|
||||||
picture {
|
picture {
|
||||||
max-width: clamp(8rem, calc(1.09rem + 10vw), 12rem);
|
max-width: clamp(8rem, calc(1.09rem + 10vw), 12rem);
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
4
src/css/exceptions/lists.css
Normal file
4
src/css/exceptions/lists.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.fa-li {
|
||||||
|
position: initial;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
@ -19,18 +19,18 @@ h5 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: var(--text-size-2xl);
|
font-size: var(--text-size-xl);
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
text-underline-offset: var(--space-size-2xs);
|
text-underline-offset: var(--space-size-2xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: var(--text-size-xl);
|
font-size: var(--text-size-l);
|
||||||
text-underline-offset: var(--space-size-3xs);
|
text-underline-offset: var(--space-size-3xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: var(--text-size-l);
|
font-size: var(--text-size-m);
|
||||||
text-underline-offset: var(--space-size-3xs);
|
text-underline-offset: var(--space-size-3xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ layout: base.njk
|
|||||||
<h2>Recent Posts</h2>
|
<h2>Recent Posts</h2>
|
||||||
|
|
||||||
<ul class="stack-2xs">
|
<ul class="stack-2xs">
|
||||||
{% for post in collections.posts.slice(0, 3) %}
|
{% for post in collections.posts | reverse | take(3) %}
|
||||||
<li><a href="{{ post.data.url }}">{{ post.data.title }}</a> <time>{{ post.date | dateDisplay }}</time></li>
|
<li><a href="{{ post.data.url }}">{{ post.data.title }}</a> <time>{{ post.date | dateDisplay }}</time></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
10
src/now.md
10
src/now.md
@ -5,14 +5,14 @@ layout: page.njk
|
|||||||
|
|
||||||
## What I'm reading
|
## What I'm reading
|
||||||
|
|
||||||
:open_book: City of Last Chances by Adrian Tchaikovsky
|
* :book: City of Last Chances by Adrian Tchaikovsky
|
||||||
|
|
||||||
## What I'm watching
|
## What I'm watching
|
||||||
|
|
||||||
:tv: For All Mankind
|
* :tv: For All Mankind
|
||||||
|
|
||||||
## What I'm enjoying
|
## What I'm enjoying
|
||||||
|
|
||||||
:bike: Preparing for a 100km charity cycle
|
* :bicycle: Preparing for a 100km charity cycle
|
||||||
:family: Spending time with my family
|
* :people-roof: Spending time with my family
|
||||||
:computer: Working on my ZX Basic interpreter
|
* :computer: Working on my ZX Basic interpreter
|
||||||
|
Loading…
Reference in New Issue
Block a user