Changes to new build system to include URI keyword/building.

This commit is contained in:
Shamus Hammons 2017-02-13 12:18:43 -06:00 committed by Paul Davis
parent d64781b7c2
commit f1607b3d25
4 changed files with 261 additions and 5 deletions

View File

@ -112,12 +112,18 @@ def GetFileStructure():
level = PartToLevel(hdr['part']) level = PartToLevel(hdr['part'])
hdr['level'] = level hdr['level'] = level
fnames[level] = MakeFilename(hdr['title']) fnames[level] = MakeFilename(hdr['title'])
fullName = ''
for i in range(level + 1): # Ickyness--user specified URIs
fullName = fullName + fnames[i] + '/' if 'uri' in hdr:
hdr['filename'] = hdr['uri']
else:
fullName = ''
for i in range(level + 1):
fullName = fullName + fnames[i] + '/'
hdr['filename'] = fullName.rstrip('/')
hdr['filename'] = fullName.rstrip('/')
fs.append(hdr) fs.append(hdr)
if ('include' not in hdr) and (level > 0): if ('include' not in hdr) and (level > 0):
@ -466,7 +472,10 @@ for header in fileStruct:
page = page.replace('{{ content }}', content + more) page = page.replace('{{ content }}', content + more)
# Create the directory for the index.html file to go into # Create the directory for the index.html file to go into
os.mkdir(siteDir + header['filename'], 0o775) # (we use makedirs, because we have to in order to accomadate the 'uri'
# keyword
# os.mkdir(siteDir + header['filename'], 0o775)
os.makedirs(siteDir + header['filename'], 0o775, exist_ok=True)
# Finally, write the file! # Finally, write the file!
destFile = open(siteDir + header['filename'] + '/index.html', 'w') destFile = open(siteDir + header['filename'] + '/index.html', 'w')

View File

@ -114,6 +114,9 @@ for line in master:
if 'link' in header: if 'link' in header:
explode.write('link: ' + header['link'] + '\n') explode.write('link: ' + header['link'] + '\n')
if 'uri' in header:
explode.write('uri: ' + header['uri'] + '\n')
if 'style' in header: if 'style' in header:
explode.write('style: ' + header['style'] + '\n') explode.write('style: ' + header['style'] + '\n')

View File

@ -94,6 +94,9 @@ for line in master:
if 'link' in header: if 'link' in header:
implode.write('link: ' + header['link'] + '\n') implode.write('link: ' + header['link'] + '\n')
if 'uri' in header:
implode.write('uri: ' + header['uri'] + '\n')
if 'style' in header: if 'style' in header:
implode.write('style: ' + header['style'] + '\n') implode.write('style: ' + header['style'] + '\n')

File diff suppressed because it is too large Load Diff