mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Transition to monorepo on a new Dev branch
This commit is contained in:
24
App/Source/Modules/Pug.py
Normal file
24
App/Source/Modules/Pug.py
Normal file
@ -0,0 +1,24 @@
|
||||
""" ================================= |
|
||||
| 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 *
|
||||
|
||||
def PugCompileList(OutputDir, Pages, LimitFiles):
|
||||
# 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:
|
||||
if File.lower().endswith('.pug') and (LimitFiles == False or File in LimitFiles):
|
||||
Path = f'{OutputDir}/{File}'
|
||||
WriteFile(Path, Content)
|
||||
Paths += f'"{Path}" '
|
||||
if Paths:
|
||||
os.system(f'pug -P {Paths} > /dev/null')
|
Reference in New Issue
Block a user