stakx-io / stakx

An opinionated, powerful, and simple static website generator built in PHP
https://stakx.io/
MIT License
14 stars 3 forks source link

Collection items with assets #116

Closed allejo closed 4 years ago

allejo commented 4 years ago

Summary

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Fixed issues N/A

Description

Add the ability for ContentItems in Collections to have attached assets. There will be two different types of assets:

In a ContentItem, when an image is linked from either markdown or RST, it will automatically be added to our AssetManager; this is known as a "linked asset." At the moment, only images are supported to be linked assets.

Let's say we're writing a blog post about our trip to Italy. In our blog post, we'll be embedding thumbnails or shrunken-down versions of our original images. Our magic "linked assets" will catch the small versions but what if we want to attach the full resolution of the image to a ContentItem? This is where an explicit asset comes in. An explicit asset is one that is defined in the FrontMatter of a ContentItem via the now reserved assets keyword. How does this look?

---
title: My Trip to Italy
assets:
  - leaning-tower-full.jpg
  - colosseum-full.jpg
---

Check List