~rjpcasalino/odyssey

3728f167e9b1d7cf1007d7aa8eee1c822f48b293 — rjpcasalino 8 months ago 34c178b
adds pdf to regex for cv stuff
1 files changed, 8 insertions(+), 4 deletions(-)

M src/odyssey
M src/odyssey => src/odyssey +8 -4
@@ 119,7 119,7 @@ def do_build():
            os.mkdir(os.path.join(os.path.relpath(dirpath), dir).replace("pages", "_site"))
        for file in filenames:
            try:
                f = re.match("(?:png|jpg|jpeg|gif|svg|md)", file.split(".")[1])
                f = re.match("(?:png|jpg|jpeg|gif|svg|md|pdf)", file.split(".")[1])
                if "md" in f.group():
                    filename = os.path.join(dirpath, file)
                    with open(filename, "r+") as f:


@@ 130,15 130,18 @@ def do_build():
                        build_index(filename, block[0][1], block[1][1], time.ctime())                           
                    else:
                        build_page(filename, block[0][1], block[1][1], time.ctime())
                elif "pdf" in f.group():
                    ## this is cv related
                    shutil.copy(os.path.join(dirpath, file), "_site/cv/")
                else:
                    if os.path.isdir("_site/static/"):
                        shutil.copy(os.path.join(dirpath, file), "_site/static/")
                    else:
                        os.mkdir("_site/static/")
                        shutil.copy(os.path.join(dirpath, file), "_site/static/")
            except Exception:
                print("error during build")
                raise
            except Exception as e:
                print("error during build: {}".format(e))
                pass


def read_file(seq, delim):


@@ 155,6 158,7 @@ def read_file(seq, delim):
            if line.strip() != delim.strip() or delim_count >= 2:
                raise ValueError("invalid front matter")
            yield yaml_block
            # TODO: do we really need to recast these values?
            yaml_block = []
            markdown_block = []
        yaml_block.append(line)