Skip to content

Commit 0979267

Browse files
committed
feat(landing): custom homepage with hero + CTA, hide Book side panels only on home; keep Book for inner pages; styles appended
1 parent eafd674 commit 0979267

3 files changed

Lines changed: 116 additions & 0 deletions

File tree

assets/custom.css

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/* Footer socials */
2+
.book-footer .footer-socials {
3+
margin-top: 0.75rem;
4+
padding-top: 0.75rem;
5+
border-top: 1px solid rgba(127, 127, 127, 0.25);
6+
display: flex;
7+
flex-wrap: wrap;
8+
gap: 0.75rem 1rem;
9+
font-size: 0.9rem;
10+
}
11+
.book-footer .footer-socials a { opacity: 0.85; }
12+
.book-footer .footer-socials a:hover { opacity: 1; text-decoration: underline; }
13+
14+
/* Custom Blog block in menu */
15+
.book-menu .custom-blog-menu {
16+
margin: 0.25rem 0 0.75rem 0;
17+
}
18+
.book-menu .custom-blog-menu .header a {
19+
font-weight: 400; /* not bold by default */
20+
font-size: 0.98rem; /* slightly larger */
21+
}
22+
.book-menu .custom-blog-menu ul { margin: 0.25rem 0 0 0; }
23+
.book-menu .custom-blog-menu li { list-style: none; }
24+
.book-menu .custom-blog-menu li a.active { font-weight: 600; }
25+
.book-menu .custom-blog-menu li.more a { opacity: 0.85; }
26+
.book-menu .custom-blog-menu li.more a:hover { opacity: 1; text-decoration: underline; }
27+
28+
/* Removed previous pinned profile/socials block */
29+
30+
/* Make default menu items not bold unless active */
31+
.book-menu nav a { font-weight: 400; }
32+
.book-menu nav a.active { font-weight: 600; }
33+
34+
/* Tighten sidebar spacing and reduce width slightly */
35+
.book-menu { flex: 0 0 14rem; }
36+
.book-menu .book-menu-content { width: 14rem; }
37+
/* Moderate spacing like theme demo */
38+
.book-menu nav ul li { margin: 0.28rem 0; }
39+
.book-menu nav a { padding: 0.18rem 0; line-height: 1.32; }
40+
41+
/* Hide hamburger icons on desktop, show on small screens */
42+
.book-header label[for="menu-control"],
43+
.book-header label[for="toc-control"] { display: none; }
44+
@media (max-width: 1000px) {
45+
.book-header label[for="menu-control"],
46+
.book-header label[for="toc-control"] { display: inline-block; }
47+
}
48+
49+
/* Back to top link styling */
50+
.markdown .back-to-top {
51+
font-size: 0.85rem;
52+
margin-inline-start: 0.5rem;
53+
opacity: 0.7;
54+
}
55+
.markdown .back-to-top:hover { opacity: 1; text-decoration: underline; }
56+
57+
/* Visual hierarchy for Blog sub-items */
58+
.book-menu .custom-blog-menu .header {
59+
margin: 0.25rem 0 0.25rem 0;
60+
padding-bottom: 0.25rem;
61+
border-bottom: 1px solid rgba(127,127,127,0.25);
62+
}
63+
.book-menu .custom-blog-menu ul {
64+
margin: 0.35rem 0 0 0.35rem;
65+
padding-left: 0.65rem;
66+
border-left: 1px solid rgba(127,127,127,0.25);
67+
}
68+
.book-menu .custom-blog-menu li a { font-size: 0.96rem; }
69+
70+
/* More spacing above footer so content doesn't blend */
71+
.book-footer { margin-top: 2.25rem; }
72+
/* Landing page styles */
73+
.landing { padding: 2rem 1rem; }
74+
.landing-hero { text-align: center; margin: 2rem 0; }
75+
.landing-hero h1 { font-size: 2.2rem; margin-bottom: .5rem; }
76+
.landing-hero p { font-size: 1.05rem; opacity: .9; }
77+
78+
.landing-cta { margin-top: 1rem; display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
79+
.landing-cta .btn {
80+
padding: .5rem .9rem; border: 1px solid rgba(127,127,127,.25); border-radius: .6rem;
81+
text-decoration: none;
82+
}
83+
.landing-cta .btn:hover { border-color: rgba(127,127,127,.5); }
84+
85+
.landing-body { margin: 2rem auto; max-width: 900px; }

layouts/_default/home.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{ define "main" }}
2+
<main class="landing">
3+
<section class="landing-hero">
4+
<h1>Hi, I’m Saber</h1>
5+
<p>AI × Bio research, notes, and projects — start here.</p>
6+
<div class="landing-cta">
7+
<a class="btn" href="/blog/">Blog</a>
8+
<a class="btn" href="/podcast/">Podcast</a>
9+
<a class="btn" href="/newsletter/">Newsletter</a>
10+
<a class="btn" href="/about/">About me</a>
11+
</div>
12+
</section>
13+
14+
<section class="landing-body">
15+
{{ .Content }}
16+
</section>
17+
</main>
18+
{{ end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{/* Include site-specific CSS overrides with cache-busting + SRI */}}
2+
{{ $css := resources.Get "custom.css" | resources.Minify | resources.Fingerprint "sha384" }}
3+
{{ with $css }}
4+
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
5+
{{ end }}
6+
{{ if .IsHome }}
7+
<style>
8+
/* Hide Book side panels on the landing page only */
9+
.book-menu, .book-toc { display: none !important; }
10+
.book-page { margin: 0 auto; max-width: 980px; }
11+
.book-header { justify-content: center; }
12+
</style>
13+
{{ end }}

0 commit comments

Comments
 (0)