From 06b45e46c984782c74bdb16ab182274352e507fd Mon Sep 17 00:00:00 2001 From: Rosia E Evans Date: Fri, 29 Sep 2023 15:07:29 +0100 Subject: [PATCH] adds error catching for empty pages moves index page to blog post format rather than static page --- Resources/Static/index.html | 39 ------------------------------------- Src/Page.cpp | 2 ++ 2 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 Resources/Static/index.html diff --git a/Resources/Static/index.html b/Resources/Static/index.html deleted file mode 100644 index 6625b14..0000000 --- a/Resources/Static/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -
- Rosia Evans -
-
-

- Welcome! -

-
- I'm Rosia Evans, this is my site where I log my work for myself and for me to show to - others. -
- -
- I'm currently studying at a small university in wales where I'm doing a BEng in - software engineering whilst working on robotics and exploring my own interests - on the side through various societies. I've previously had interests in VR and XR - and UI design, spending a lot of my secondary school years experimenting with both - concepts. -
- -
- See more about my work here: - -
- Work -
-
- - -
-
- - diff --git a/Src/Page.cpp b/Src/Page.cpp index ee948e4..80f876b 100644 --- a/Src/Page.cpp +++ b/Src/Page.cpp @@ -4,6 +4,8 @@ void Page::calculatePageFlags() { int endOfFirstLine = sourceFileContents.find_first_of("\n"); + if (endOfFirstLine == -1) + throw sourceFileUrl + " is empty or all on one line"; std::string tagLine = sourceFileContents.substr(0, endOfFirstLine); sourceFileContents = sourceFileContents.substr(endOfFirstLine, sourceFileContents.length()-endOfFirstLine);