Skip to content

Commit 532e953

Browse files
committed
updates for Ghost 5.0
1 parent 44cd702 commit 532e953

File tree

9 files changed

+13018
-8704
lines changed

9 files changed

+13018
-8704
lines changed

assets/styles/partials/2 Base Styles.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ html {
99
}
1010

1111
body {
12-
font: normal 300 100%/1.5 var(--font-family);
12+
font: normal 300 100%/1.5 var(--font-family-body-custom);
1313
color: var(--text-color);
1414
background-color: var(--background-color);
1515
background-position: center;
@@ -27,6 +27,7 @@ body {
2727

2828
h1, h2, h3,
2929
h4, h5, h6 {
30+
font-family: var(--font-family-heading-custom);
3031
line-height: 1;
3132
text-rendering: optimizeLegibility;
3233
margin-bottom: 0.375em;

assets/styles/partials/5 Footer.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
top: -23px;
8686
left: -1px;
8787
color: rgba(255,255,255,0.9);
88-
font-family: var(--font-family);
8988
font-size: 1.1rem;
9089
font-weight: bold;
9190
line-height: 1em;

assets/styles/variables.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
--highlight-color: RGBA(147, 187, 201, 0.5);
99

1010
/* Fonts */
11-
--font-family: "Oxygen", "Helvetica Neue", "Arial", sans-serif;
11+
--font-family-theme: "Oxygen", "Helvetica Neue", "Arial", sans-serif;
12+
--font-family-heading-custom: var(--gh-font-heading, var(--font-family-theme));
13+
--font-family-body-custom: var(--gh-font-body, var(--font-family-theme));
1214
}

default.hbs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
<head>
44
{{! Document Settings }}
55
<meta charset="utf-8" />
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
76

87
{{! Page Meta }}
98
<title>{{meta_title}}</title>
10-
<meta name="HandheldFriendly" content="True">
119
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
1210

1311
<link rel="shortcut icon" href="{{asset "favicon.ico"}}">
1412

1513
{{! Styles and Scripts }}
1614
<link rel="stylesheet" type="text/css" href="{{asset "styles/build/style.css"}}">
17-
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Oxygen:400,700">
15+
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Oxygen:400,700">
1816

1917
{{! Prefetch next page and previous pages, if they exist }}
2018
{{#if pagination.next}}<link href="{{page_url pagination.next}}" rel="prefetch">{{/if}}

gulpfile.js

Lines changed: 0 additions & 98 deletions
This file was deleted.

gulpfile.mjs

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
'use strict';
2+
3+
import { src, dest, watch, series, parallel } from 'gulp';
4+
import postcss from 'gulp-postcss';
5+
import sourcemaps from 'gulp-sourcemaps';
6+
import minify from 'gulp-terser';
7+
import zip from 'gulp-zip';
8+
9+
// PostCSS Plugins
10+
import postcssImport from 'postcss-import';
11+
import postcssNested from 'postcss-nested';
12+
import postcssCustomProperties from 'postcss-custom-properties';
13+
import postcssNormalize from 'postcss-normalize';
14+
import postcssSortMediaQueries from 'postcss-sort-media-queries';
15+
import autoprefixer from 'autoprefixer';
16+
import cssnano from 'cssnano';
17+
18+
19+
const paths = {
20+
styles: {
21+
src: [ 'assets/styles/*.css', '!assets/styles/variables.css' ],
22+
dest: 'assets/styles/build/',
23+
watch: [ 'assets/styles/**/*.css', '!assets/styles/build/**' ]
24+
},
25+
scripts: {
26+
src: 'assets/scripts/*.js',
27+
dest: 'assets/scripts/build/',
28+
watch: [ 'assets/scripts/**/*.css', '!assets/scripts/build/**' ]
29+
}
30+
};
31+
32+
function styles() {
33+
const processors = [
34+
postcssImport(),
35+
postcssNested(),
36+
postcssCustomProperties(),
37+
postcssNormalize( { forceImport: true } ),
38+
postcssSortMediaQueries(),
39+
autoprefixer(),
40+
cssnano( {
41+
preset: [
42+
'default',
43+
{
44+
calc: false,
45+
mergeLonghand: false // These conflict with processing nested calc() and env values().
46+
}
47+
]
48+
} )
49+
];
50+
return src( paths.styles.src )
51+
.pipe( sourcemaps.init() )
52+
.pipe( postcss( processors ) )
53+
.pipe( sourcemaps.write( './' ) )
54+
.pipe( dest( paths.styles.dest ) );
55+
}
56+
57+
function scripts() {
58+
return src( paths.scripts.src )
59+
.pipe( sourcemaps.init() )
60+
.pipe( minify() )
61+
.pipe( sourcemaps.write( './' ) )
62+
.pipe( dest( paths.scripts.dest ) );
63+
}
64+
65+
function watchTask() {
66+
watch( paths.styles.watch, styles );
67+
watch( paths.scripts.src, scripts );
68+
}
69+
70+
function bundle() {
71+
return src(
72+
[
73+
'./*',
74+
'./assets/**',
75+
'./locales/**',
76+
'./partials/**',
77+
'!./.*',
78+
'!./node_modules',
79+
'!./distribution'
80+
],
81+
{ base: '.' }
82+
)
83+
.pipe( zip( 'decode.zip' ) )
84+
.pipe( dest( './distribution' ) );
85+
}
86+
87+
// Workflows
88+
// $ gulp: Builds, prefixes, and minifies CSS files; concatenates and minifies JS files; watches for changes. The works.
89+
const defaultTask = parallel( styles, scripts, watch );
90+
91+
// $ gulp build: Builds, prefixes, and minifies CSS files; concatenates and minifies JS files. For deployments.
92+
const buildTask = parallel( styles, scripts );
93+
94+
// $ gulp bundle: Builds and bundles theme into a ZIP for simple theme install.
95+
const bundleTask = series( buildTask, bundle );
96+
97+
// Exports
98+
export {
99+
styles,
100+
scripts,
101+
watchTask as watch,
102+
buildTask as build,
103+
bundleTask as bundle
104+
};
105+
106+
export default defaultTask;

0 commit comments

Comments
 (0)