File tree Expand file tree Collapse file tree 4 files changed +277
-8
lines changed
Expand file tree Collapse file tree 4 files changed +277
-8
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,39 @@ bundle exec jekyll serve --host=localhost --livereload
9292```
9393
9494
95+ ## Post summaries (home page excerpts)
96+
97+ The home page now shows a concise summary for each post without leaking large code blocks.
98+
99+ Summary priority (no changes needed to old posts):
100+
101+ 1 . If a post defines ` summary: ` (or ` description: ` ) in front matter, that is used.
102+ 2 . Otherwise the first real paragraph from the post body is extracted and truncated.
103+ 3 . If no paragraph is found, it falls back to Jekyll's excerpt or stripped content.
104+
105+ Recommended usage for new posts:
106+
107+ ``` yaml
108+ ---
109+ layout : post
110+ title : My Post
111+ date : 2025-08-27
112+ summary : A one‑sentence teaser for the home page list.
113+ ---
114+
115+ Intro paragraph here…
116+
117+ <!--more-->
118+
119+ Rest of the content…
120+ ```
121+
122+ Notes:
123+ - ` summary: ` gives you full control over the home-page blurb.
124+ - ` <!--more--> ` is optional; use it when you want the per‑post page to show a short intro before the rest.
125+ - Old posts don’t need to be edited. They’ll automatically use their first paragraph.
126+
127+
95128
96129## SEO Improvements
97130
@@ -170,6 +203,7 @@ It is a brazen two-column theme that pairs a prominent sidebar with uncomplicat
170203 - [ Live reload] ( #live-reload )
171204 - [ Testing imgur hosted images] ( #testing-imgur-hosted-images )
172205 - [ Current full site testing example:] ( #current-full-site-testing-example )
206+ - [ Post summaries (home page excerpts)] ( #post-summaries-home-page-excerpts )
173207 - [ SEO Improvements] ( #seo-improvements )
174208 - [ Canonical URL] ( #canonical-url )
175209 - [ Robots Tag] ( #robots-tag )
Original file line number Diff line number Diff line change 44 < meta http-equiv ="content-type " content ="text/html; charset=utf-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0, maximum-scale=1 ">
66 < link rel ="stylesheet " href ="{{ site.baseurl }}/public/css/poole.css ">
7- <!--
8- replace existing syntax css for a nice dark theme
9- https://jwarby.github.io/jekyll-pygments-themes/languages/java.html
10- https: //raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css
11- <link rel="stylesheet" href="{{ site.baseurl }}/public/css/syntax.css">
12- -->
13- < link rel ="stylesheet " href ="{{ site.baseurl }}/public/css/monokai.css ">
7+ <!-- GitHub-like syntax highlighting using Rouge -->
8+ < link rel ="stylesheet " href ="{{ site.baseurl }}/public/css/github-syntax.css ">
149 < link rel ="stylesheet " href ="{{ site.baseurl }}/public/css/hyde.css ">
1510 < link rel ="stylesheet " href ="{{ site.baseurl }}/public/css/custom.css ">
1611 < link rel ="stylesheet " href ="https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface ">
Original file line number Diff line number Diff line change @@ -14,7 +14,34 @@ <h1 class="post-title">
1414
1515 < span class ="post-date "> {{ post.date | date_to_string }}</ span >
1616
17- < p > {{ post.content | strip_html | truncatewords:75}}</ p >
17+ {%- comment -%}
18+ Summary priority:
19+ 1) front matter: summary/description
20+ 2) first actual paragraph from rendered content (skips headings/code)
21+ 3) fallback to excerpt or stripped content
22+ {%- endcomment -%}
23+
24+ {% if post.summary %}
25+ < p > {{ post.summary }}</ p >
26+ {% elsif post.description %}
27+ < p > {{ post.description }}</ p >
28+ {% else %}
29+ {% assign paragraphs = post.content | split: '</ p > ' %}
30+ {% assign found_para = false %}
31+ {% for p in paragraphs %}
32+ {% if found_para == false and p contains '< p ' %}
33+ {% assign found_para = true %}
34+ < p > {{ p | append: '</ p > ' | strip_html | truncatewords: 75 }}</ p >
35+ {% endif %}
36+ {% endfor %}
37+ {% unless found_para %}
38+ {% if post.excerpt %}
39+ < p > {{ post.excerpt | strip_html | truncatewords: 75 }}</ p >
40+ {% else %}
41+ < p > {{ post.content | strip_html | truncatewords: 75 }}</ p >
42+ {% endif %}
43+ {% endunless %}
44+ {% endif %}
1845 < p > < a href ="{{ site.baseurl }}{{ post.url }} "> Continue Reading</ a > </ p >
1946
2047
Original file line number Diff line number Diff line change 1+ .highlight table td { padding : 5px ; }
2+ .highlight table pre { margin : 0 ; }
3+ .highlight .cm {
4+ color : # 999988 ;
5+ font-style : italic;
6+ }
7+ .highlight .cp {
8+ color : # 999999 ;
9+ font-weight : bold;
10+ }
11+ .highlight .c1 {
12+ color : # 999988 ;
13+ font-style : italic;
14+ }
15+ .highlight .cs {
16+ color : # 999999 ;
17+ font-weight : bold;
18+ font-style : italic;
19+ }
20+ .highlight .c , .highlight .ch , .highlight .cd , .highlight .cpf {
21+ color : # 999988 ;
22+ font-style : italic;
23+ }
24+ .highlight .err {
25+ color : # a61717 ;
26+ background-color : # e3d2d2 ;
27+ }
28+ .highlight .gd {
29+ color : # 000000 ;
30+ background-color : # ffdddd ;
31+ }
32+ .highlight .ge {
33+ color : # 000000 ;
34+ font-style : italic;
35+ }
36+ .highlight .gr {
37+ color : # aa0000 ;
38+ }
39+ .highlight .gh {
40+ color : # 999999 ;
41+ }
42+ .highlight .gi {
43+ color : # 000000 ;
44+ background-color : # ddffdd ;
45+ }
46+ .highlight .go {
47+ color : # 888888 ;
48+ }
49+ .highlight .gp {
50+ color : # 555555 ;
51+ }
52+ .highlight .gs {
53+ font-weight : bold;
54+ }
55+ .highlight .gu {
56+ color : # aaaaaa ;
57+ }
58+ .highlight .gt {
59+ color : # aa0000 ;
60+ }
61+ .highlight .kc {
62+ color : # 000000 ;
63+ font-weight : bold;
64+ }
65+ .highlight .kd {
66+ color : # 000000 ;
67+ font-weight : bold;
68+ }
69+ .highlight .kn {
70+ color : # 000000 ;
71+ font-weight : bold;
72+ }
73+ .highlight .kp {
74+ color : # 000000 ;
75+ font-weight : bold;
76+ }
77+ .highlight .kr {
78+ color : # 000000 ;
79+ font-weight : bold;
80+ }
81+ .highlight .kt {
82+ color : # 445588 ;
83+ font-weight : bold;
84+ }
85+ .highlight .k , .highlight .kv {
86+ color : # 000000 ;
87+ font-weight : bold;
88+ }
89+ .highlight .mf {
90+ color : # 009999 ;
91+ }
92+ .highlight .mh {
93+ color : # 009999 ;
94+ }
95+ .highlight .il {
96+ color : # 009999 ;
97+ }
98+ .highlight .mi {
99+ color : # 009999 ;
100+ }
101+ .highlight .mo {
102+ color : # 009999 ;
103+ }
104+ .highlight .m , .highlight .mb , .highlight .mx {
105+ color : # 009999 ;
106+ }
107+ .highlight .sa {
108+ color : # 000000 ;
109+ font-weight : bold;
110+ }
111+ .highlight .sb {
112+ color : # d14 ;
113+ }
114+ .highlight .sc {
115+ color : # d14 ;
116+ }
117+ .highlight .sd {
118+ color : # d14 ;
119+ }
120+ .highlight .s2 {
121+ color : # d14 ;
122+ }
123+ .highlight .se {
124+ color : # d14 ;
125+ }
126+ .highlight .sh {
127+ color : # d14 ;
128+ }
129+ .highlight .si {
130+ color : # d14 ;
131+ }
132+ .highlight .sx {
133+ color : # d14 ;
134+ }
135+ .highlight .sr {
136+ color : # 009926 ;
137+ }
138+ .highlight .s1 {
139+ color : # d14 ;
140+ }
141+ .highlight .ss {
142+ color : # 990073 ;
143+ }
144+ .highlight .s , .highlight .dl {
145+ color : # d14 ;
146+ }
147+ .highlight .na {
148+ color : # 008080 ;
149+ }
150+ .highlight .bp {
151+ color : # 999999 ;
152+ }
153+ .highlight .nb {
154+ color : # 0086B3 ;
155+ }
156+ .highlight .nc {
157+ color : # 445588 ;
158+ font-weight : bold;
159+ }
160+ .highlight .no {
161+ color : # 008080 ;
162+ }
163+ .highlight .nd {
164+ color : # 3c5d5d ;
165+ font-weight : bold;
166+ }
167+ .highlight .ni {
168+ color : # 800080 ;
169+ }
170+ .highlight .ne {
171+ color : # 990000 ;
172+ font-weight : bold;
173+ }
174+ .highlight .nf , .highlight .fm {
175+ color : # 990000 ;
176+ font-weight : bold;
177+ }
178+ .highlight .nl {
179+ color : # 990000 ;
180+ font-weight : bold;
181+ }
182+ .highlight .nn {
183+ color : # 555555 ;
184+ }
185+ .highlight .nt {
186+ color : # 000080 ;
187+ }
188+ .highlight .vc {
189+ color : # 008080 ;
190+ }
191+ .highlight .vg {
192+ color : # 008080 ;
193+ }
194+ .highlight .vi {
195+ color : # 008080 ;
196+ }
197+ .highlight .nv , .highlight .vm {
198+ color : # 008080 ;
199+ }
200+ .highlight .ow {
201+ color : # 000000 ;
202+ font-weight : bold;
203+ }
204+ .highlight .o {
205+ color : # 000000 ;
206+ font-weight : bold;
207+ }
208+ .highlight .w {
209+ color : # bbbbbb ;
210+ }
211+ .highlight {
212+ background-color : # f8f8f8 ;
213+ }
You can’t perform that action at this time.
0 commit comments