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
const fs = require("fs"); | |
const postMethods = require("./posts"); | |
const config = require("./config"); | |
const posts = fs | |
.readdirSync(config.dev.postsdir) | |
.map(post => post.slice(0, -3)) | |
.map(post => postMethods.createPost(post)); | |
if (!fs.existsSync(config.dev.outdir)) fs.mkdirSync(config.dev.outdir); |
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
const config = { | |
blogName: "Blog", | |
blogDescription: "Sharing what I learn as a web developer & designer", | |
authorName: "Kartik Nair", | |
authorDescription: | |
"a web developer and designer making lot's of stuff in Dubai", | |
authorTwitter: "https://twitter.com/kartiknair", | |
dev: { | |
postsdir: "./content", |
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
const homepage = posts => ` | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta name="description" content="${config.blogDescription}" /> | |
<title>${config.blogName}</title> | |
</head> | |
<body> |
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
const addHomePage = posts => { | |
fs.writeFile(`${config.dev.outdir}/index.html`, homepage(posts), e => { | |
if (e) throw e; | |
console.log(`index.html was created successfully`); | |
}); | |
}; |
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
const fs = require("fs"); | |
const postMethods = require("./posts"); | |
const config = require("./config"); | |
const addHomePage = require("./homepage"); | |
const posts = fs | |
.readdirSync(config.dev.postsdir) | |
.map(post => post.slice(0, -3)) | |
.map(post => postMethods.createPost(post)) | |
.sort(function(a, b) { |
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
:root { | |
font-size: calc(0.75rem + 0.5vw); | |
} | |
.grotesk { | |
width: 60%; | |
margin: 5% 20% 0 20%; | |
} | |
@media (max-width: 500px) { |
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
$bg: #1e3b5a; | |
$fg-body: #99b7c3; | |
$fg-headings: #c1d6df; | |
$hr-color: rgba(153, 183, 195, 0.2); | |
$a-color: #d8e9f0; | |
$pre-bg: rgba(153, 183, 195, 0.07); | |
$pre-color: $fg-body; |
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
@font-face { | |
font-family: lyon; | |
src: url("../fonts/LyonDisplay-Bold.otf"); | |
font-weight: 800; | |
} | |
@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500&display=swap"); | |
$font-fam-main: "EB Garamond", serif; | |
$font-fam-headings: lyon, serif; |
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
html, | |
body { | |
font-size: 1rem; | |
} | |
h1 { | |
font-size: 2.25rem; | |
} | |
h2 { |
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 one is for smaller phones ↓ */ | |
@media (max-width: 350px) { | |
html { | |
font-size: 0.9rem; | |
} | |
} | |
/* ↓ These are for high-res displays ↓ */ | |
@media (min-width: 1900px) { | |
html { |