poops 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -11
- package/lib/markups.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 💩 Poops [](https://www.npmjs.com/package/poops)
|
|
1
|
+
# 💩 Poops [](https://www.npmjs.com/package/poops) [](https://github.com/stamat/poops/actions/workflows/ci.yml) [](https://github.com/stamat/poops/blob/main/LICENSE)
|
|
2
2
|
|
|
3
3
|
Straightforward, no-bullshit bundler for the web.
|
|
4
4
|
|
|
@@ -784,9 +784,9 @@ title: Changelog
|
|
|
784
784
|
collection: true
|
|
785
785
|
paginate: 10
|
|
786
786
|
taxonomies:
|
|
787
|
-
- name: tags
|
|
788
|
-
path: tag
|
|
789
|
-
paginate: 5
|
|
787
|
+
- name: tags # front-matter field to group on
|
|
788
|
+
path: tag # URL segment (defaults to name); "tag" for a singular URL
|
|
789
|
+
paginate: 5 # per-term page size (defaults to the collection's paginate)
|
|
790
790
|
---
|
|
791
791
|
```
|
|
792
792
|
|
|
@@ -871,9 +871,15 @@ Output:
|
|
|
871
871
|
```
|
|
872
872
|
|
|
873
873
|
```html
|
|
874
|
-
<img
|
|
875
|
-
|
|
876
|
-
|
|
874
|
+
<img
|
|
875
|
+
src="static/photo-thumb-480w.webp"
|
|
876
|
+
srcset="static/photo-thumb-480w.webp 480w, static/photo-thumb.webp 960w"
|
|
877
|
+
width="480"
|
|
878
|
+
height="480"
|
|
879
|
+
sizes="240px"
|
|
880
|
+
alt=""
|
|
881
|
+
loading="lazy"
|
|
882
|
+
/>
|
|
877
883
|
```
|
|
878
884
|
|
|
879
885
|
This requires the [poops-images](https://github.com/stamat/poops-images) compile cache (named-size widths are read from it). The `size` name matches a named entry in your `images.sizes` config. The largest member of the group is written without a width suffix (`photo-thumb.webp`) — poops still srcsets it at its real width from the cache.
|
|
@@ -1041,7 +1047,7 @@ All filters are available in both engines. The only syntax difference is how arg
|
|
|
1041
1047
|
|
|
1042
1048
|
poops auto-picks `BlogPosting` (page has a `date`) or `WebPage`. Override `@type` with the `jsonld` object for any schema.org type — common ones search/generative engines act on: `Article`, `NewsArticle`, `HowTo`, `FAQPage`, `QAPage`, `Product`, `Recipe`, `Event`, `Course`, `VideoObject`, `SoftwareApplication`, `Organization`, `Person`, `BreadcrumbList`, `WebSite`. Full list at [schema.org/docs/full](https://schema.org/docs/full.html); validate with the [Rich Results Test](https://search.google.com/test/rich-results). A per-`@type` table with the notable fields is in the [Templating docs](example/src/markup/docs/quick-start/templating-html.md).
|
|
1043
1049
|
|
|
1044
|
-
- `breadcrumb` — generates a visible breadcrumb `<nav class="breadcrumb"><ol>…</ol></nav>` trail for the page body (blog posts, nested pages), from the same URL-depth data the `jsonld` `BreadcrumbList` uses: the site root, each ancestor folder (humanized, e.g. `docs/static-site` →
|
|
1050
|
+
- `breadcrumb` — generates a visible breadcrumb `<nav class="breadcrumb"><ol>…</ol></nav>` trail for the page body (blog posts, nested pages), from the same URL-depth data the `jsonld` `BreadcrumbList` uses: the site root, each ancestor folder (humanized, e.g. `docs/static-site` → _Static Site_), then the current page as `aria-current` text. Pass `relativePathPrefix` so links resolve against the current output location (localhost in dev, your deployed subpath in prod) — not the absolute domain.
|
|
1045
1051
|
- Nunjucks: `{{ page | breadcrumb(site, relativePathPrefix) }}`
|
|
1046
1052
|
- Liquid: `{{ page | breadcrumb: site, relativePathPrefix }}`
|
|
1047
1053
|
|
|
@@ -1076,7 +1082,7 @@ All filters are available in both engines. The only syntax difference is how arg
|
|
|
1076
1082
|
|
|
1077
1083
|
Returns: `static/photo-320w.webp 320w, static/photo-640w.webp 640w, static/photo-960w.webp 960w`
|
|
1078
1084
|
|
|
1079
|
-
|
|
1085
|
+
Pass a named crop/resize group as the second argument to get that group's srcset instead of the default widths: `{{ 'static/photo.jpg' | srcset: 'thumb' }}` → `static/photo-thumb-480w.webp 480w, static/photo-thumb.webp 960w`.
|
|
1080
1086
|
|
|
1081
1087
|
- `exif` — returns the EXIF metadata object for an image from the [poops-images](https://github.com/stamat/poops-images) compile cache (`.poops-images-cache.json` in the output directory), or `null` if there is no cache or no EXIF data. The object includes camera (`make`, `model`, `lensModel`), exposure (`fNumber`, `exposure.formatted`, `iso`, `focalLength35mm`), `dateTime`, and `gps` (`latitude.formatted`, `longitude.formatted`, `altitude`, and a ready-made `googleMapsUrl`).
|
|
1082
1088
|
|
|
@@ -1241,7 +1247,8 @@ Pages with `published: false` in their front matter are excluded from all output
|
|
|
1241
1247
|
A page's front matter `robots: noindex` (or `none`) drops it from the **sitemap and llms.txt** — for drafts, thin or utility pages (a 404, say) you don't want crawled or fed to LLMs. It stays in the search index (that's your own on-site search). Emit the matching crawler directive in your layout `<head>` so the page itself carries it:
|
|
1242
1248
|
|
|
1243
1249
|
```html
|
|
1244
|
-
{% if page.robots %}<meta name="robots" content="{{ page.robots }}"
|
|
1250
|
+
{% if page.robots %}<meta name="robots" content="{{ page.robots }}" />{% endif
|
|
1251
|
+
%}
|
|
1245
1252
|
```
|
|
1246
1253
|
|
|
1247
1254
|
**Navigation tree** builds your page hierarchy as sidebar-ready data, exposed two ways: as the `nav` template global (loaded automatically, always reflecting the current build) and as a nested JSON file for client-side rendering. Subpages nest automatically from URL structure: `guide/index.md` becomes a parent node and `guide/getting-started.md`, `guide/advanced/config.md` become its (and its subsections') children. Add `nav` to your markup config:
|
|
@@ -1385,7 +1392,11 @@ Shorthand forms: `"feed": true` (or a filename string) emits an RSS feed for eve
|
|
|
1385
1392
|
Point browsers and readers at it from your layout `<head>`:
|
|
1386
1393
|
|
|
1387
1394
|
```html
|
|
1388
|
-
<link
|
|
1395
|
+
<link
|
|
1396
|
+
rel="alternate"
|
|
1397
|
+
type="application/rss+xml"
|
|
1398
|
+
href="{{ site.url }}/blog/feed.rss"
|
|
1399
|
+
/>
|
|
1389
1400
|
```
|
|
1390
1401
|
|
|
1391
1402
|
### Images (optional)
|
package/lib/markups.js
CHANGED
|
@@ -347,7 +347,10 @@ export default class Markups {
|
|
|
347
347
|
relativePathPrefix: getRelativePathPrefix(markupOutDir, fromPath, this.baseURL),
|
|
348
348
|
// output-relative so page.url matches nav.json urls (getPageUrlRelativeToOutput),
|
|
349
349
|
// otherwise `item.url == page.url` sidebar/active checks never fire
|
|
350
|
-
_url: getPageUrlRelativeToOutput(markupOut, this.markupOut)
|
|
350
|
+
_url: getPageUrlRelativeToOutput(markupOut, this.markupOut),
|
|
351
|
+
// source path relative to markup input (posix), so templates can build
|
|
352
|
+
// "edit on GitHub" links — .html output can't be reversed to .md reliably
|
|
353
|
+
_page: { inputPath: toPosix(relativePath) }
|
|
351
354
|
}
|
|
352
355
|
|
|
353
356
|
const shouldIndex = pageEntries && this.engine.indexableExtensions.has(path.extname(file))
|