Add Customizations.

- Add PrismJS dependencies (baked-in)
- Add Ko-fi button (in-line)
- Bump dependencies to fix inability to build.
- Concatenate *.css into single source.css.
This commit is contained in:
2023-12-18 14:48:39 +09:00
parent 558dcca351
commit e0380e0121
15 changed files with 2123 additions and 1038 deletions

2
assets/built/source.css Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

136
assets/css/ko-fi.css Normal file
View File

@@ -0,0 +1,136 @@
/*
Ko-fi Button Widget CSS.
*/
img.kofiimg {
display: initial;
vertical-align: middle;
height: 13px;
width: 20px;
padding-top: 0;
padding-bottom: 0;
border: none;
margin-top: 0;
margin-right: 5px;
margin-left: 0;
margin-bottom: 3px;
content: url(../images/ko-fi/cup-border.png);
}
.kofiimg:after {
vertical-align: middle;
height: 25px;
padding-top: 0;
padding-bottom: 0;
border: none;
margin-top: 0;
margin-right: 6px;
margin-left: 0;
margin-bottom: 4px;
content: url(../images/ko-fi/whitelogo.svg);
}
.kofi-btn-container {
--button-background-color: #fff;
--button-background-color-active: rgba(255, 255, 255, 0.8);
--button-text-color: #15171a;
--button-text-color-active: #15171a;
display: inline-block;
white-space: nowrap;
min-width: 160px;
}
a.kofi-button {
background-color: var(--button-background-color);
box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
line-height: 36px;
min-width: 150px;
display: inline-block;
padding: 2px 12px;
text-align: center;
border-radius: 7px;
color: var(--button-text-color);
cursor: pointer;
overflow-wrap: break-word;
vertical-align: middle;
border: 0 none #fff;
/* font-family: 'Quicksand', Helvetica, Century Gothic, sans-serif; */
font-family: var(--font-sans);
text-decoration: none;
text-shadow: none;
font-weight: 700;
font-size: 14px;
}
a.kofi-button:hover,
a.kofi-button:active,
a.kofi-button:visited {
color: var(--button-text-color);
text-decoration: none;
background: var(--button-background-color-active);
}
a.kofi-button:hover span.kofitext,
a.kofi-button:active span.kofitext {
text-decoration: none;
color: var(--button-text-color-active);
opacity: 1;
}
span.kofitext {
color: var(--button-text-color);
letter-spacing: -0.15px;
text-wrap: none;
vertical-align: middle;
line-height: 33px;
padding: 0;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 1px rgba(34, 34, 34, 0.05);
}
span.kofitext img.kofiimg {
height: 15px;
width: 22px;
display: initial;
animation: kofi-wiggle 3s infinite;
}
@keyframes kofi-wiggle {
0% {
transform: rotate(0) scale(1);
}
60% {
transform: rotate(0) scale(1);
}
75% {
transform: rotate(0) scale(1.12);
}
80% {
transform: rotate(0) scale(1.1);
}
84% {
transform: rotate(-10deg) scale(1.1);
}
88% {
transform: rotate(10deg) scale(1.1);
}
92% {
transform: rotate(-10deg) scale(1.1);
}
96% {
transform: rotate(10deg) scale(1.1);
}
100% {
transform: rotate(0) scale(1);
}
}

5
assets/css/prism.min.css vendored Normal file
View File

@@ -0,0 +1,5 @@
/* PrismJS 1.29.0
https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+apacheconf+aspnet+bash+csharp+diff+git+go+ini+lua+python+sql+typescript+xml-doc+yaml&plugins=diff-highlight */
code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}
pre.diff-highlight>code .token.deleted:not(.prefix),pre>code.diff-highlight .token.deleted:not(.prefix){background-color:rgba(255,0,0,.1);color:inherit;display:block}pre.diff-highlight>code .token.inserted:not(.prefix),pre>code.diff-highlight .token.inserted:not(.prefix){background-color:rgba(0,255,128,.1);color:inherit;display:block}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xml:space="preserve"
style="enable-background:new 0 0 56.7 56.7;"
viewBox="0 0 56.7 56.7"
y="0px"
x="0px"
id="Layer_1"
version="1.1"><metadata
id="metadata15"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs13" /><style
id="style3"
type="text/css">
.st0{fill:#FFFFFF;}
</style><g
id="g5"><path
style="fill:#ffffff;fill-opacity:1"
id="path7"
d="m 23.959,10.600001 c -9.6,0 -17.4,7.8 -17.4,17.4 0,9.6 7.8,17.4 17.4,17.4 9.6,0 17.4,-7.8 17.4,-17.4 0,-9.6 -7.8,-17.4 -17.4,-17.4 z m 0.3,27.2 -0.5,0.2 -0.4,-0.2 c -0.4,-0.2 -9.8,-5.4 -9.8,-11.3 0,-3.8 2.5,-6.8 5.8,-6.8 1.6,0 3.1,0.7 4.5,2.1 1.3,-1.4 2.9,-2.1 4.5,-2.1 3.2,0 5.8,3 5.8,6.9 -0.1,5.8 -9.5,11 -9.9,11.2 z"
class="st0" /><path
style="fill:#ffffff;fill-opacity:1"
id="path9"
d="m 56.759293,28.5 c 0,-2.6 -2,-3 -3.4,-3.1 l -5.5,0 c -0.8,-8.4 -6,-15.7 -14.5,-19.4 -10.7,-4.6 -23.3,-0.7 -29.6,9.1 -7.6999993,12.1 -3.09999997,27.9 9.5,34.2 10.3,5.1 23.1,2 29.9,-7.3 2.5,-3.4 3.8,-6.9 4.3,-10.7 l 6.3,0 c 1.5,0 3,-0.5 3,-2.8 z m -40.8,17.7 c -11.3,-5 -15.39999897,-18.8 -8.7,-29.1 5.2,-8.2 15.8,-11.3 24.7,-7.4 11.3,5 15.4,18.8 8.7,29.1 -5.3,8.1 -15.9,11.3 -24.7,7.4 z"
class="st0" /></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

24
assets/js/lib/prism.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -8,14 +8,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{!-- Preload main styles and scripts for better performance --}}
<link rel="preload" as="style" href="{{asset "built/screen.css"}}">
<link rel="preload" as="style" href="{{asset "built/source.css"}}">
<link rel="preload" as="script" href="{{asset "built/source.js"}}">
{{!-- Fonts are preloaded and defined in the default template to avoid layout shift --}}
{{> "typography/fonts"}}
{{!-- Theme assets - use the {{asset}} helper to reference styles & scripts, this will take care of caching and cache-busting automatically --}}
<link rel="stylesheet" type="text/css" href="{{asset "built/screen.css"}}">
<link rel="stylesheet" type="text/css" href="{{asset "built/source.css"}}">
{{!-- Custom background color --}}
<style>
@@ -25,6 +25,7 @@
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
/* The script for calculating the color contrast has been taken from
https://gomakethings.com/dynamically-changing-the-text-color-based-on-background-color-contrast-with-vanilla-js/ */
var accentColor = getComputedStyle(document.documentElement).getPropertyValue('--background-color');
@@ -39,8 +40,8 @@
var b = parseInt(accentColor.substr(4, 2), 16);
var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
var textColor = (yiq >= 128) ? 'dark' : 'light';
document.documentElement.className = `has-${textColor}-text`;
});
</script>
{{!-- This tag outputs all your advanced SEO meta, structured data, and other important settings, it should always be the last tag before the closing head tag --}}

View File

@@ -45,7 +45,10 @@ function hbs(done) {
function css(done) {
pump([
src('assets/css/screen.css', {sourcemaps: true}),
src([
'assets/css/*.css'
], {sourcemaps: true}),
concat('source.css'),
postcss([
easyimport,
autoprefixer(),

View File

@@ -1,5 +1,5 @@
{
"name": "source",
"name": "source-davejansen",
"description": "A default theme for the Ghost publishing platform",
"demo": "https://source.ghost.io",
"version": "1.3.2",
@@ -44,8 +44,8 @@
"@tryghost/release-utils": "0.8.1",
"autoprefixer": "10.4.7",
"beeper": "2.1.0",
"cssnano": "5.1.12",
"gscan": "4.43.1",
"cssnano": "^6.0.2",
"gscan": "4.39.4",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2",
@@ -53,8 +53,8 @@
"gulp-uglify": "3.0.2",
"gulp-zip": "5.1.0",
"inquirer": "8.2.4",
"postcss": "8.2.13",
"postcss-easy-import": "4.0.0",
"postcss": "^8.4.32",
"postcss-easy-import": "^4.0.0",
"pump": "3.0.0"
},
"browserslist": [

View File

@@ -1,6 +1,5 @@
<footer class="gh-footer{{#match @custom.header_and_footer_color "Accent color"}} has-accent-color{{/match}} gh-outer">
<div class="gh-footer-inner gh-inner">
<div class="gh-footer-bar">
<span class="gh-footer-logo is-title">
{{#if @site.logo}}

View File

@@ -47,6 +47,12 @@
{{/unless}}
</div>
{{/unless}}
<div class="kofi-btn-container">
<a title="Support me on ko-fi.com" class="kofi-button" href="https://ko-fi.com/K3K0G2FVA" target="_blank"><span
class="kofitext"><img src="{{asset "images/ko-fi/cup-border.png" }}" alt="Ko-fi donations"
class="kofiimg">Buy me a coffee</span></a>
</div>
</div>
</div>

2929
yarn.lock

File diff suppressed because it is too large Load Diff