Skip to content

Commit

Permalink
Add new 11ty site
Browse files Browse the repository at this point in the history
  • Loading branch information
swaroopsm committed Jul 21, 2020
1 parent 4c53b00 commit 5250a81
Show file tree
Hide file tree
Showing 17 changed files with 4,421 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { Liquid } = require("liquidjs");

module.exports = config => {
config.setLibrary("liquid", new Liquid({ extname: ".liquid" }));

config.addPassthroughCopy({ "./assets/images": "assets/images" });

return {
dir: {
input: `./content`,
output: `./_site`,
layouts: "../_layouts",
includes: "../_includes",
data: "../_data"
},
htmlTemplateEngine: "liquid"
};
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ public/
server.yml
robots.txt
sitemap.xml
_site
node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v12.16.3
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Personal Website
6 changes: 6 additions & 0 deletions _data/site.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"url": "https://www.swaroopsm.com",
"github": "https://www.github.com/swaroopsm",
"twitter": "https://www.twitter.com/smswaroop",
"mail": "[email protected]"
}
3 changes: 3 additions & 0 deletions _includes/footer.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer class="text-center text-gray-20 pt-20 text-sm">
<code>&copy; 2020 / built using <a href="https://www.11ty.dev/" target="_blank" rel="noopener noreferrer">11ty</a></code>
</footer>
19 changes: 19 additions & 0 deletions _includes/header.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<header class="px-6">
<div class="container pt-16 lg:pt-24 flex items-center justify-center">
<a href="/" class="inline-block border-black hover:border-b-2">
<div class="flex items-center">
<img src="/assets/images/avatar.jpg" alt="Photo of Swaroop Sethumadhavan" class="w-16 rounded-full inline" />
<span class="text-3xl lg:text-4xl font-bold ml-1">
/swaroop
</span>
</div>
</a>
</div>
<nav class="flex items-center justify-center mt-6">
<ul class="flex space-x-6 lg:text-xl">
<li><a href="mailto:{{site.mail}}">/mail</a></li>
<li><a href="{{site.github}}" target="_blank" rel="noopener noreferrer">/github</a></li>
<li><a href="{{site.twitter}}" target="_blank" rel="noopener noreferrer">/twitter</a></li>
</ul>
</nav>
</header>
18 changes: 18 additions & 0 deletions _layouts/default.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
<link rel="stylesheet" href="/assets/site.css" />
</head>
<body class="font-sans antialiased font-normal text-black">
{% include "header" %}

<main>
{{ content }}
</main>

{% include "footer" %}
</body>
</html>
3 changes: 3 additions & 0 deletions assets/css/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap"); */

@tailwind base;
9 changes: 9 additions & 0 deletions assets/css/site.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import "base";

@tailwind components;

.container {
@apply max-w-6xl mx-auto;
}

@tailwind utilities;
Binary file added assets/images/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions content/content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"layout": "default",
"title": "Swaroop Sethumadhavan"
}
9 changes: 9 additions & 0 deletions content/index.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="container text-center px-6 py-4 lg:py-12">
<h2 class="text-2xl lg:text-4xl">
<span class="block my-2">👋 </span><span></span> <span class="font-bold inline-block border-b-2">Swaroop Sethumadhavan</span>
</h2>
<div class="max-w-3xl mx-auto mt-6 leading-loose text-lg lg:text-2xl lg:py-6 px-6">
<p>I work as a Front-End Developer at <a class="border-b" href="https://www.shopify.com" target="_blank">Shopify</a> and currently live in <span class="whitespace-no-wrap">Berlin, DE 🇩🇪</span></p>
<p>Chat with me about JAMstack, React, JavaScript and the Web.</p>
</div>
</div>
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "swaroopsm.com",
"version": "1.0.0",
"main": "index.js",
"repository": "[email protected]:swaroopsm/swaroopsm.com.git",
"author": "Swaroop Sethumadhavan",
"license": "MIT",
"scripts": {
"clean": "rm -rf _site",
"dev:11ty": "eleventy --serve --incremental",
"dev:postcss": "NODE_ENV=development postcss assets/css/site.css --dir _site/assets --watch",
"dev": "run-p clean dev:*"
},
"devDependencies": {
"@11ty/eleventy": "^0.11.0",
"liquidjs": "^9.14.0",
"npm-run-all": "^4.1.5",
"postcss": "^7.0.30",
"postcss-cli": "^7.1.1",
"postcss-import": "^12.0.1",
"tailwindcss": "^1.4.6"
}
}
32 changes: 32 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const tailwindcss = require("tailwindcss");
const autoprefixer = require("autoprefixer");
const postcssImport = require("postcss-import")({
root: "./assets/css/"
});
// const purgecss = require('@fullhuman/postcss-purgecss');
// const cssnano = require('cssnano')({
// preset: 'default',
// });

module.exports = ctx => {
const isProduction = ctx.env === "production";
// const purgeCssOptions = {
// content: [
// `./src/content/${LANG_CODE}/**/*.liquid`,
// './src/_includes/**/*.liquid',
// './src/_layouts/**/*.liquid',
// './src/_includes/shortcodes/**/*.js',
// ],
// defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
// };

return {
plugins: [
postcssImport,
tailwindcss,
autoprefixer
// isProduction ? purgecss(purgeCssOptions) : null,
// isProduction ? cssnano : null,
]
};
};
20 changes: 20 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
theme: {
fontFamily: {
sans: ["PT Sans", "sans-serif"]
},
colors: {
white: "#FFFFFF",
black: "#000000",
"black-10": "#1F2123",
"gray-10": "#BBBBBB",
"gray-20": "#B4B4B4",
transparent: "transparent"
}
},
purge: [
"./content/**/*.liquid",
"./_layouts/**/*.liquid",
"./_includes/partials/**/*.liquid"
]
};
Loading

0 comments on commit 5250a81

Please sign in to comment.