добавляет favicon и логотип на главную страницу

This commit is contained in:
Maxim Slipenko 2022-05-13 21:39:19 +03:00
parent 150d897283
commit b79a628940
Signed by: Maks1mS
GPG Key ID: 7461AF39A8705FB8
8 changed files with 850 additions and 2 deletions

View File

@ -1,5 +1,7 @@
const { mkdirSync } = require('fs')
const cagovBuildSystem = require('@cagov/11ty-build-system')
const svgContents = require('eleventy-plugin-svg-contents')
const faviconPlugin = require('eleventy-favicon')
module.exports = (eleventyConfig) => {
eleventyConfig.addPlugin(cagovBuildSystem, {
@ -18,6 +20,11 @@ module.exports = (eleventyConfig) => {
}
})
eleventyConfig.addPlugin(svgContents)
eleventyConfig.addPlugin(faviconPlugin, {
destination: './dist'
})
return {
dir: {
input: 'src',

757
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,8 @@
"@rollup/plugin-node-resolve": "^13.3.0",
"autoprefixer": "^10.4.7",
"cssnano": "^5.1.7",
"eleventy-favicon": "^1.1.3",
"eleventy-plugin-svg-contents": "^0.7.0",
"eslint": "^8.15.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",

44
src/images/favicon.svg Normal file
View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="10mm"
height="10mm"
viewBox="0 0 10 10"
version="1.1"
id="svg1163"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1160" />
<g
id="layer1"
transform="translate(-84.492197,-76.648259)">
<g
id="g121725"
transform="translate(8.947168,-21.108691)">
<rect
style="fill:#333333;stroke-width:0.262137"
id="rect94180-7"
width="10"
height="10"
x="75.545029"
y="97.75695"
ry="1.1785811" />
<path
d="m 78.668175,104.34225 q -0.603323,0 -1.092977,-0.13411 -0.480909,-0.14251 -0.856893,-0.40235 -0.375984,-0.26822 -0.673273,-0.62866 l 0.900613,-0.9807 q 0.43719,0.5616 0.874381,0.75439 0.445934,0.19279 0.918099,0.19279 0.236084,0 0.428447,-0.0587 0.192363,-0.0587 0.29729,-0.16766 0.104928,-0.11737 0.104928,-0.28498 0,-0.12574 -0.06995,-0.22632 -0.06119,-0.10068 -0.174876,-0.17602 -0.113673,-0.0754 -0.271058,-0.13411 -0.157387,-0.0672 -0.332265,-0.10893 -0.174875,-0.0502 -0.358496,-0.0837 -0.507141,-0.10892 -0.883125,-0.26824 -0.375983,-0.15926 -0.629555,-0.38556 -0.244826,-0.23471 -0.367239,-0.52808 -0.12241,-0.30177 -0.12241,-0.67059 0,-0.39394 0.183619,-0.720857 0.192364,-0.335277 0.507141,-0.569983 0.323521,-0.243081 0.743224,-0.368817 0.419703,-0.13411 0.87438,-0.13411 0.603324,0 1.03177,0.125735 0.437191,0.117384 0.743225,0.343665 0.314776,0.226317 0.533373,0.544843 l -0.918102,0.846594 q -0.183619,-0.21794 -0.402213,-0.36044 -0.209853,-0.14249 -0.45468,-0.217932 -0.236081,-0.07544 -0.489653,-0.07544 -0.262315,0 -0.454678,0.06713 -0.18362,0.05869 -0.288546,0.176022 -0.104928,0.10895 -0.104928,0.26825 0,0.14249 0.08743,0.24307 0.08743,0.10068 0.236082,0.18441 0.148645,0.0754 0.341009,0.13411 0.192363,0.0502 0.402215,0.0838 0.48091,0.0922 0.865638,0.24307 0.39347,0.15088 0.673273,0.36881 0.288545,0.21793 0.43719,0.51969 0.157389,0.29338 0.157389,0.68733 0,0.6119 -0.314778,1.03938 -0.306032,0.41911 -0.848148,0.64543 -0.533373,0.21793 -1.232879,0.21793 z"
style="font-weight:bold;font-size:10.5833px;line-height:1.25;font-family:'Lexend Deca';-inkscape-font-specification:'Lexend Deca Bold';fill:#999999;stroke-width:0.214026"
id="path96539-9" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:7.31686px;line-height:1.25;font-family:'Lexend Deca';-inkscape-font-specification:'Lexend Deca Bold';fill:#f9f9f9;fill-opacity:1;stroke:none;stroke-width:0.182922"
x="77.786804"
y="107.22778"
id="text107851"><tspan
id="tspan107849"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Lexend Deca';-inkscape-font-specification:'Lexend Deca Bold';fill:#f9f9f9;stroke-width:0.182922"
x="77.786804"
y="107.22778">W</tspan></text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

30
src/images/logo.svg Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
viewBox="0 0 68.389094 10.80555"
version="1.1"
id="svg850"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs847" />
<g
id="layer1"
transform="translate(-0.02690821,-0.09529248)">
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.5833px;line-height:0.15;font-family:'Lexend Deca';-inkscape-font-specification:'Lexend Deca';letter-spacing:-0.238125px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:0.264583"
x="-0.18475778"
y="8.5725155"
id="text1419-3"><tspan
id="tspan1417-6"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Lexend Deca';-inkscape-font-specification:'Lexend Deca Bold';fill:#333333;fill-opacity:1;stroke-width:0.264583"
x="-0.18475778"
y="8.5725155"
dx="0"
rotate="0 0 0 0 0 0 0 0 0 0 0 0 0 0"><tspan
style="fill:#808080"
id="tspan36305">Slipenko</tspan>.Wiki</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -7,6 +7,7 @@
<meta name="description" content="{{ description or metadata.description }}">
<meta name="generator" content="{{ eleventy.generator }}">
<link rel="stylesheet" href="/css/index.css">
{% favicon 'src/images/favicon.svg' %}
</head>
<body>
{{ content | safe }}

View File

@ -2,4 +2,8 @@
permalink: '/'
layout: 'base.njk'
---
Hello world!
<header class="flex justify-center w-full px-10 py-4">
<a href="/" class="block rounded-xl p-1">
{{ '/src/images/logo.svg' | svgContents("max-h-24 block w-[50vw]") | safe }}
</a>
</header>

View File

@ -1,5 +1,8 @@
module.exports = {
content: [],
content: [
'./src/css/**/*',
'./src/pages/**/*'
],
theme: {
extend: {}
},