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')
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
# os.mkdir('public')
|
||||
|
||||
def GetTitles(c):
|
||||
Titles = []
|
||||
|
||||
return Titles
|
||||
|
||||
def FormatTitles(Titles):
|
||||
return ''
|
||||
|
||||
"""
|
||||
def GetAssociations():
|
||||
f = ReadFile('Associations.txt')
|
||||
Templates = f.splitlines()
|
||||
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
|
||||
"""
|
||||
HTMLTitles = ''
|
||||
for t in Titles:
|
||||
Heading = '- ' * (t.split(' ')[0].count('#')-1)
|
||||
t = t.lstrip('#')
|
||||
HTMLTitles += Heading + t + ' \n'
|
||||
return Markdown().convert(HTMLTitles)
|
||||
|
||||
def LoadFromDir(Dir):
|
||||
Contents = {}
|
||||
|
@ -99,18 +67,12 @@ def PreProcessor(File):
|
|||
Titles += [ls]
|
||||
return Content, Titles, Meta
|
||||
|
||||
"""
|
||||
def MetaProcessor(Meta):
|
||||
Meta[]
|
||||
return Meta
|
||||
"""
|
||||
|
||||
def PatchHTML(Template, Parts, Content, Titles, Meta):
|
||||
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:RightBox]', str(Titles))
|
||||
Template = Template.replace('[HTML:Page:RightBox]', HTMLTitles)
|
||||
Template = Template.replace('[HTML:Page:MainBox]', Content)
|
||||
|
||||
for p in Parts:
|
||||
|
@ -126,8 +88,8 @@ def MakeSite(Templates, Parts):
|
|||
|
||||
Template = Templates[Meta['Template']]
|
||||
Template = Template.replace(
|
||||
'Style.css',
|
||||
'{}Style.css'.format('../'*File.count('/')))
|
||||
'[HTML:Page:CSS]',
|
||||
'{}{}.css'.format('../'*File.count('/'), Meta['Template'][:-5]))
|
||||
|
||||
print(Content, Titles, Meta)
|
||||
WriteFile(
|
||||
|
@ -143,17 +105,13 @@ def IgnoreFiles(dir, files):
|
|||
return [f for f in files if os.path.isfile(os.path.join(dir, f))]
|
||||
def CopyAssets():
|
||||
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/")
|
||||
|
||||
def Main():
|
||||
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||
ResetPublic()
|
||||
# Associations = GetAssociations()
|
||||
Templates = LoadFromDir('Templates') #LoadTemplates(Associations)
|
||||
Parts = LoadFromDir('Parts') #LoadParts()
|
||||
Templates = LoadFromDir('Templates')
|
||||
Parts = LoadFromDir('Parts')
|
||||
print(Templates, Parts)
|
||||
CopyAssets()
|
||||
MakeSite(Templates, Parts)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Footer
|
|
@ -0,0 +1,2 @@
|
|||
<a href="/">Home</a>
|
||||
|
|
@ -0,0 +1 @@
|
|||
Header
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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>
|
||||
<title>[HTML:Page:Title] - postoctt</title>
|
||||
<style>
|
||||
|
|
Loading…
Reference in New Issue