From b21d04854ee82629c9637bcd5d0301ad4afd5ac0 Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Wed, 1 Jan 2025 16:26:05 -0500 Subject: [PATCH] Reorganization and Data Files - Use more template / partial features of 11ty by splitting up sections of code into separate files - Change output directory to "dist" - Use njk as the template engine - Add data file for navigation links and site metadata --- .eleventy.js | 5 +- .gitignore | 2 +- justfile | 3 +- src/_data/navigation.json | 24 +++ src/_data/site.json | 7 + src/_includes/base.html | 253 ------------------------- src/_includes/layouts/base.html | 15 ++ src/_includes/layouts/home.html | 11 ++ src/_includes/partials/footer.html | 15 ++ src/_includes/partials/navigation.html | 55 ++++++ src/_includes/partials/site-head.html | 47 +++++ src/about.html | 169 ----------------- src/about.md | 67 +++++++ src/index.md | 2 +- 14 files changed, 248 insertions(+), 427 deletions(-) create mode 100644 src/_data/navigation.json create mode 100644 src/_data/site.json delete mode 100644 src/_includes/base.html create mode 100644 src/_includes/layouts/base.html create mode 100644 src/_includes/layouts/home.html create mode 100644 src/_includes/partials/footer.html create mode 100644 src/_includes/partials/navigation.html create mode 100644 src/_includes/partials/site-head.html delete mode 100644 src/about.html create mode 100644 src/about.md diff --git a/.eleventy.js b/.eleventy.js index f97e6c7..dd83e78 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -4,9 +4,12 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPassthroughCopy("./src/scripts"); return { + markdownTemplateEngine: "njk", + dataTemplateEngine: "njk", + htmlTemplateEngine: "njk", dir: { input: "src", - output: "public", + output: "dist", }, }; }; diff --git a/.gitignore b/.gitignore index a48cf0d..1521c8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -public +dist diff --git a/justfile b/justfile index eb0060e..03377ad 100644 --- a/justfile +++ b/justfile @@ -19,7 +19,6 @@ dev: -it \ -p {{HOST_PORT}}:8080 \ -v ./src:/opt/app/src \ - -v ./public:/opt/app/public \ -v ./.eleventy.js:/opt/app/.eleventy.js \ 11ty:latest \ npx @11ty/eleventy --serve @@ -29,7 +28,7 @@ build-site: docker run \ -it \ -v ./src:/opt/app/src \ - -v ./public:/opt/app/public \ + -v ./dist:/opt/app/dist \ -v ./.eleventy.js:/opt/app/.eleventy.js \ 11ty:latest \ npx @11ty/eleventy diff --git a/src/_data/navigation.json b/src/_data/navigation.json new file mode 100644 index 0000000..9111166 --- /dev/null +++ b/src/_data/navigation.json @@ -0,0 +1,24 @@ +{ + "items": [ + { + "text": "About", + "url": "/about/" + }, + { + "text": "Portfolio", + "url": "/portfolio/" + }, + { + "text": "Personal", + "url": "/personal/" + }, + { + "text": "Blog", + "url": "/blog/" + }, + { + "text": "Documentation", + "url": "/documentation/" + } + ] +} diff --git a/src/_data/site.json b/src/_data/site.json new file mode 100644 index 0000000..3eed7f5 --- /dev/null +++ b/src/_data/site.json @@ -0,0 +1,7 @@ +{ + "author": "Sravan Balaji", + "url": "https://sravanbalaji.com", + "copyrightYear": 2019, + "licenseFile": "https://github.com/balajsra/sravanbalaji.com/blob/master/LICENSE", + "licenseName": "MIT License" +} diff --git a/src/_includes/base.html b/src/_includes/base.html deleted file mode 100644 index d855e4c..0000000 --- a/src/_includes/base.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ title }} - - - - - -
-
-
- {{ content }} -
-
-
- - - - diff --git a/src/_includes/layouts/base.html b/src/_includes/layouts/base.html new file mode 100644 index 0000000..455e51f --- /dev/null +++ b/src/_includes/layouts/base.html @@ -0,0 +1,15 @@ + + + + {% include "partials/site-head.html" %} + {% include "partials/navigation.html" %} + + + +
{% block content %}{% endblock %}
+ + + + diff --git a/src/_includes/layouts/home.html b/src/_includes/layouts/home.html new file mode 100644 index 0000000..daeebaa --- /dev/null +++ b/src/_includes/layouts/home.html @@ -0,0 +1,11 @@ + +{% extends "layouts/base.html" %} +{% block content %} +
+
+
+ {{ content | safe }} +
+
+
+{% endblock %} diff --git a/src/_includes/partials/footer.html b/src/_includes/partials/footer.html new file mode 100644 index 0000000..da2c87c --- /dev/null +++ b/src/_includes/partials/footer.html @@ -0,0 +1,15 @@ + +
+
+
+ + Copyright © {{ site.copyrightYear }} {{ site.author }} under + {{ site.licenseName }} + +
+
+
diff --git a/src/_includes/partials/navigation.html b/src/_includes/partials/navigation.html new file mode 100644 index 0000000..e2a5865 --- /dev/null +++ b/src/_includes/partials/navigation.html @@ -0,0 +1,55 @@ + + diff --git a/src/_includes/partials/site-head.html b/src/_includes/partials/site-head.html new file mode 100644 index 0000000..b6c7098 --- /dev/null +++ b/src/_includes/partials/site-head.html @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + +{{ title }} diff --git a/src/about.html b/src/about.html deleted file mode 100644 index 54421dd..0000000 --- a/src/about.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - About - - - - - -
- -
-
-
-

Bio

-
-
-
-
- -
-
-

- Sravan Balaji completed his undergraduate and graduate degrees at - the - University of Michigan, Ann Arbor. He earned dual B.S.E.'s in - Mechanical Engineering - and - Computer Science - in December 2020 and an M.S. in - Robotics - in December 2021. -

- -

- Sravan worked as a Graduate Navigation Intern at - MITRE - during summer 2021. You can learn more about this and his other - work experiences in the - professional experience - section of the - portfolio page. He is currently - working at - MITRE - as an Associate Autonomous Systems Engineer in McLean, VA. -

- -

- Sravan's professional and academic interests are in controls, - motion planning, robotic perception & manipulation, autonomous & - connected vehicles, software development, and GNU/Linux among - other things. His personal interests include video games, - podcasts, music, cooking, football, soccer, formula 1, and - productivity software. -

-
-
-
- -
-
-
-

- Feel free to reach out to me via email if you have any questions - about my website, college education, professional experience, or - anything else. If you have suggestions for the website or would - like to see the source files, check out my - - GitHub repository. If you would like to connect with me on LinkedIn, use the link - below. I will do my best to respond to any communication in a - timely manner. Finally, check out my YouTube channel if you are - interested in some of the projects I have worked on. -

-
-
-
- - -
-
-
- - Email - -


Email: balajsra@umich.edu

-
-
- - LinkedIn - -


LinkedIn: sravan-balaji

-
-
- - GitHub - -


GitHub: balajsra

-
-
- - YouTube - -


YouTube: Sravan Balaji

-
-
-
-
- - - - diff --git a/src/about.md b/src/about.md new file mode 100644 index 0000000..b6e8d01 --- /dev/null +++ b/src/about.md @@ -0,0 +1,67 @@ +--- +title: About +layout: "layouts/home.html" +--- + +# Bio + +![Profile Picture](/assets/about/profile_picture.jpg) + +Sravan Balaji completed his undergraduate and graduate degrees at the [University of Michigan, Ann Arbor](https://umich.edu). He earned dual B.S.E.'s in [Mechanical Engineering](https://me.engin.umich.edu) and [Computer Science](https://cse.engin.umich.edu) in December 2020 and an M.S. in [Robotics](https://robotics.umich.edu) in December 2021. + +Sravan worked as a Graduate Navigation Intern at [MITRE](https://www.mitre.org) during summer 2021. You can learn more about this and his other work experiences in the [professional experience](/portfolio#professional_experience) section of the [portfolio](/portfolio) page. He later returned to [MITRE](https://www.mitre.org) full-time to work as an Autonomous Systems Engineer in McLean, VA. He currently works at [Metron](https://metsci.com) as a Software Engineer in Reston, VA. + +Sravan's professional and academic interests are in controls, motion planning, robotic perception & manipulation, autonomous & connected vehicles, software development, and GNU/Linux among other things. His personal interests include video games, podcasts, music, cooking, football, soccer, formula 1, and productivity software. + +# Contact Me + +Feel free to reach out to me via email if you have any questions about my website, college education, professional experience, or anything else. If you have suggestions for the website or would like to see the source files, check out my [GitHub repository](https://github.com/balajsra/sravanbalaji.com). If you would like to connect with me on LinkedIn, use the link below. I will do my best to respond to any communication in a timely manner. Finally, check out my YouTube channel if you are interested in some of the projects I have worked on. + +
+
+ + Email + +


Email: balajsra@umich.edu

+
+
+ + LinkedIn + +


LinkedIn: sravan-balaji

+
+
+ + GitHub + +


GitHub: balajsra

+
+
+ + YouTube + +


YouTube: Sravan Balaji

+
+
diff --git a/src/index.md b/src/index.md index 43f7569..1914d54 100644 --- a/src/index.md +++ b/src/index.md @@ -1,6 +1,6 @@ --- title: Sravan Balaji -layout: "base.html" +layout: "layouts/home.html" --- # Welcome!