mirror of https://gitlab.com/octtspacc/staticoso
CSS tests
This commit is contained in:
parent
58880ac27a
commit
95ea7f1023
|
@ -0,0 +1 @@
|
||||||
|
public/*
|
|
@ -0,0 +1,63 @@
|
||||||
|
:root {
|
||||||
|
--ScreenBorderPadding: 4px;
|
||||||
|
--ContentPadding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
Box-Sizing: Border-Box;
|
||||||
|
}
|
||||||
|
|
||||||
|
Body {
|
||||||
|
Margin: 0;
|
||||||
|
//Padding: var(--ScreenBorderPadding);
|
||||||
|
Box-Sizing: Border-Box;
|
||||||
|
Width: 100vw;
|
||||||
|
Position: Absolute;
|
||||||
|
Left: Auto;
|
||||||
|
Right: Auto;
|
||||||
|
}
|
||||||
|
#Container {
|
||||||
|
Box-Sizing: Border-Box;
|
||||||
|
}
|
||||||
|
|
||||||
|
#TopBox {
|
||||||
|
Border: 2px Solid Purple;
|
||||||
|
Padding: var(--ContentPadding);
|
||||||
|
}
|
||||||
|
#LeftBox {
|
||||||
|
Float: Left;
|
||||||
|
Padding: var(--ContentPadding);
|
||||||
|
//Border: 2px Solid Purple;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
#RightBox {
|
||||||
|
//Position: Inherit;
|
||||||
|
//Border: 2px Solid Purple;
|
||||||
|
//Top: 16px;
|
||||||
|
//Right: 16px;
|
||||||
|
// Margin: 0;
|
||||||
|
Padding: var(--ContentPadding);
|
||||||
|
Float: Right;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
#MainBox {
|
||||||
|
//Text-Align: Center;
|
||||||
|
Margin: Auto;
|
||||||
|
Position: Absolute;
|
||||||
|
Z-Index: -1;
|
||||||
|
Left: 0;
|
||||||
|
Right: 0;
|
||||||
|
Width: 80%;
|
||||||
|
}
|
||||||
|
#BottomBox {
|
||||||
|
Box-Sizing: Border-Box;
|
||||||
|
Border: 2px Solid Purple;
|
||||||
|
Position: Fixed;
|
||||||
|
Bottom: 0; //var(--ScreenBorderPadding);
|
||||||
|
//Margin: var(--ScreenBorderPadding);
|
||||||
|
Left: 0;
|
||||||
|
Right: 0;
|
||||||
|
Padding: var(--ContentPadding);
|
||||||
|
Width: 100vw;
|
||||||
|
Text-Align: Right;
|
||||||
|
}
|
|
@ -1,44 +0,0 @@
|
||||||
:root {
|
|
||||||
--ScreenBorderPadding: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
Box-Sizing: Border-Box;
|
|
||||||
}
|
|
||||||
|
|
||||||
Body {
|
|
||||||
Margin: 0;
|
|
||||||
Padding: var(--ScreenBorderPadding);
|
|
||||||
Box-Sizing: Border-Box;
|
|
||||||
Width: 100vw;
|
|
||||||
Height: 100vh;
|
|
||||||
}
|
|
||||||
#Container {
|
|
||||||
Box-Sizing: Border-Box;
|
|
||||||
}
|
|
||||||
|
|
||||||
#TopBox {
|
|
||||||
Border: 2px Solid Purple;
|
|
||||||
Padding: 8px;
|
|
||||||
}
|
|
||||||
#LeftBox {
|
|
||||||
Float: Left;
|
|
||||||
//Border: 2px Solid Purple;
|
|
||||||
}
|
|
||||||
#RightBox {
|
|
||||||
Position: Inherit;
|
|
||||||
Top: 16px;
|
|
||||||
Right: 16px;
|
|
||||||
Float: Right;
|
|
||||||
}
|
|
||||||
#MainBox {
|
|
||||||
Text-Align: Center;
|
|
||||||
Margin: Auto;
|
|
||||||
}
|
|
||||||
#BottomBox {
|
|
||||||
Box-Sizing: Border-Box;
|
|
||||||
//Border: 2px Solid Purple;
|
|
||||||
Position: Fixed;
|
|
||||||
Bottom: var(--ScreenBorderPadding);
|
|
||||||
Width: 100vw;
|
|
||||||
}
|
|
66
Build.py
66
Build.py
|
@ -26,46 +26,14 @@ def ResetPublic():
|
||||||
shutil.rmtree('public')
|
shutil.rmtree('public')
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
# os.mkdir('public')
|
|
||||||
|
|
||||||
def GetTitles(c):
|
|
||||||
Titles = []
|
|
||||||
|
|
||||||
return Titles
|
|
||||||
|
|
||||||
def FormatTitles(Titles):
|
def FormatTitles(Titles):
|
||||||
return ''
|
HTMLTitles = ''
|
||||||
|
for t in Titles:
|
||||||
"""
|
Heading = '- ' * (t.split(' ')[0].count('#')-1)
|
||||||
def GetAssociations():
|
t = t.lstrip('#')
|
||||||
f = ReadFile('Associations.txt')
|
HTMLTitles += Heading + t + ' \n'
|
||||||
Templates = f.splitlines()
|
return Markdown().convert(HTMLTitles)
|
||||||
Uses = {}
|
|
||||||
for t in Templates:
|
|
||||||
t = t.split(' ')
|
|
||||||
Uses.update({t[0][:-1]: t[1:]})
|
|
||||||
print(Uses)
|
|
||||||
return Uses
|
|
||||||
|
|
||||||
def LoadTemplates():
|
|
||||||
Templates = {}
|
|
||||||
for p in Path('Templates').rglob('*.html'):
|
|
||||||
p = str(p)[len('Templates')+1:]
|
|
||||||
Templates.update({p: ReadFile('Parts/{}'.format(p))})
|
|
||||||
return Templates
|
|
||||||
|
|
||||||
Templates = {}
|
|
||||||
for t in Associations:
|
|
||||||
Templates.update({t: ReadFile('Templates/{}'.format(t))})
|
|
||||||
return Templates
|
|
||||||
|
|
||||||
def LoadParts():
|
|
||||||
Parts = {}
|
|
||||||
for p in Path('Parts').rglob('*.html'):
|
|
||||||
p = str(p)[len('Parts')+1:]
|
|
||||||
Parts.update({p: ReadFile('Parts/{}'.format(p))})
|
|
||||||
return Parts
|
|
||||||
"""
|
|
||||||
|
|
||||||
def LoadFromDir(Dir):
|
def LoadFromDir(Dir):
|
||||||
Contents = {}
|
Contents = {}
|
||||||
|
@ -99,18 +67,12 @@ def PreProcessor(File):
|
||||||
Titles += [ls]
|
Titles += [ls]
|
||||||
return Content, Titles, Meta
|
return Content, Titles, Meta
|
||||||
|
|
||||||
"""
|
|
||||||
def MetaProcessor(Meta):
|
|
||||||
Meta[]
|
|
||||||
return Meta
|
|
||||||
"""
|
|
||||||
|
|
||||||
def PatchHTML(Template, Parts, Content, Titles, Meta):
|
def PatchHTML(Template, Parts, Content, Titles, Meta):
|
||||||
HTMLTitles = FormatTitles(Titles)
|
HTMLTitles = FormatTitles(Titles)
|
||||||
|
|
||||||
Template = Template.replace('[HTML:Page:Title]', 'Untitled' if not Titles else Titles[0])
|
Template = Template.replace('[HTML:Page:Title]', 'Untitled' if not Titles else Titles[0].lstrip('#'))
|
||||||
Template = Template.replace('[HTML:Page:Style]', Meta['Style'])
|
Template = Template.replace('[HTML:Page:Style]', Meta['Style'])
|
||||||
Template = Template.replace('[HTML:Page:RightBox]', str(Titles))
|
Template = Template.replace('[HTML:Page:RightBox]', HTMLTitles)
|
||||||
Template = Template.replace('[HTML:Page:MainBox]', Content)
|
Template = Template.replace('[HTML:Page:MainBox]', Content)
|
||||||
|
|
||||||
for p in Parts:
|
for p in Parts:
|
||||||
|
@ -126,8 +88,8 @@ def MakeSite(Templates, Parts):
|
||||||
|
|
||||||
Template = Templates[Meta['Template']]
|
Template = Templates[Meta['Template']]
|
||||||
Template = Template.replace(
|
Template = Template.replace(
|
||||||
'Style.css',
|
'[HTML:Page:CSS]',
|
||||||
'{}Style.css'.format('../'*File.count('/')))
|
'{}{}.css'.format('../'*File.count('/'), Meta['Template'][:-5]))
|
||||||
|
|
||||||
print(Content, Titles, Meta)
|
print(Content, Titles, Meta)
|
||||||
WriteFile(
|
WriteFile(
|
||||||
|
@ -143,17 +105,13 @@ def IgnoreFiles(dir, files):
|
||||||
return [f for f in files if os.path.isfile(os.path.join(dir, f))]
|
return [f for f in files if os.path.isfile(os.path.join(dir, f))]
|
||||||
def CopyAssets():
|
def CopyAssets():
|
||||||
shutil.copytree('Pages', 'public', ignore=IgnoreFiles)
|
shutil.copytree('Pages', 'public', ignore=IgnoreFiles)
|
||||||
# for File in Path('Assets').rglob('*'):
|
|
||||||
# File = str(File)
|
|
||||||
# shutil.copy(File, 'public/{}'.format(File[len('Assets/'):]))
|
|
||||||
os.system("cp -R Assets/* public/")
|
os.system("cp -R Assets/* public/")
|
||||||
|
|
||||||
def Main():
|
def Main():
|
||||||
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||||
ResetPublic()
|
ResetPublic()
|
||||||
# Associations = GetAssociations()
|
Templates = LoadFromDir('Templates')
|
||||||
Templates = LoadFromDir('Templates') #LoadTemplates(Associations)
|
Parts = LoadFromDir('Parts')
|
||||||
Parts = LoadFromDir('Parts') #LoadParts()
|
|
||||||
print(Templates, Parts)
|
print(Templates, Parts)
|
||||||
CopyAssets()
|
CopyAssets()
|
||||||
MakeSite(Templates, Parts)
|
MakeSite(Templates, Parts)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Footer
|
|
@ -0,0 +1,2 @@
|
||||||
|
<a href="/">Home</a>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Header
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="Style.css">
|
<link rel="stylesheet" href="[HTML:Page:CSS]">
|
||||||
<script src="/App.js"></script>
|
<script src="/App.js"></script>
|
||||||
<title>[HTML:Page:Title] - postoctt</title>
|
<title>[HTML:Page:Title] - postoctt</title>
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in New Issue