This repository has been archived by the owner on Jan 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate to 11ty * fixed site
- Loading branch information
Showing
57 changed files
with
7,163 additions
and
559 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,52 @@ | ||
const { DateTime, Settings } = require("luxon"); | ||
const util = require("util"); | ||
|
||
Settings.defaultLocale = "ru"; | ||
|
||
module.exports = function(eleventyConfig) { | ||
// Layout aliases for convenience | ||
eleventyConfig.addLayoutAlias("default", "layouts/base.njk"); | ||
eleventyConfig.addLayoutAlias("conf", "layouts/conf.njk"); | ||
|
||
// a debug utility | ||
eleventyConfig.addFilter("dump", obj => { | ||
return util.inspect(obj); | ||
}); | ||
|
||
eleventyConfig.addFilter("htmlDate", dateObj => { | ||
return DateTime.fromJSDate(dateObj, { | ||
zone: "utc" | ||
}).toFormat("y-MM-dd"); | ||
}); | ||
|
||
// Grab excerpts and sections from a file | ||
eleventyConfig.addFilter("section", require("./src/utils/section.js")); | ||
|
||
// compress and combine js files | ||
eleventyConfig.addFilter("jsmin", require("./src/utils/minify-js.js")); | ||
|
||
// minify the html output when running in prod | ||
if (process.env.NODE_ENV == "production") { | ||
eleventyConfig.addTransform( | ||
"htmlmin", | ||
require("./src/utils/minify-html.js") | ||
); | ||
} | ||
|
||
// Static assets to pass through | ||
eleventyConfig.addPassthroughCopy("./src/site/fonts"); | ||
eleventyConfig.addPassthroughCopy("./src/site/images"); | ||
eleventyConfig.addPassthroughCopy("./src/site/css"); | ||
|
||
return { | ||
dir: { | ||
input: "src/site", | ||
includes: "_includes", | ||
output: "dist" | ||
}, | ||
passthroughFileCopy: true, | ||
templateFormats: ["njk", "md"], | ||
htmlTemplateEngine: "njk", | ||
markdownTemplateEngine: "njk" | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,2 +1,13 @@ | ||
# dependecies installed by npm | ||
/node_modules | ||
|
||
# build artefacts | ||
/dist | ||
/src/site/css | ||
|
||
# secrets | ||
.env | ||
|
||
# other | ||
.DS_Store | ||
.vscode |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,41 +1,35 @@ | ||
[build] | ||
command = "npm run build" | ||
publish = "dist" | ||
# functions = "./src/functions" | ||
|
||
[context.production] | ||
environment = { NODE_VERSION = "10.15.3", NODE_ENV = "production" } | ||
|
||
[dev] | ||
command = "npm run start" | ||
publish = "dist" | ||
port = 3000 | ||
targetPort = 8181 | ||
NODE_ENV = "development" | ||
# functionsPort = 34567 | ||
|
||
[[redirects]] | ||
from = "http://jjermany.netlify.com/*" | ||
to = "http://jjermany.blog/:splat" | ||
status = 301 | ||
force = true | ||
from = "/post/*" | ||
to = "/blog/:splat" | ||
|
||
[[redirects]] | ||
from = "/post/" | ||
to = "/" | ||
status = 301 | ||
|
||
[build] | ||
publish = "public" | ||
command = "hugo --gc --minify" | ||
|
||
[context.production.environment] | ||
HUGO_VERSION = "0.54.0" | ||
HUGO_ENV = "production" | ||
HUGO_ENABLEGITINFO = "true" | ||
|
||
[context.split1] | ||
command = "hugo --gc --minify --enableGitInfo" | ||
|
||
[context.split1.environment] | ||
HUGO_VERSION = "0.54.0" | ||
HUGO_ENV = "production" | ||
|
||
[context.deploy-preview] | ||
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" | ||
|
||
[context.deploy-preview.environment] | ||
HUGO_VERSION = "0.54.0" | ||
|
||
[context.branch-deploy] | ||
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" | ||
|
||
[context.branch-deploy.environment] | ||
HUGO_VERSION = "0.54.0" | ||
[[redirects]] | ||
from = "/blog/" | ||
to = "/" | ||
status = 301 | ||
|
||
[context.next.environment] | ||
HUGO_ENABLEGITINFO = "true" | ||
[[redirects]] | ||
from = "http://jjermany.netlify.com/*" | ||
to = "http://jjermany.blog/:splat" | ||
status = 301 | ||
force = true |
Oops, something went wrong.