@@ -140,7 +140,7 @@ func TestParse(t *testing.T) {
140
140
141
141
// Reclassify it as a content resource.
142
142
ModifyPathBundleTypeResource (p )
143
- c .Assert (p .BundleType (), qt .Equals , PathTypeContentResource )
143
+ c .Assert (p .Type (), qt .Equals , PathTypeContentResource )
144
144
c .Assert (p .IsContent (), qt .IsTrue )
145
145
c .Assert (p .Name (), qt .Equals , "b.md" )
146
146
c .Assert (p .Base (), qt .Equals , "/a/b.md" )
@@ -386,41 +386,41 @@ func TestParseLayouts(t *testing.T) {
386
386
}{
387
387
{
388
388
"Basic" ,
389
- "/_default/ list.html" ,
389
+ "/list.html" ,
390
390
func (c * qt.C , p * Path ) {
391
- c .Assert (p .Base (), qt .Equals , "/_default/ list.html" )
391
+ c .Assert (p .Base (), qt .Equals , "/list.html" )
392
392
},
393
393
},
394
394
{
395
395
"Lang" ,
396
- "/_default/ list.no.html" ,
396
+ "/list.no.html" ,
397
397
func (c * qt.C , p * Path ) {
398
- c .Assert (p .Base (), qt .Equals , "/_default/ list.html" )
398
+ c .Assert (p .Base (), qt .Equals , "/list.html" )
399
399
c .Assert (p .Lang (), qt .Equals , "no" )
400
400
},
401
401
},
402
402
{
403
403
"Lang and output format" ,
404
- "/_default/ list.no.amp.not.html" ,
404
+ "/list.no.amp.not.html" ,
405
405
func (c * qt.C , p * Path ) {
406
406
c .Assert (p .Identifiers (), qt .DeepEquals , []string {"html" , "not" , "amp" , "no" })
407
407
c .Assert (p .OutputFormat (), qt .Equals , "amp" )
408
408
c .Assert (p .Ext (), qt .Equals , "html" )
409
409
c .Assert (p .Lang (), qt .Equals , "no" )
410
- c .Assert (p .Base (), qt .Equals , "/_default/ list.html" )
410
+ c .Assert (p .Base (), qt .Equals , "/list.html" )
411
411
},
412
412
},
413
413
{
414
414
"Term" ,
415
- "/_default/ term.html" ,
415
+ "/term.html" ,
416
416
func (c * qt.C , p * Path ) {
417
417
c .Assert (p .Identifiers (), qt .DeepEquals , []string {"html" , "term" })
418
- c .Assert (p .PathNoIdentifier (), qt .Equals , "/_default " )
419
- c .Assert (p .PathBeforeLangAndOutputFormatAndExt (), qt .Equals , "/_default/ term" )
418
+ c .Assert (p .PathNoIdentifier (), qt .Equals , "/" )
419
+ c .Assert (p .PathBeforeLangAndOutputFormatAndExt (), qt .Equals , "/term" )
420
420
c .Assert (p .Lang (), qt .Equals , "" )
421
421
c .Assert (p .Kind (), qt .Equals , "term" )
422
422
c .Assert (p .OutputFormat (), qt .Equals , "html" )
423
- c .Assert (p .Base (), qt .Equals , "/_default .html" ) // TODO1
423
+ c .Assert (p .Base (), qt .Equals , "/.html" ) // TODO1
424
424
},
425
425
},
426
426
{
@@ -447,6 +447,48 @@ func TestParseLayouts(t *testing.T) {
447
447
c .Assert (p .NameNoIdentifier (), qt .Equals , "baseof" )
448
448
},
449
449
},
450
+ {
451
+ "Markup" ,
452
+ "/_markup/render-link.html" ,
453
+ func (c * qt.C , p * Path ) {
454
+ c .Assert (p .Type (), qt .Equals , PathTypeMarkup )
455
+ },
456
+ },
457
+ {
458
+ "Markup nested" ,
459
+ "/foo/_markup/render-link.html" ,
460
+ func (c * qt.C , p * Path ) {
461
+ c .Assert (p .Type (), qt .Equals , PathTypeMarkup )
462
+ },
463
+ },
464
+ {
465
+ "Shortcode" ,
466
+ "/_shortcodes/myshortcode.html" ,
467
+ func (c * qt.C , p * Path ) {
468
+ c .Assert (p .Type (), qt .Equals , PathTypeShortcode )
469
+ },
470
+ },
471
+ {
472
+ "Shortcode nested" ,
473
+ "/foo/_shortcodes/myshortcode.html" ,
474
+ func (c * qt.C , p * Path ) {
475
+ c .Assert (p .Type (), qt .Equals , PathTypeShortcode )
476
+ },
477
+ },
478
+ {
479
+ "Shortcode nested sub" ,
480
+ "/foo/_shortcodes/foo/myshortcode.html" ,
481
+ func (c * qt.C , p * Path ) {
482
+ c .Assert (p .Type (), qt .Equals , PathTypeShortcode )
483
+ },
484
+ },
485
+ {
486
+ "Partials" ,
487
+ "/_partials/foo.bar" ,
488
+ func (c * qt.C , p * Path ) {
489
+ c .Assert (p .Type (), qt .Equals , PathTypePartial )
490
+ },
491
+ },
450
492
}
451
493
452
494
for _ , test := range tests {
0 commit comments