mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 04:35:31 -04:00
create inline-svg partial function
[skip ci]
This commit is contained in:
@@ -7,6 +7,5 @@
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"rules": {
|
||||
}
|
||||
"rules": {}
|
||||
}
|
||||
|
@@ -7,8 +7,6 @@
|
||||
"preset": "lighthouse:no-pwa",
|
||||
"assertions": {
|
||||
"color-contrast": "warn",
|
||||
"errors-in-console": "warn",
|
||||
"frame-title": "warn",
|
||||
"link-text": "warn",
|
||||
"total-byte-weight": ["warn", {"minScore": 0.9}],
|
||||
"unminified-javascript": "warn",
|
||||
|
@@ -3,16 +3,11 @@
|
||||
"code-block-style": { "style": "fenced" },
|
||||
"code-fence-style": { "style": "backtick" },
|
||||
"fenced-code-language": true,
|
||||
"heading-increment": false,
|
||||
"heading-style": { "style": "atx" },
|
||||
"hr-style": { "style": "---" },
|
||||
"line-length": false,
|
||||
"no-bare-urls": false,
|
||||
"no-blanks-blockquote": true,
|
||||
"no-empty-links": false,
|
||||
"no-hard-tabs": false,
|
||||
"no-inline-html": { "allowed_elements": [ "p", "a", "strong", "em", "img", "svg", "path", "polygon", "circle", "g", "h2", "h3", "code", "span", "sup", "figure", "figcaption", "iframe" ] },
|
||||
"no-multiple-blanks": false,
|
||||
"no-inline-html": { "allowed_elements": [ "p", "a", "strong", "em", "img", "svg", "path", "polygon", "circle", "g", "code", "span", "sup", "figure", "figcaption", "iframe" ] },
|
||||
"no-trailing-punctuation": false,
|
||||
"single-h1": false,
|
||||
"whitespace": false
|
||||
|
10
.stylelintrc
10
.stylelintrc
@@ -6,20 +6,12 @@
|
||||
"plugins": ["stylelint-prettier"],
|
||||
"rules": {
|
||||
"color-hex-length": "long",
|
||||
"function-parentheses-space-inside": null,
|
||||
"function-url-quotes": null,
|
||||
"indentation": [ 2, { "severity": "warning" } ],
|
||||
"max-nesting-depth": 6,
|
||||
"number-no-trailing-zeros": null,
|
||||
"order/properties-alphabetical-order": null,
|
||||
"rule-empty-line-before": null,
|
||||
"scss/dollar-variable-colon-space-after": null,
|
||||
"selector-list-comma-newline-after": null,
|
||||
"selector-max-compound-selectors": null,
|
||||
"selector-max-id": null,
|
||||
"selector-no-qualifying-type": null,
|
||||
"selector-pseudo-element-no-unknown": [ true, { "ignorePseudoElements": [ "cue" ] } ],
|
||||
"shorthand-property-no-redundant-values": null,
|
||||
"string-quotes": [ "double", { "severity": "warning" } ]
|
||||
"shorthand-property-no-redundant-values": null
|
||||
}
|
||||
}
|
||||
|
@@ -250,7 +250,7 @@
|
||||
<header>
|
||||
<nav>
|
||||
<a id="logo" href="{{ .Site.BaseURL }}" title="{{ .Site.Title }}">
|
||||
{{ partial "svg/logo.svg" (dict "width" 30 "height" 45) }}
|
||||
{{ partial "functions/inline-svg" (dict "src" "img/logo.svg" "width" 30 "height" 45) }}
|
||||
<span id="name">{{ .Site.Title }}</span>
|
||||
</a>
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{{ $svg := resources.Get "img/logo.svg" -}}
|
||||
{{ $svg := resources.Get .src -}}
|
||||
{{ $html := $svg.Content -}}
|
||||
|
||||
{{/* remove unneeded tags/attributes when SVG is inlined versus a .svg file */}}
|
||||
@@ -10,5 +10,6 @@
|
||||
|
||||
{{ $html = replace $html "<svg" $wxh -}}
|
||||
|
||||
{{/* bit of a hack: calling .Permalink so that the SVG file is published too */}}
|
||||
{{ printf "<!-- auto-inlined from: %s -->" $svg.Permalink | safeHTML }}
|
||||
{{ $html | safeHTML -}}
|
@@ -1,7 +1,7 @@
|
||||
<header>
|
||||
<nav>
|
||||
<a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" rel="me author" aria-label="{{ .Site.Title }}">
|
||||
{{ partial "svg/logo.svg" (dict "width" 28 "height" 40) }}
|
||||
{{ partial "functions/inline-svg" (dict "src" "img/logo.svg" "width" 28 "height" 40) }}
|
||||
<h1 id="name">{{ .Site.Title }}</h1>
|
||||
</a>
|
||||
<ul>
|
||||
|
Reference in New Issue
Block a user