2022-06-29 20:09:13 +02:00
|
|
|
""" ================================= |
|
|
|
|
| This file is part of |
|
|
|
|
| staticoso |
|
|
|
|
| Just a simple Static Site Generator |
|
|
|
|
| |
|
|
|
|
| Licensed under the AGPLv3 license |
|
|
|
|
| Copyright (C) 2022, OctoSpacc |
|
|
|
|
| ================================= """
|
|
|
|
|
|
|
|
# TODO: Write a native Pug parser; There is one already available for Python but seems broken / out-of-date
|
|
|
|
|
|
|
|
import os
|
|
|
|
from Modules.Utils import *
|
|
|
|
|
2022-08-27 16:50:50 +02:00
|
|
|
def PugCompileList(OutputDir, Pages, LimitFiles):
|
2022-06-29 20:09:13 +02:00
|
|
|
# Pug-cli seems to shit itself with folder paths as input, so we pass ALL the files as arguments
|
|
|
|
Paths = ''
|
|
|
|
for File, Content, Titles, Meta in Pages:
|
2022-08-28 00:32:45 +02:00
|
|
|
if File.lower().endswith('.pug') and (LimitFiles == False or File in LimitFiles):
|
2022-08-23 17:25:05 +02:00
|
|
|
Path = f'{OutputDir}/{File}'
|
2022-06-29 20:09:13 +02:00
|
|
|
WriteFile(Path, Content)
|
2022-08-23 17:25:05 +02:00
|
|
|
Paths += f'"{Path}" '
|
2022-07-24 16:47:12 +02:00
|
|
|
if Paths:
|
2022-08-23 17:25:05 +02:00
|
|
|
os.system(f'pug -P {Paths} > /dev/null')
|