From 6a20b0c18e5093219ae9393f3864354c46bb05cf Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 22 Sep 2024 12:58:12 -0700 Subject: add a menu and improve readability Add a menu with links to some sections. Tweak the CSS to make the website a bit more readable. --- content/_index.md | 6 -- static/css/custom.css | 209 ++++++++++++++++++++++++++++++++++++++++++++----- templates/base.html | 18 ++++- templates/blog.html | 17 ++-- templates/index.html | 59 +++++++------- templates/orphan.html | 5 +- templates/page.html | 27 +++---- templates/section.html | 10 +-- 8 files changed, 260 insertions(+), 91 deletions(-) diff --git a/content/_index.md b/content/_index.md index f17087d..f11ae83 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,9 +1,3 @@ --- title: "home" --- - -My name is Franck Cuny and this is my little corner on the web. - -I currently work as a [Site Reliability Engineer](https://en.wikipedia.org/wiki/Site_reliability_engineering) (SRE) at [Roblox](https://www.roblox.com). Previously, I worked as a SRE at [Twitter](https://twitter.com/TwitterEng), and my focus was on infrastructure. - -I'm interested in building sustainable teams, improving the management and operation of large infrastructure, and to work with different teams to implement best practices around reliability and security. diff --git a/static/css/custom.css b/static/css/custom.css index ece5457..5c3901b 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,24 +1,142 @@ body { - margin: 1em auto; - max-width: 46rem; - line-height: 1.6; + margin: 0; font-family: sans-serif; font-size: 1rem; + line-height: 1.6; } -h1 { - font-size: 1.2rem; +.container { + display: flex; + max-width: 60rem; + margin: 0 auto; + padding: 1em; } -h2 { - font-size: 1.1rem; - border-left: 5px solid #ffc832; - padding-left: 0.2em; +.menu { + flex: 0 0 auto; + margin-right: 2em; } -h3 { - font-size: 1rem; - font-weight: normal; +.content { + flex: 1; + max-width: 46rem; +} + +.menu ul { + list-style-type: none; + padding: 0; + margin: 0; +} + +.menu li:first-child { + margin-top: 0; +} + +.menu li { + margin-bottom: 0.3em; +} + +.menu a { + text-decoration: none; + color: #333; + padding: 0.2em 0.5em; + display: inline-block; + white-space: nowrap; +} + +.menu a:hover { + text-decoration: underline; + background-color: #f0f0f0; +} + +.section { + margin-top: 0; +} + +h1, h2, h3, h4, h5, h6 { + margin-top: 0; + margin-bottom: 0.5em; + line-height: 1.25; + font-weight: 600; +} + +p { + margin-top: 0; + margin-bottom: 1em; +} + +.post-list { + list-style-type: none; + padding: 0; + margin: 0; +} + +.post-list li { + display: flex; + justify-content: space-between; + align-items: baseline; + margin-bottom: 0.5em; +} + +.post-list a { + text-decoration: none; + color: #333; + max-width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.post-list a:hover { + text-decoration: underline; +} + +.post-date { + font-size: 0.9em; + color: #666; +} + +@media (max-width: 768px) { + .container { + flex-direction: column; + } + + .menu { + width: 100%; + margin-right: 0; + margin-bottom: 1em; + } + + .menu ul { + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + } + + .menu li { + margin-right: 1em; + margin-bottom: 0.5em; + } + + .post-list li { + flex-direction: column; + align-items: flex-start; + } + + .post-list a { + max-width: 100%; + margin-bottom: 0.2em; + } +} + +h1 { + font-size: 1.4rem; +} +h2 { + font-size: 1.3rem; +} +h3{ + font-size: 1.2rem } a { @@ -33,25 +151,29 @@ a:active { } code { - font-family: monospace; - font-size: 0.8rem; + font-family: monospace; + font-size: 90%; overflow-x: auto; - padding: 0.2rem 0.5rem; - margin: 0 0.2rem; + border-radius: 4px; } pre { + padding: 0.2rem 0.5rem; overflow: auto; - font-size: 0.8rem; overflow-x: auto; - margin: 0 0.2rem; + font-size: 90%; } pre > code { display: block; } + +p > code { + background: #eee; +}; + section.times time { font-style: oblique; float: right; @@ -109,3 +231,54 @@ ul { li { display: list-item; } + + +/* Table of Contents styles */ +.toc-container { + margin-bottom: 2em; +} + +.toc-toggle { + background-color: #f0f0f0; + border: 1px solid #ccc; + color: #333; + padding: 0.5em 1em; + cursor: pointer; + font-size: 0.9em; + transition: background-color 0.3s; +} + +.toc-toggle:hover { + background-color: #e0e0e0; +} + +.toc { + border: 1px solid #ccc; + background-color: #f9f9f9; + padding: 1em; + margin-top: 0.5em; +} + +.toc ul { + list-style-type: none; + padding-left: 0; + margin: 0; +} + +.toc ul ul { + padding-left: 1.5em; +} + +.toc li { + margin-bottom: 0.5em; +} + +.toc a { + text-decoration: none; + color: #333; + transition: color 0.3s; +} + +.toc a:hover { + color: #ffc832; +} diff --git a/templates/base.html b/templates/base.html index 75d108c..b903da3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,16 +5,32 @@ + + {% block title %}{{- config.title -}}{% endblock title %} - {% block content %}{% endblock content %} +
+ + +
+ {% block content %}{% endblock content %} +
+
diff --git a/templates/blog.html b/templates/blog.html index 0e3c2bf..cfdd8c2 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -1,20 +1,19 @@ {% extends "section.html" %} {%- block content -%} -

{{ section.title }}

-{%- for year, posts in section.pages | group_by(attribute="year") -%} -
-

{{ year }}

-