@@ -1432,7 +1432,6 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
1432
1432
self .timeline .extend (timeline )
1433
1433
1434
1434
quit = False
1435
- < << << << HEAD
1436
1435
# Classify posts per year/tag/month/whatever
1437
1436
slugged_tags = set ([])
1438
1437
for post in self .timeline :
@@ -1451,81 +1450,6 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
1451
1450
utils .LOGGER .error ('Tag {0} is used in: {1}' .format (tag , post .source_path ))
1452
1451
utils .LOGGER .error ('Tag {0} is used in: {1}' .format (other_tag , ', ' .join ([p .source_path for p in self .posts_per_tag [other_tag ]])))
1453
1452
quit = True
1454
- == == == =
1455
- for wildcard , destination , template_name , use_in_feeds in \
1456
- self .config ['post_pages' ]:
1457
- if not self .quiet and not quiet :
1458
- print ("." , end = '' , file = sys .stderr )
1459
- dirname = os .path .dirname (wildcard )
1460
- for dirpath , _ , _ in os .walk (dirname , followlinks = True ):
1461
- dest_dir = os .path .normpath (os .path .join (destination ,
1462
- os .path .relpath (dirpath , dirname ))) # output/destination/foo/
1463
- # Get all the untranslated paths
1464
- dir_glob = os .path .join (dirpath , os .path .basename (wildcard )) # posts/foo/*.rst
1465
- untranslated = glob .glob (dir_glob )
1466
- # And now get all the translated paths
1467
- translated = set ([])
1468
- for lang in self .config ['TRANSLATIONS' ].keys ():
1469
- if lang == self .config ['DEFAULT_LANG' ]:
1470
- continue
1471
- lang_glob = utils .get_translation_candidate (self .config , dir_glob , lang ) # posts/foo/*.LANG.rst
1472
- translated = translated .union (set (glob .glob (lang_glob )))
1473
- # untranslated globs like *.rst often match translated paths too, so remove them
1474
- # and ensure x.rst is not in the translated set
1475
- untranslated = set (untranslated ) - translated
1476
-
1477
- # also remove from translated paths that are translations of
1478
- # paths in untranslated_list, so x.es.rst is not in the untranslated set
1479
- for p in untranslated :
1480
- translated = translated - set ([utils .get_translation_candidate (self .config , p , l ) for l in self .config ['TRANSLATIONS' ].keys ()])
1481
-
1482
- full_list = list (translated ) + list (untranslated )
1483
- # We eliminate from the list the files inside any .ipynb folder
1484
- full_list = [p for p in full_list
1485
- if not any ([x .startswith ('.' )
1486
- for x in p .split (os .sep )])]
1487
-
1488
- for base_path in full_list :
1489
- if base_path in seen :
1490
- continue
1491
- else :
1492
- seen .add (base_path )
1493
- post = Post (
1494
- base_path ,
1495
- self .config ,
1496
- dest_dir ,
1497
- use_in_feeds ,
1498
- self .MESSAGES ,
1499
- template_name ,
1500
- self .get_compiler (base_path )
1501
- )
1502
- self .timeline .append (post )
1503
- self .global_data [post .source_path ] = post
1504
- if post .use_in_feeds :
1505
- self .posts .append (post )
1506
- self .posts_per_year [
1507
- str (post .date .year )].append (post )
1508
- self .posts_per_month [
1509
- '{0}/{1:02d}' .format (post .date .year , post .date .month )].append (post )
1510
- for tag in post .alltags :
1511
- _tag_slugified = utils .slugify (tag )
1512
- if _tag_slugified in slugged_tags :
1513
- if tag not in self .posts_per_tag :
1514
- # Tags that differ only in case
1515
- other_tag = [existing for existing in self .posts_per_tag .keys () if utils .slugify (existing ) == _tag_slugified ][0 ]
1516
- utils .LOGGER .error ('You have tags that are too similar: {0} and {1}' .format (tag , other_tag ))
1517
- utils .LOGGER .error ('Tag {0} is used in: {1}' .format (tag , post .source_path ))
1518
- utils .LOGGER .error ('Tag {0} is used in: {1}' .format (other_tag , ', ' .join ([p .source_path for p in self .posts_per_tag [other_tag ]])))
1519
- quit = True
1520
- else :
1521
- slugged_tags .add (utils .slugify (tag , force = True ))
1522
- self .posts_per_tag [tag ].append (post )
1523
- self ._add_post_to_category (post , post .meta ('category' ))
1524
-
1525
- if post .is_post :
1526
- # unpublished posts
1527
- self .all_posts .append (post )
1528
- > >> >> >> master
1529
1453
else :
1530
1454
slugged_tags .add (utils .slugify (tag , force = True ))
1531
1455
self .posts_per_tag [tag ].append (post )
@@ -1542,22 +1466,11 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
1542
1466
self .post_per_file [post .destination_path (lang = lang , extension = post .source_ext ())] = post
1543
1467
1544
1468
# Sort everything.
1545
- < << << << HEAD
1546
1469
1547
1470
for thing in self .timeline , self .posts , self .all_posts , self .pages :
1548
1471
thing .sort (key = lambda p : p .date )
1549
1472
thing .reverse ()
1550
- == == == =
1551
- self .timeline .sort (key = lambda p : p .date )
1552
- self .timeline .reverse ()
1553
- self .posts .sort (key = lambda p : p .date )
1554
- self .posts .reverse ()
1555
- self .all_posts .sort (key = lambda p : p .date )
1556
- self .all_posts .reverse ()
1557
- self .pages .sort (key = lambda p : p .date )
1558
- self .pages .reverse ()
1559
1473
self ._sort_category_hierarchy ()
1560
- > >> >> >> master
1561
1474
1562
1475
for i , p in enumerate (self .posts [1 :]):
1563
1476
p .next_post = self .posts [i ]
0 commit comments