mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Working but really not Gemtext generation
This commit is contained in:
23
Source/Modules/Pug.py
Normal file
23
Source/Modules/Pug.py
Normal file
@ -0,0 +1,23 @@
|
||||
""" ================================= |
|
||||
| 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(Pages):
|
||||
# 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.endswith('.pug'):
|
||||
Path = 'public/{}'.format(File)
|
||||
WriteFile(Path, Content)
|
||||
Paths += '"{}" '.format(Path)
|
||||
os.system('pug -P {} > /dev/null'.format(Paths))
|
Reference in New Issue
Block a user