diff --git a/public/css/home.css b/public/css/home.css index aaf2dc2..f613908 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -126,6 +126,7 @@ main > :last-child { object-fit: cover; object-position: center; width: 100%; + border: 4px solid white; } .featured > h1, .about > h1 { @@ -151,6 +152,14 @@ main > :last-child { font-weight: 300; margin-top: 1rem; } +.featured .featured-text { + display: flex; + flex-direction: column; +} +.featured-text span { + color: rgba(var(--black), .56); + font-size: .85rem; +} .about > div { margin-top: 2rem; @@ -226,4 +235,7 @@ main > :last-child { text-align: end; padding-left: 2rem; } + .featured > div > div { + width: 50%; + } } \ No newline at end of file diff --git a/src/_config/filters.js b/src/_config/filters.js index 8e3662b..1f53abf 100644 --- a/src/_config/filters.js +++ b/src/_config/filters.js @@ -7,4 +7,9 @@ export default function(eleventyConfig) { return array[0]; }); + + eleventyConfig.addFilter("firstWords", function (content, numWords = 100) { + if (!content) return ""; + return content.split(/\s+/).slice(0, numWords).join(" "); + }); }; \ No newline at end of file diff --git a/src/index.html b/src/index.html index d545f66..9edfed8 100644 --- a/src/index.html +++ b/src/index.html @@ -35,15 +35,17 @@ css: home.css
Lorem ipsum dolor sit amet consectetur adipisicing elit. Alias nisi dolorem velit facere ea? Fugit dolor libero dolorem laborum sapiente labore quidem eos, ratione deleniti. Hic sunt ea aspernatur iusto!
- Read more... +{{ latestPost.templateContent | strip_html | firstWords: 25 }}
+ Read more...