• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

scriptype / writ-cms / 18128625706

30 Sep 2025 11:38AM UTC coverage: 73.078% (-2.4%) from 75.488%
18128625706

push

github

scriptype
Facets wip5

Handle permalinking from entries to collection facets through its faceted fields. Every facet field becomes an object: { value, facetPermalink }. If the field is a link to another entry (already object), then the facetPermalink property is added on top of existing entry object.

490 of 795 branches covered (61.64%)

Branch coverage included in aggregate %.

8 of 25 new or added lines in 4 files covered. (32.0%)

118 existing lines in 9 files now uncovered.

2276 of 2990 relevant lines covered (76.12%)

313.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/compiler/contentModel2/models/attachment.js
1
const { join } = require('path')
9✔
2
const _ = require('lodash')
9✔
3
const { makePermalink } = require('../helpers')
9✔
4

5
module.exports = function Attachment() {
9✔
6
  return {
117✔
7
    match: node => true,
36✔
8

9
    create(node, context) {
10
      const permalink = makePermalink(
36✔
11
        ..._.compact([
12
          context.peek()?.permalink,
13
          node.name
14
        ])
15
      )
16

17
      const outputPath = join(
36✔
18
        ..._.compact([
19
          context.peek()?.outputPath,
20
          node.name
21
        ])
22
      )
23

24
      return {
36✔
25
        ...node,
26
        context,
27
        permalink,
28
        outputPath,
29
        date: new Date(node.stats.birthtime || Date.now())
36!
30
      }
31
    },
32

33
    afterEffects: (contentModel, attachment) => {},
34

35
    render: (renderer, attachment) => {
UNCOV
36
      return renderer.copy({
×
37
        src: attachment.absolutePath,
38
        dest: attachment.outputPath,
39
        recursive: !!attachment.children
40
      })
41
    }
42
  }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc