Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Site.js
lib
Node Hugo
Commits
640fcd07
Verified
Commit
640fcd07
authored
Feb 11, 2020
by
Aral Balkan
Browse files
Fix regression due to Hugo version number change; update tests
parent
333594f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
640fcd07
...
...
@@ -7,8 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.1.1] - 2020-02-11
### Fixes
-
Fix regression due to version number change
-
Update tests
## [1.1.0] - 2020-02-11
### Changes
-
Upgrade Hugo to
[
version 0.64.1
](
https://github.com/gohugoio/hugo/releases/tag/v0.64.1
)
.
## [1.0.1] - 2020-02-10
...
...
index.js
View file @
640fcd07
...
...
@@ -155,7 +155,7 @@ class Hugo {
if
(
platform
===
undefined
)
throw
new
Error
(
'
Unsupported platform
'
,
this
.
machine
.
platform
)
if
(
architecture
===
undefined
)
throw
new
Error
(
'
Unsupported architecture
'
,
this
.
machine
.
architecture
)
const
hugoVersion
=
'
0.64.
0
'
const
hugoVersion
=
'
0.64.
1
'
const
hugoBinaryName
=
`hugo-v
${
hugoVersion
}
-
${
platform
}
-
${
architecture
}
`
const
hugoBinaryRelativePath
=
path
.
join
(
'
hugo-bin
'
,
hugoBinaryName
)
...
...
package.json
View file @
640fcd07
{
"name"
:
"@small-tech/node-hugo"
,
"version"
:
"1.1.
0
"
,
"version"
:
"1.1.
1
"
,
"description"
:
"A basic cross-platform interface to the Hugo binary from Node.js."
,
"main"
:
"index.js"
,
"scripts"
:
{
...
...
test.js
View file @
640fcd07
...
...
@@ -52,7 +52,7 @@ test('[hugo-build] ', async t => {
const
deflatedIndexPageHTML
=
fs
.
readFileSync
(
'
test/public/index.html
'
,
'
utf-8
'
).
replace
(
/
\s
/g
,
''
)
const
expectedDeflatedIndexPageHTML
=
'
<!DOCTYPEhtml><htmllang="en"><head><metaname="generator"content="Hugo0.64.
0
"/><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><title>Yes!</title></head><body><h1>Yes!</h1><p>node-hugo<strong>works!</strong></p></body></html>
'
const
expectedDeflatedIndexPageHTML
=
'
<!DOCTYPEhtml><htmllang="en"><head><metaname="generator"content="Hugo0.64.
1
"/><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><title>Yes!</title></head><body><h1>Yes!</h1><p>node-hugo<strong>works!</strong></p></body></html>
'
// Ensure generated HTML is as we expect.
t
.
strictEquals
(
expectedDeflatedIndexPageHTML
,
deflatedIndexPageHTML
,
'
index page HTML is as expected
'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment