Skip to content

Commit

Permalink
feat: add module options
Browse files Browse the repository at this point in the history
  • Loading branch information
luciorubeens committed Oct 26, 2019
1 parent 6d87ab4 commit 61bcaf1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
11 changes: 10 additions & 1 deletion module.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module.exports = function(moduleOptions) {
const options = Object.assign({}, this.options.p404, moduleOptions)
const defaultOptions = {
linkText: 'Click here to return to home.',
}

const options = Object.assign(
{},
defaultOptions,
this.options.p404,
moduleOptions
)

this.options.env = {
...this.options.env,
Expand Down
4 changes: 2 additions & 2 deletions src/component/404.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
display: block;
max-width: 25rem;
margin-bottom: 2rem;
margin-top: 1rem;
margin-top: 2rem;
}
.p404__content__illustration__img {
display: block;
Expand All @@ -38,6 +38,6 @@
font-size: 2rem;
letter-spacing: 0.1rem;
}
.p404__content__description {
.p404__content__link {
margin-bottom: 1rem;
}
11 changes: 2 additions & 9 deletions src/component/404.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
: this.options.description || properties.description
const backgroundColor = this.options.colorBg || properties.colorBg
const textColor = this.options.colorText || properties.colorText
const linkText = this.options.linkText

return h(
'div',
Expand Down Expand Up @@ -75,15 +76,7 @@ export default {
{
class: 'p404__content__link',
},
[
'In the meantime, ',
h(
'a',
{ attrs: { href: '/' } },
'click here to return to home'
),
'.',
]
[h('a', { attrs: { href: '/' } }, linkText)]
),
]
),
Expand Down

0 comments on commit 61bcaf1

Please sign in to comment.