Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.6.0 #32

Merged
merged 42 commits into from
Aug 1, 2021
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e50038f
builder and hp.config
ECorreia45 Jul 21, 2021
7a6302c
documentation updates
ECorreia45 Jul 24, 2021
7867ba9
better doc page content
ECorreia45 Jul 24, 2021
7b4e992
Merge pull request #28 from beforesemicolon/make-builder-use-hp-config
ECorreia45 Jul 25, 2021
6ddea72
refactor engine into small parts
ECorreia45 Jul 24, 2021
7252e61
cache service
ECorreia45 Jul 24, 2021
f7700e8
improved caching for live engine
ECorreia45 Jul 24, 2021
153a273
better template error handling in production
ECorreia45 Jul 24, 2021
68dc4f8
css transform test fix
ECorreia45 Jul 24, 2021
a23688a
engine tests
ECorreia45 Jul 24, 2021
ad7fd5a
cache service tests
ECorreia45 Jul 24, 2021
52c038a
restore cwd
ECorreia45 Jul 24, 2021
53b7974
remove package lock
ECorreia45 Jul 24, 2021
594e534
remove resource check for now
ECorreia45 Jul 24, 2021
f7c0fc9
trial test fix
ECorreia45 Jul 24, 2021
889393f
fix js ath
ECorreia45 Jul 24, 2021
6edeeb6
fix error config bug
ECorreia45 Jul 24, 2021
9d6c57d
hp config util test
ECorreia45 Jul 25, 2021
afe616c
remove engine testing files
ECorreia45 Jul 25, 2021
1a2c331
serve live page
ECorreia45 Jul 26, 2021
5016ec7
support builder extended options
ECorreia45 Jul 26, 2021
22bf857
engine data to 404 page as well
ECorreia45 Jul 26, 2021
416bcb5
css html extractor option and no sourcemap
ECorreia45 Jul 26, 2021
2260103
live server page with seo and assets path fixes
ECorreia45 Jul 26, 2021
550ea82
better handle manifest files and intro to resource type
ECorreia45 Jul 27, 2021
01884e4
improve caching
ECorreia45 Jul 29, 2021
3b370b6
simplify and improve resource caching
ECorreia45 Jul 30, 2021
b7e1865
fix broken tests
ECorreia45 Jul 30, 2021
af1f3e8
only use google analytics on production
ECorreia45 Jul 30, 2021
7d8970e
Merge pull request #31 from beforesemicolon/proper-production-engine
ECorreia45 Jul 30, 2021
c9418fe
support tag style on engine
ECorreia45 Jul 21, 2021
ef67beb
collect styles on engine
ECorreia45 Jul 22, 2021
7a603df
simplified engine styles
ECorreia45 Jul 30, 2021
ccf69cb
fix broken tests
ECorreia45 Jul 30, 2021
72b3ed0
builder and styles
ECorreia45 Jul 31, 2021
e409efb
fix broken test
ECorreia45 Jul 31, 2021
fda88bb
style tests
ECorreia45 Jul 31, 2021
dba99ff
Merge pull request #29 from beforesemicolon/tag-style-support
ECorreia45 Jul 31, 2021
654dd46
bump version
ECorreia45 Jul 31, 2021
eacf527
doc renamed
ECorreia45 Jul 31, 2021
657f954
convert some partials to tags
ECorreia45 Aug 1, 2021
ff78d73
documentation update for import style and tag style
ECorreia45 Aug 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
engine data to 404 page as well
ECorreia45 committed Jul 26, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 22bf857b9e7fd7afa70e4d9711c61d5a887c1302
5 changes: 3 additions & 2 deletions core/engine/Router.js
Original file line number Diff line number Diff line change
@@ -105,13 +105,14 @@ class Router {
}
} else if (!ext || ext === '.html') {
const template = this.pagesRoutes[req.path] ?? this.pagesRoutes[`${req.path}/`];
const contextData = this.#onPageRequest(req) || {};

if (template) {
return res.render(template, this.#onPageRequest(req) || {}, (err, html) => this.#handleTemplateError(err, html, res))
return res.render(template, contextData, (err, html) => this.#handleTemplateError(err, html, res))
} else if (!ext || ext === '.html') {
if (req.path.startsWith('/404')) {
return this.pagesRoutes['/404']
? res.render(this.pagesRoutes['/404'], (err, html) => this.#handleTemplateError(err, html, res))
? res.render(this.pagesRoutes['/404'], contextData, (err, html) => this.#handleTemplateError(err, html, res))
: res.send('<h1>404 - Page Not Found</h1>')
}

1 change: 1 addition & 0 deletions core/engine/index.js
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ const engine = (app, pagesDirectoryPath, opt = {}) => {
deepStrictEqual(context, oldContext);
return callback(null, await cacheService.getCachedFile(filePath));
} catch (e) {
// if the deepStrictEqual fails it is because the data is the same
}
}

3 changes: 2 additions & 1 deletion core/engine/traverse-node.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@ function traverseNode(pagesDirectoryPath) {
const resourceFullPath = path.resolve(nodeFile.fileDirectoryPath, srcPath);

if (resourceFullPath.startsWith(pagesDirectoryPath)) {
node.setAttribute(attrName, resourceFullPath.replace(pagesDirectoryPath, ''))
const value = resourceFullPath.replace(pagesDirectoryPath, '')
node.setAttribute(attrName, value)
}
}
}