X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=build.py;h=10c047597a534ca9980a76d8c787928052b961b8;hb=1fb47e2f284f66f0ebbf5d54abf0397f2375d45b;hp=8ac84d4efb4e93859685ad7fb7f0962ebad7de26;hpb=178bba3b522fbe071ac0c5bc3d48c40b4e41476b;p=ardour-manual diff --git a/build.py b/build.py index 8ac84d4..10c0475 100755 --- a/build.py +++ b/build.py @@ -112,12 +112,18 @@ def GetFileStructure(): level = PartToLevel(hdr['part']) hdr['level'] = level fnames[level] = MakeFilename(hdr['title']) - fullName = '' - for i in range(level + 1): - fullName = fullName + fnames[i] + '/' + # Ickyness--user specified URIs + 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) if ('include' not in hdr) and (level > 0): @@ -316,11 +322,6 @@ if os.access(siteDir, os.F_OK): shutil.copytree('./source', siteDir) -# Yeah, need to make a symlink in include/ too :-P -# [this will go away when the rewrite happens] -if (os.access('include/_manual', os.F_OK) == False): - os.symlink('../_manual/', 'include/_manual') - # Read the template, and fix the stuff that's fixed for all pages temp = open('page-template.txt') @@ -465,8 +466,9 @@ for header in fileStruct: page = page.replace('{% prevnext %}', prevnext) page = page.replace('{{ content }}', content + more) - # Create the directory for the index.html file to go into - os.mkdir(siteDir + header['filename'], 0o775) + # Create the directory for the index.html file to go into (we use makedirs, + # because we have to in order to accomodate the 'uri' keyword) + os.makedirs(siteDir + header['filename'], 0o775, exist_ok=True) # Finally, write the file! destFile = open(siteDir + header['filename'] + '/index.html', 'w')