Skip to content

Commit 3875fd3

Browse files
Copilotdmalan
andcommitted
Remove test_site from gitignore and exclude title/TOC from description
Co-authored-by: dmalan <[email protected]>
1 parent 5dbbf2b commit 3875fd3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,3 @@ assets/vanilla-lazyload/dist/*
127127
!assets/vanilla-lazyload/dist/lazyload.min.js
128128

129129
node_modules/
130-
131-
test_site/

lib/jekyll-theme-cs50.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ def describe(input, max_length = 160)
109109

110110
# Parse HTML and extract text
111111
doc = Nokogiri::HTML5.fragment(html)
112+
113+
# Remove the page's title (first h1 tag)
114+
doc.css("h1").first&.remove
115+
116+
# Remove table of contents (first ul with id of markdown-toc)
117+
doc.css("ul#markdown-toc").first&.remove
118+
112119
text = doc.text.strip
113120

114121
# Clean up whitespace

0 commit comments

Comments
 (0)