From 5e62cf6fdae2ef68a8ae3857618cf3aa334772a7 Mon Sep 17 00:00:00 2001 From: Chesapeake Date: Sun, 26 Dec 2021 15:24:09 -0500 Subject: [PATCH] Add files via upload --- Caddyfile | 10 ++++++ blog.html | 28 +++++++++++++++++ index.html | 26 ++++++++++++++++ markdown/Sample 1.md | 42 +++++++++++++++++++++++++ markdown/Sample 2.md | 11 +++++++ siteName | 1 + style.css | 73 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 191 insertions(+) create mode 100644 Caddyfile create mode 100644 blog.html create mode 100644 index.html create mode 100644 markdown/Sample 1.md create mode 100644 markdown/Sample 2.md create mode 100644 siteName create mode 100644 style.css diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..7b7f2b8 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,10 @@ +localhost { + templates + encode zstd gzip + root * /path/to/bloggy # Change this + file_server + rewrite /blog/* blog.html + handle_errors { + respond "{http.error.status_code} {http.error.status_text}" + } +} diff --git a/blog.html b/blog.html new file mode 100644 index 0000000..ebf9d28 --- /dev/null +++ b/blog.html @@ -0,0 +1,28 @@ +{{$siteName := (include "/siteName")}} +{{$pathParts := splitList "/" .OriginalReq.URL.Path}} +{{$markdownFilename := default "index" (slice $pathParts 2 | join "/")}} +{{$markdownFilePath := printf "/markdown/%s.md" $markdownFilename}} +{{if not (fileExists $markdownFilePath)}}{{httpError 404}}{{end}} +{{$markdownFile := (include $markdownFilePath | splitFrontMatter)}} + + + + + {{$markdownFilename}} - {{$siteName}} + + + +
+
+
+ {{markdown $markdownFile.Body}} +
+
+ +
+
+ + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..b496362 --- /dev/null +++ b/index.html @@ -0,0 +1,26 @@ +{{$siteName := (include "/siteName")}} +{{$files := (listFiles "/markdown")}} +{{$length := (len $files)}} + + + + + {{$siteName}} + + + +
+
+

Welcome to {{$siteName}}!

+
+ {{range $files}} +

+ {{trimSuffix ".md" (first $files)}} +

+ {{$files = (rest $files)}} + {{end}} +
+
+ + + diff --git a/markdown/Sample 1.md b/markdown/Sample 1.md new file mode 100644 index 0000000..1e9c87e --- /dev/null +++ b/markdown/Sample 1.md @@ -0,0 +1,42 @@ +# Sample 1 +--- +This is a sample file. + +*Emphasized text* + +**Strong text** + +`Code` + +> Block quote + +* Bulleted list +* List list list +* More list + +1. Numbered list +2. It has numbers +3. Blah blah blah + +* You can nest lists too + 1. Like + 2. This +* Isn't that cool? + +Here is a [link](https://wikipedia.org) + +And here is a table + + Header | Another Header | Yet Another Header + ---------|----------------|------------------- + Value 11 | Value 12 | Value 13 + Value 21 | Value 22 | Value 23 + Value 31 | Value 32 | Value 33 + +You can escape stuff with backslashes: \*escaped!\* + +You can add images too. + +![This is an image.](https://picsum.photos/1024) + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/markdown/Sample 2.md b/markdown/Sample 2.md new file mode 100644 index 0000000..2f61c16 --- /dev/null +++ b/markdown/Sample 2.md @@ -0,0 +1,11 @@ +# Sample 2 +--- +Aspernatur tenetur id at. In dolor expedita aut doloremque qui. Et eum excepturi amet ut. Ut esse dicta eos reiciendis ullam et. + +Natus excepturi ut et non omnis. Ratione ullam sunt quo neque amet hic. Ad qui labore iste molestiae quaerat atque iste perferendis. Facere odio suscipit officiis vel sit aut sapiente dolores. Velit voluptatum quidem corrupti distinctio. Deleniti consectetur similique quasi mollitia est sint quae nesciunt. + +Et omnis beatae nesciunt. Ut aut laudantium maxime velit est nihil eveniet. Occaecati similique animi libero sunt voluptatem eligendi. Praesentium corporis voluptatem illo tempora alias voluptas est. + +Similique saepe deserunt nulla officia et dignissimos sit vel. Tempora occaecati repudiandae doloribus corporis iusto excepturi id in. Beatae quidem ea fugiat. Sint officia amet atque optio quam. Inventore quisquam velit ratione itaque architecto quia eligendi nesciunt. Quo nisi veniam eos provident voluptates aut dolores placeat. + +Aut qui quam sint ipsam voluptatem. Incidunt corporis atque consequatur assumenda alias fugiat atque. Ipsa repellendus assumenda facilis ut. Animi tempore suscipit nihil qui possimus. Dolor voluptatibus quos dolor. Magnam earum eveniet quae omnis eos pariatur. diff --git a/siteName b/siteName new file mode 100644 index 0000000..aeadd04 --- /dev/null +++ b/siteName @@ -0,0 +1 @@ +Bloggy \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..806dba6 --- /dev/null +++ b/style.css @@ -0,0 +1,73 @@ +:root { + --fg: black; + --light: blue; + --dark: purple; + --bg: white; + --shadow: grey; +} +* { + color: var(--fg); + background-color: var(--bg); + font-family: sans-serif; + text-align: left; +} +article { + text-align: center; +} +html { + height: 100%; + margin: 0; + padding: 0; +} +body { + height: 100%; + margin: 0; + padding: 0; +} +img { + max-width: 80%; + margin: 0 10% 0 10%; + max-height: 100%; +} +h1, h2, h3, h4, h5, h6{ + text-align: center; +} +code { + font-family: monospace; +} +table{ + border-style: solid; + border-width: thin; + border-color: var(--fg); +} +th { + border-style: solid; + border-width: thin; + border-color: var(--fg); + color: var(--bg); + background: var(--fg); + padding: 0.5em; +} +td{ + border-style: solid; + border-width: thin; + border-color: var(--fg); + padding: 0.5em; +} + +.outer { + display: flex; + justify-content: center; + width: 100%; + height: 100%; +} +.inner { + width: 50em; + max-width: 75vw; + text-align: center; + margin-left: auto; + margin-right: auto; +} +.footer { + text-align: center; +} \ No newline at end of file