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

scriptype / writ-cms / 14347888629
39%

Build:
DEFAULT BRANCH: master
Ran 09 Apr 2025 02:51AM UTC
Jobs 9
Files 114
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Apr 2025 02:11AM UTC coverage: 76.234% (-0.3%) from 76.516%
14347888629

push

github

scriptype
[CM2] model.match(),create() rootContext and fixes

Some ideas in this one:

Match & Create
==============

Each model has a method named 'match' which returns whether or not a
node satisfies the model's fsNode requirements. And they have a 'create'
method to turn a node into a content-model.

So, e.g., a collection calls category.match(node) in a node traversal,
and then calls category.create(node) if the former returns true.

Each model configures its matchers mostly based on the settings it
receives.

Benefits:
- Prevents the duplicaiton of functions like 'isPost', 'isPostIndexFile'
  etc.
- Models look similar in shape to each other and to root (countdown to
  class Model {})
- Post index files can now be named with the entryAlias. e.g. demo.md,
  episode.md, article.md
- Same goes for categories. Whatever alias works.

Root context
============

ContentModel2 has now a context object which is passed down throughout
the tree, just like a collection context.

Benefits:
- No more reliance on settings.out and settings.permalinkPrefix in
  models. So, permalinks and outputPaths are computed completely by a
  cascade of contexts.
- This inspires a further improvement of automating that computation by
  introducing a context depth-level. Each model would rely on the
  context that is closest to itself, without necessarily recognizing
  where it comes from. But to not complicate the templates, some magic
  should follow it either in rendering phase or in the form of template
  helpers. {{context.category.permalink}} is too tasty to give up on.
- It also means simpler/less settings for initializing models.

Some fixes
==========

- Category index
- Tags

438 of 706 branches covered (62.04%)

Branch coverage included in aggregate %.

145 of 173 new or added lines in 10 files covered. (83.82%)

14 existing lines in 4 files now uncovered.

2250 of 2820 relevant lines covered (79.79%)

331.63 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
87.5
-1.39% src/compiler/contentModel2/models/homepage.js
4
79.49
-1.28% src/compiler/contentModel2/models/collection/category.js
5
37.5
4.17% src/compiler/contentModel2/models/asset.js
6
42.68
-16.36% src/compiler/contentModel2/index.js
6
80.73
-4.22% src/compiler/contentModel2/models/collection/index.js
6
70.97
40.2% src/compiler/contentModel2/models/subpage.js

Uncovered Existing Lines

Lines Coverage ∆ File
1
79.49
-1.28% src/compiler/contentModel2/models/collection/category.js
1
80.73
-4.22% src/compiler/contentModel2/models/collection/index.js
2
90.0
0.14% src/routines.js
10
42.68
-16.36% src/compiler/contentModel2/index.js
Jobs
ID Job ID Ran Files Coverage
1 14347888629.1 09 Apr 2025 02:51AM UTC 114
76.21
GitHub Action Run
2 14347888629.2 09 Apr 2025 02:51AM UTC 114
76.21
GitHub Action Run
3 14347888629.3 09 Apr 2025 02:51AM UTC 114
76.21
GitHub Action Run
4 14347888629.4 09 Apr 2025 02:51AM UTC 114
76.21
GitHub Action Run
5 14347888629.5 09 Apr 2025 02:51AM UTC 114
76.21
GitHub Action Run
6 14347888629.6 09 Apr 2025 02:51AM UTC 114
76.21
GitHub Action Run
7 14347888629.7 09 Apr 2025 02:51AM UTC 114
76.21
GitHub Action Run
8 14347888629.8 09 Apr 2025 02:52AM UTC 114
76.21
GitHub Action Run
9 14347888629.9 09 Apr 2025 02:52AM UTC 114
76.21
GitHub Action Run
Source Files on build 14347888629
  • Tree
  • List 114
  • Changed 114
  • Source Changed 114
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #14347888629
  • ed20b8c9 on github
  • Prev Build on master (#14285885590)
  • Next Build on master (#14370824687)
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