Skip to content

Commit cfa1b42

Browse files
committed
Allow choosing background image in _config.yml
1 parent 4d3f1ff commit cfa1b42

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ description: "Jekyll version of the Massively theme by HTML5UP"
55
locale: en_US
66
baseurl: "" # the subpath of your site, e.g. /blog
77
url: "" # the base hostname & protocol for your site
8+
background_image: /images/bg.jpg
9+
# Tip: The color palette and other styles can be configured in /_sass/lib/_vars.scss
810

911
defaults:
1012
- scope:

_sass/layout/_wrapper.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
width: 100%;
2020
height: 100%;
2121
background-color: _palette(wrapper-bg);
22-
background-image: url('../../images/overlay.png'), linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('../../images/bg.jpg');
22+
background-image: url('../../images/overlay.png'), linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url($background_image);
2323
background-size: auto, auto, 100% auto;
2424
background-position: center, center, top center;
2525
background-repeat: repeat, no-repeat, no-repeat;
@@ -61,4 +61,4 @@
6161
background-size: auto, auto, auto 175%;
6262
}
6363
}
64-
}
64+
}

assets/css/main.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Jekyll automatically transpiles this file; access via {{site.url}}/assets/css/main.css
33
---
44

5+
$background_image: '{{site.background_image}}';
6+
57
@import 'libs/vars';
68
@import 'libs/functions';
79
@import 'libs/mixins';

assets/css/noscript.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#wrapper {
2020
background-color: _palette(wrapper-bg);
21-
background-image: url('../../images/overlay.png'), linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('../../images/bg.jpg');
21+
background-image: url('../../images/overlay.png'), linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('{{site.background_image}}');
2222
background-size: auto, auto, 100% auto;
2323
background-position: center, center, top center;
2424
background-repeat: repeat, no-repeat, no-repeat;

0 commit comments

Comments
 (0)