This repository has been archived by the owner on Jan 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static site generator (Eleventy) (#134)
- Loading branch information
1 parent
d259bb6
commit 8d2c6f7
Showing
35 changed files
with
1,952 additions
and
1,411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const minifyHTML = require("./lib/transfroms/minifyHtml.js"); | ||
|
||
module.exports = function (config) { | ||
config.addTransform("minifyHtml", minifyHTML); | ||
|
||
config.addPassthroughCopy({ "favicons": "/" }); | ||
config.addPassthroughCopy("src/**/*.css"); | ||
config.addPassthroughCopy("src/**/*.js"); | ||
config.addPassthroughCopy("src/**/*.svg"); | ||
config.addPassthroughCopy("src/**/*.json"); | ||
|
||
config.addGlobalData("urlOrigin", process.env.URL_ORIGIN || "http://localhost:8080"); | ||
|
||
return { | ||
dir: { | ||
input: "src", | ||
output: "dist", | ||
}, | ||
|
||
"templateFormats": ['njk', 'html'], | ||
"htmlTemplateEngine": "njk", | ||
"markdownTemplateEngine": "njk", | ||
"javascriptTemplateEngine": "njk", | ||
"dataTemplateEngine": "njk", | ||
"passthroughFileCopy": true, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ jobs: | |
|
||
- name: Build | ||
run: npm run build | ||
env: | ||
URL_ORIGIN: 'https://meos.lima.zone' | ||
|
||
- name: 📂 Sync files | ||
uses: SamKirkland/[email protected] | ||
|
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const htmlmin = require("html-minifier-terser"); | ||
|
||
module.exports = function (content) { | ||
if (process.env.ELEVENTY_RUN_MODE === "serve") { return content; } | ||
|
||
if ((this.page.outputPath || "").endsWith(".html")) { | ||
let minified = htmlmin.minify(content, { | ||
useShortDoctype: false, | ||
collapseWhitespace: true, | ||
// preserveLineBreaks: true, | ||
removeComments: true, | ||
minifyCSS: true, | ||
minifyJS: true, | ||
}); | ||
|
||
return minified; | ||
} | ||
|
||
return content; | ||
}; |
Oops, something went wrong.