diff --git a/.gitignore b/.gitignore index 0f521b3..57872d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ /vendor/ - -sftp.json \ No newline at end of file diff --git a/docker_dev/Dockerfile b/docker_dev/Dockerfile index 6440854..4f96be7 100644 --- a/docker_dev/Dockerfile +++ b/docker_dev/Dockerfile @@ -14,7 +14,5 @@ RUN a2enmod rewrite RUN a2enmod headers RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli -RUN mkdir raw - COPY www/ . -RUN chmod -R a+rw $(ls -I vendor) +RUN chmod -R a+r $(ls -I vendor) diff --git a/docker_dev/compose.yaml b/docker_dev/compose.yaml index 1b9493d..cbbec73 100644 --- a/docker_dev/compose.yaml +++ b/docker_dev/compose.yaml @@ -5,12 +5,6 @@ services: dockerfile: docker_dev/Dockerfile ports: - 8081:80 - environment: - MYSQL_USER: root - MYSQL_PASSWORD: example - MYSQL_DATABASE: dragon_fire - MYSQL_HOST: mysql - MYSQL_PORT: 3306 develop: watch: - path: ./ @@ -23,9 +17,6 @@ services: ignore: - ../.git - mysql_schema.sql - volumes: - - website_datavolume:/var/www/html/raw - mysql: build: dockerfile: MysqlDockerfile @@ -41,8 +32,7 @@ services: watch: - path: mysql_schema.sql action: rebuild - volumes: - - sqlvolume:/var/lib/mysql +# volumes: +# - sqlvolume:/var/lib/mysql volumes: sqlvolume: {} - website_datavolume: {} diff --git a/docker_dev/mysql_schema.sql b/docker_dev/mysql_schema.sql index 6801fcd..e3c1b58 100644 --- a/docker_dev/mysql_schema.sql +++ b/docker_dev/mysql_schema.sql @@ -107,15 +107,5 @@ Sorry for this. Shi is working hard :> # Nothing here yet! Sorry for this. She GRABS A LOT - ----- - -## And now, for the lorem: - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Eleifend mi in nulla posuere sollicitudin aliquam ultrices sagittis orci. Risus commodo viverra maecenas accumsan lacus vel facilisis. Sed viverra tellus in hac habitasse. Nulla malesuada pellentesque elit eget gravida cum. Posuere sollicitudin aliquam ultrices sagittis orci a. Libero nunc consequat interdum varius sit amet. Bibendum arcu vitae elementum curabitur vitae nunc sed velit. Amet mauris commodo quis imperdiet massa tincidunt nunc pulvinar. Sed adipiscing diam donec adipiscing. Laoreet id donec ultrices tincidunt arcu non sodales. Id semper risus in hendrerit gravida rutrum quisque non. Ut venenatis tellus in metus vulputate eu. - -Risus sed vulputate odio ut enim blandit volutpat. Placerat in egestas erat imperdiet. Non curabitur gravida arcu ac tortor dignissim convallis aenean. Neque aliquam vestibulum morbi blandit cursus risus at. Elementum integer enim neque volutpat ac tincidunt vitae semper. Eu ultrices vitae auctor eu augue ut. In mollis nunc sed id semper risus in hendrerit gravida. Lectus arcu bibendum at varius vel pharetra vel turpis nunc. In pellentesque massa placerat duis. Non quam lacus suspendisse faucibus. Vitae aliquet nec ullamcorper sit amet risus nullam. Accumsan lacus vel facilisis volutpat est velit egestas dui. - -Risus feugiat in ante metus dictum at tempor commodo. Duis ut diam quam nulla. Nunc aliquet bibendum enim facilisis gravida neque convallis. Tincidunt augue interdum velit euismod in pellentesque. Praesent semper feugiat nibh sed pulvinar proin gravida hendrerit lectus. Non odio euismod lacinia at quis risus sed vulputate odio. Nunc sed blandit libero volutpat sed cras ornare arcu. Adipiscing enim eu turpis egestas pretium aenean pharetra magna. Ut tristique et egestas quis ipsum suspendisse. Blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada. ' ); \ No newline at end of file diff --git a/scripts/upload_file.sh b/scripts/upload_file.sh deleted file mode 100755 index 587ceb9..0000000 --- a/scripts/upload_file.sh +++ /dev/null @@ -1,15 +0,0 @@ - -CURL_URL=${DERG_UPLOAD_URL:-https://lucidragons.de/api/admin/upload} -CURL_KEY=${DERG_UPLOAD_KEY:-SoftDragonKeys} - -for FILE_PATH in "$@" -do - if [ -f "${FILE_PATH}" ]; then - POST_PATH="/${FILE_PATH#"./"}" - - echo "Uploading ${FILE_PATH} to ${POST_PATH}" - - curl -i -X POST -H "Content-Type: multipart/form-data" \ - -F "api_key=${CURL_KEY}" -F "post_path=${POST_PATH}" -F "post_data=@${FILE_PATH}" "${CURL_URL}" - fi -done \ No newline at end of file diff --git a/test_entries/about/README.md b/test_entries/about/README.md deleted file mode 100644 index 8fd8ceb..0000000 --- a/test_entries/about/README.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -tags: [what] -directory_data: - type: text/markdown ---- - -# The dergens - -The - -yes \ No newline at end of file diff --git a/test_entries/about/neira/1.png b/test_entries/about/neira/1.png deleted file mode 100644 index 6e5069f..0000000 Binary files a/test_entries/about/neira/1.png and /dev/null differ diff --git a/test_entries/about/neira/1.png.mddesc b/test_entries/about/neira/1.png.mddesc deleted file mode 100644 index b04743e..0000000 --- a/test_entries/about/neira/1.png.mddesc +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: A cuddly image <3 -author: Shaky // Doggonaut ---- - -# Cuddly dragons - -A dear picture made by a dear friend. Shaky - we hope you are OK. \ No newline at end of file diff --git a/test_entries/about/neira/test_me_readme.md b/test_entries/about/neira/test_me_readme.md deleted file mode 100644 index 7b9fd95..0000000 --- a/test_entries/about/neira/test_me_readme.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: A little image test idea ---- - -# README concept - -This file is just to show the README concept - it's its own file but will be -rendered under a directory listing :) - -There's also a test for an image! Let's hope that works: - -![A very cute image :>](1.png) \ No newline at end of file diff --git a/test_entries/test/the/images/1.png b/test_entries/test/the/images/1.png deleted file mode 100644 index 6e5069f..0000000 Binary files a/test_entries/test/the/images/1.png and /dev/null differ diff --git a/test_entries/test/the/images/1.png.mddesc b/test_entries/test/the/images/1.png.mddesc deleted file mode 100644 index b04743e..0000000 --- a/test_entries/test/the/images/1.png.mddesc +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: A cuddly image <3 -author: Shaky // Doggonaut ---- - -# Cuddly dragons - -A dear picture made by a dear friend. Shaky - we hope you are OK. \ No newline at end of file diff --git a/test_entries/test/the/images/README.md b/test_entries/test/the/images/README.md deleted file mode 100644 index 7b9fd95..0000000 --- a/test_entries/test/the/images/README.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: A little image test idea ---- - -# README concept - -This file is just to show the README concept - it's its own file but will be -rendered under a directory listing :) - -There's also a test for an image! Let's hope that works: - -![A very cute image :>](1.png) \ No newline at end of file diff --git a/www/.htaccess b/www/.htaccess index 3ceba7d..094dd6c 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -1,23 +1,6 @@ -AddType text/plain .md - -php_value upload_max_filesize 40M -php_value post_max_size 42M - RewriteEngine On RewriteBase / -RewriteCond %{REQUEST_URI} !^/?(static|raw)/.* +RewriteCond %{REQUEST_URI} !^/?static/.* RewriteRule (.*) router.php - -Allow from all - -Options +Indexes - - - Header set Cache-Control "max-age=315360, public" - - - - Header set Cache-Control "max-age=315360, public" - \ No newline at end of file diff --git a/www/mysql_adapter.php b/www/mysql_adapter.php index 5d5de2f..74b990d 100644 --- a/www/mysql_adapter.php +++ b/www/mysql_adapter.php @@ -1,31 +1,19 @@ raw = mysqli_connect('mysql', 'root', 'example', 'dragon_fire'); - try { - if(false !== getenv('MYSQL_HOST')) { - $this->raw = mysqli_connect(getenv('MYSQL_HOST'), - getenv('MYSQL_USER'), getenv('MYSQL_PASSWORD'), - getenv('MYSQL_DATABASE'), - getenv('MYSQL_PORT')); - } - else { - $this->raw = mysqli_connect($db_params['MYSQL_HOST'], - $db_params['MYSQL_USER'], $db_params['MYSQL_PASSWORD'], - $db_params['MYSQL_DATABASE'], - $db_params['MYSQL_PORT']); - } - } catch (\Throwable $th) { - echo 'Connection failed
'; - echo 'Error number: ' . mysqli_connect_errno() . '
'; - echo 'Error message: ' . mysqli_connect_error() . '
'; - die(); - - //throw $th; + if (!$this->raw) + { + echo 'Connection failed
'; + echo 'Error number: ' . mysqli_connect_errno() . '
'; + echo 'Error message: ' . mysqli_connect_error() . '
'; + die(); } } @@ -37,69 +25,39 @@ class MySQLAdapter { return $stmt->get_result(); } - function _normalize_post_data($post_data) { - if($post_data == null) { - return [ - "found" => false + function _prepare_post_data($post_data) { + if($post_data == null) { + $post_data = [ + "found" => false ]; } + else { + $post_data["found"] = true; + $post_data["post_metadata"] = json_decode($post_data["post_metadata"]); + } - $post_data["found"] = true; - - $post_data['post_metadata'] = json_decode($post_data["post_metadata"], true) ?? []; - $post_data["post_content"] ??= ''; - - return $post_data; + return $post_data; } - function bump_post($post_path, $post_metadata = [], $create_dirs = true) { + function save_markdown_post($post_path, $post_data) { + $frontmatter_post = YamlFrontMatter::parse($post_data); + $post_path = chop($post_path, '/'); $path_depth = substr_count($post_path, "/"); - if($create_dirs) { - $this->make_post_directory(dirname($post_path)); - } + $post_content = $frontmatter_post->body(); + $post_metadata = $frontmatter_post->matter(); + + $post_metadata['type'] = 'text/markdown'; + + var_dump($post_path, $post_content, $post_metadata); $qry = " - INSERT INTO posts - (post_path, post_path_depth, post_metadata, post_content) - VALUES - ( ?, ?, ?, ?) AS new - ON DUPLICATE KEY UPDATE post_path=new.post_path;"; - - $this->_exec($qry, "siss", - $post_path, - $path_depth, - json_encode($post_metadata), - ''); - } - - function make_post_directory($directory) { - $json_metadata = ["type" => 'directory']; - - while(strlen($directory) > 1) { - try { - $this->bump_post($directory, $json_metadata, false); - } - catch(Exception $e) { - } - - $directory = dirname($directory); - } - } - - function update_or_create_post($post_path, $post_metadata, $post_content) { - $post_path = chop($post_path, '/'); - $path_depth = substr_count($post_path, "/"); - - $this->make_post_directory(dirname($post_path)); - - $qry = " - INSERT INTO posts - (post_path, post_path_depth, post_metadata, post_content) - VALUES - ( ?, ?, ?, ?) AS new - ON DUPLICATE KEY UPDATE post_metadata=new.post_metadata, post_content=new.post_content;"; + INSERT INTO posts + (post_path, post_path_depth, post_metadata, post_content) + VALUES + ( ?, ?, ?, ?) AS new + ON DUPLICATE KEY UPDATE post_metadata=new.post_metadata, post_content=new.post_content;"; $this->_exec($qry, "siss", $post_path, @@ -113,8 +71,7 @@ class MySQLAdapter { $post_path = chop($post_path, '/'); - $post_data = $this->_exec($qry, "s", $post_path)->fetch_assoc(); - $post_data = $this->_normalize_post_data($post_data); + $post_data = $this->_prepare_post_data($this->_exec($qry, "s", $post_path)->fetch_assoc()); if($with_subposts) { $post_data['subposts'] = $this->get_subposts_by_path($post_path); @@ -130,7 +87,7 @@ class MySQLAdapter { $path_depth = substr_count($path, "/"); - $qry = "SELECT post_path, post_metadata, post_update_time + $qry = "SELECT post_path, post_metadata FROM posts WHERE (post_path LIKE CONCAT(?,'/%')) AND post_path_depth = ? @@ -140,7 +97,7 @@ class MySQLAdapter { $post_data = $this->_exec($qry, "si", $path, $path_depth+1)->fetch_all(MYSQLI_ASSOC); $fn = function($data) { - return $this->_normalize_post_data($data); + return $this->_prepare_post_data($data); }; $post_data = array_map($fn, $post_data); diff --git a/www/post_adapter.php b/www/post_adapter.php deleted file mode 100644 index ff082ec..0000000 --- a/www/post_adapter.php +++ /dev/null @@ -1,99 +0,0 @@ -data_directory = 'raw'; - } - - function _normalize_post_data($post_data) { - $post_data = parent::_normalize_post_data($post_data); - - $post_data["post_basename"] = basename($post_data["post_path"]); - - $post_meta = $post_data['post_metadata']; - - $post_meta["title"] ??= basename($post_data["post_path"]); - - if(!isset($post_meta['type'])) { - $type = null; - - $ext = pathinfo($post_data['post_basename'], PATHINFO_EXTENSION); - - $ext_mapping = [ - '' => 'directory', - 'md' => 'text/markdown', - 'png' => 'image', - ]; - - if(isset($ext_mapping[$ext])) { - $post_meta['type'] = $ext_mapping[$ext]; - } - } - - $post_data["post_file_dir"] = '/' . $this->data_directory . $post_data["post_path"]; - - $post_data['post_metadata'] = $post_meta; - - return $post_data; - } - - function make_post_directory($directory) { - $data_directory = $this->data_directory . $directory; - - is_dir($data_directory) || mkdir($data_directory, 0777, true); - - parent::make_post_directory($directory); - } - - function save_file($post_path, $file_path) { - $this->bump_post($post_path); - move_uploaded_file($file_path, $this->data_directory . $post_path); - } - - function save_markdown_post($post_path, $post_data) { - $frontmatter_post = YamlFrontMatter::parse($post_data); - $post_path = chop($post_path, '/'); - - $post_content = $frontmatter_post->body(); - $post_metadata = $frontmatter_post->matter(); - - if(basename($post_path) == "README.md") { - $readme_metadata = []; - if(isset($post_metadata['directory_data'])) { - $readme_metadata = $post_metadata['directory_data']; - } - - $this->update_or_create_post(dirname($post_path), - $readme_metadata, $post_content); - } - - $this->update_or_create_post($post_path, $post_metadata, $post_content); - } - - function handle_upload($post_path, $file_path) { - $ext = pathinfo($post_path, PATHINFO_EXTENSION); - - switch($ext) { - case "md": - $this->save_markdown_post($post_path, file_get_contents($file_path)); - - move_uploaded_file($file_path, $this->data_directory . $post_path); - break; - case "mddesc": - $this->save_markdown_post(chop($post_path, '.mddesc'), file_get_contents($file_path)); - break; - default: - $this->save_file($post_path, $file_path); - } - } -} - -?> \ No newline at end of file diff --git a/www/router.php b/www/router.php index 04388c8..faf57d2 100644 --- a/www/router.php +++ b/www/router.php @@ -1,11 +1,11 @@ render('root.html'); -} elseif(preg_match('/^\/api\/admin/', $SURI)) { - header('Content-Type: application/json'); - - $user_api_key = ''; - if(isset($_GET['api_key'])) { - $user_api_key = $_GET['api_key']; - } - if(isset($_POST['api_key'])) { - $user_api_key = $_POST['api_key']; - } - - if($user_api_key != file_get_contents('secrets/api_admin_key')) { - http_response_code(401); - - echo json_encode([ - "authorized" => false - ]); - - die(); - } - - if($SURI = '/api/admin/upload') { - $adapter->handle_upload($_POST['post_path'], $_FILES['post_data']['tmp_name']); - - echo json_encode(["ok" => true]); - } } elseif(preg_match('/^\/api/', $SURI)) { if(preg_match('/^\/api\/posts(.*)$/', $SURI, $match)) { @@ -73,38 +47,34 @@ if($SURI == '/') { header('Content-Type: application/json'); echo json_encode(get_subposts($match[1])); } elseif($SURI == '/api/upload') { + + if(array_key_exists('post_data', $_FILES)) { + $upload_content = file_get_contents($_FILES['post_data']['tmp_name']); + $upload_path = $_POST['post_path']; + + $adapter->save_markdown_post($upload_path, $upload_content); + } echo $twig->render('upload.html'); } -} elseif($_SERVER['HTTP_SEC_FETCH_DEST'] == 'image') { - header('Location: /raw' . $SURI); - exit(0); } elseif(true) { $post = $adapter->get_post_by_path($SURI); - if($post['post_metadata']['type'] == 'directory') { - if(preg_match('/^(.*[^\/])((?:#.*)?)$/', $SURI, $match)) { - header('Location: ' . $match[1] . '/' . $match[2]); - exit(0); - } - - echo $twig->render('post_types/directory.html', [ - "post" => $post, - "subposts" => $post['subposts'] - ]); - } - elseif($post['post_metadata']['type'] == 'text/markdown') { - echo $twig->render('post_types/markdown.html', [ - "post" => $post, - "subposts" => $post['subposts'] - ]); - } - elseif($post['post_metadata']['type'] == 'image') { - echo $twig->render('post_types/image.html', [ - "post" => $post - ]); - } + echo $twig->render('about.html', [ + "post" => $post, + "subposts" => $post['subposts'] + ]); +} elseif(preg_match('/^\/about(.html)?$/', $SURI)) { + echo $twig->render('about.html'); +} elseif(preg_match('/^\/gallery\/([^\?]+)/', $SURI)) { + echo $twig->render('/gallery/gallery_entry.html', [ + 'image_url' => '/static/banner/0.png', + 'image_title' => 'Test!', + 'image_desc' => 'A soft piece made by a dear friend', + 'artist_name' => 'Doggonaut', + 'artist_src_link' => 'https://twitter.com/doggonaut' + ]); } else { echo $twig->render('rrror.html',[ "error_code" => '404 Hoard not found!', diff --git a/www/secrets/.gitignore b/www/secrets/.gitignore deleted file mode 100644 index f573c46..0000000 --- a/www/secrets/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.json -api_admin_key \ No newline at end of file diff --git a/www/secrets/.htaccess b/www/secrets/.htaccess deleted file mode 100644 index 6c5ba68..0000000 --- a/www/secrets/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ - -Deny from all \ No newline at end of file diff --git a/www/static/.htaccess b/www/static/.htaccess index 1c117e2..5997760 100644 --- a/www/static/.htaccess +++ b/www/static/.htaccess @@ -1,7 +1,5 @@ Allow from all -Options +Indexes - Header set Cache-Control "max-age=315360, public" diff --git a/www/static/dergstyle.css b/www/static/dergstyle.css index 810a46c..9bf4f29 100644 --- a/www/static/dergstyle.css +++ b/www/static/dergstyle.css @@ -1,5 +1,4 @@ - * { box-sizing: border-box; margin: 0; @@ -7,44 +6,35 @@ } body { - --bg_1: #0e0a2a; - --bg_2: #2c2943; - --bg_3: #3f4148; - - --highlight_1: #ee9015; - --highlight_2: #edd29e; - - --text_1: #FFFFFF; - - color: var(--text_1); - background: var(--bg_1); + color: #B0B0B0; + background: #201c2a; margin: 0px; position: relative; min-height: 100vh; - padding-bottom: 4rem; + padding-bottom: 4em; } :link { - color: var(--highlight_1); + color: cyan; font-style: italic; text-decoration: none; transition: color 0.2s; } a:visited { - color: var(--highlight_1); + color: cyan; } a:hover { - color: var(--highlight_2); + color: lightblue; } #main_header { overflow: hidden; position: relative; - padding-bottom: 0.7rem; + padding-bottom: 0.7em; } #main_banner_img { position: absolute; @@ -61,9 +51,9 @@ a:hover { #main_banner_img_link { position: absolute; right: 2vw; - bottom: 0.5rem; + bottom: 0.5em; - font-size: 0.8rem; + font-size: 0.8em; } #nav_bar { @@ -72,124 +62,63 @@ a:hover { justify-content: center; list-style-type: none; - margin-top: 1rem; + margin-top: 1em; padding: 0px; } #nav_bar li { - padding: 0rem 0.3rem 0rem 0.3rem; + padding: 0em 0.3em 0em 0.3em; } #big_title { text-align: center; - font-size: 2.5rem; - margin-bottom: 0.2rem; + font-size: 2.5em; + margin-bottom: 0.2em; } #main_header h2 { text-align: center; - font-size: 2rem; - margin-bottom: 0.2rem; + font-size: 2em; + margin-bottom: 0.2em; } #title_separator { height: 1.5px; background-color: #ddd; opacity: 0.5; - margin-left: 2rem; - margin-right: 2rem; + margin-left: 2em; + margin-right: 2em; } #main_content_wrapper { - --content-width: min(100vw, calc(20rem + 40vw)); - --content-total-margin: calc(calc(100vw - var(--content-width)) / 2); - - --content-padding: max(0px, min(1rem, var(--content-total-margin))); - --content-margin: max(0px, calc(var(--content-total-margin) - 1rem)); - - padding: 0rem var(--content-padding) 1rem var(--content-padding); + padding: 3vmin 1em 1em 1em; width: auto; - - - margin-left: var(--content-margin); - margin-right: var(--content-margin); - margin-top: 0px; + margin-left: max(0.75em, min(max(20vmin, 50vw - 30rem), 50vw - 25rem)); + margin-right: max(0.75em, min(max(20vmin, 50vw - 30rem), 50vw - 25rem)); min-height: 100%; - background: var(--bg_2); -} - -#post_file_bar { - position: sticky; - - top: 0px; - - background: var(--bg_2); -} - -#post_file_titles { - display: flex; - flex-direction: row; - justify-content: left; - - list-style-type: none; - padding: 0px; -} - -#post_file_titles * { - padding: 0.5rem; - font-style: bold; - font-size: 1.3rem; - - background: var(--highlight_1); -} - -#post_file_path { - width: 100%; - font-style: italic; - padding-left: 0.5rem; - - background: var(--highlight_1); - - display: flex; - flex-direction: row; - list-style-type: none; -} -#post_file_path a { - color: var(--text_1); - padding-right: 0.2rem; + background: #3e355479; } #main_content_wrapper article { - background: var(--bg_3); - - border-radius: 0rem 0rem 0.8rem 0.8rem; + background: #3e3554; + color: #c6c3c3; + border-radius: 0.3em; box-shadow: 3px 7px 7px 0px #00000040; - padding: 0.75rem; + padding: 0.75em; } #main_content_wrapper article h1 { text-align: left; padding-left: 3vmin; - margin-bottom: 0.2rem; + margin-bottom: 0.2em; border-bottom: solid 1px darkgrey; } -#main_content_wrapper article img { - display: block; - max-width: 100%; - - max-height: 70vh; - - margin: 1vmin; - margin-right: auto; - margin-left: auto; -} - #main_footer { display: flex; - height: 2.5rem; + height: 2.5em; text-align: center; background-color: #3a3a3a; margin: 0px; diff --git a/www/static/directorystyle.css b/www/static/directorystyle.css deleted file mode 100644 index 79a8bfc..0000000 --- a/www/static/directorystyle.css +++ /dev/null @@ -1,43 +0,0 @@ - - -table.directory { - width: 100%; -} - -table.directory caption { - text-align: left; - font-size: 1.5rem; - - padding-left: 3vmin; -} - -table.directory td { - padding: 0.2rem; - text-align: left; -} -table.directory th { - padding: 0.2rem; - text-align: left; - - padding-bottom: 0.05rem; -} - -table.directory tr.entry:hover { - background: rgba(255, 255, 255, 0.1); -} - -table.directory tr.entry .entry_title { - width: 100%; -} - -table.directory .entry_update_time { - display: block; - width: 12rem; -} - -@media only screen and (max-width: 600px) { - table.directory .entry_update_time { - visibility: hidden; - display: none; - } -} \ No newline at end of file diff --git a/www/static/imagestyle.css b/www/static/gallerystyle.css similarity index 58% rename from www/static/imagestyle.css rename to www/static/gallerystyle.css index 149aee6..bb7ba01 100644 --- a/www/static/imagestyle.css +++ b/www/static/gallerystyle.css @@ -1,12 +1,18 @@ -#main_content_wrapper figcaption h1 { +article { + margin-top: 0.8em; + margin-left: 10%; + margin-right: 10%; +} + +figcaption { text-align: center; border-bottom: solid 3px darkgrey; - font-size: 1.8rem; + font-size: 2em; - margin-bottom: 0.3rem; + margin-bottom: 0.3em; } #gallery_image { diff --git a/www/static/rrrorstyle.css b/www/static/rrrorstyle.css index 62c0e69..c9f4de8 100644 --- a/www/static/rrrorstyle.css +++ b/www/static/rrrorstyle.css @@ -1,13 +1,13 @@ #rrr_header { - font-size: 2rem; + font-size: 2em; border-bottom: 1px solid grey; - padding-bottom: 0.2rem; - margin-bottom: 0.3rem; + padding-bottom: 0.2em; + margin-bottom: 0.3em; } #rrr_code { - font-size: 1.5rem; + font-size: 1.5em; } \ No newline at end of file diff --git a/www/templates/about.html b/www/templates/about.html new file mode 100644 index 0000000..2b8619d --- /dev/null +++ b/www/templates/about.html @@ -0,0 +1,25 @@ + + +{% extends "root.html" %} + +{% block second_title %} +

{{ post.post_metadata.title }}

+{% endblock %} + +{%block main_content%} +
+ {{ post['post_content']|markdown_to_html }} +
+ + {% if subposts|length > 0 %} +
+

Related:

+ +
+ {%endif%} + +{%endblock%} diff --git a/www/templates/fragments/filepath_bar.html b/www/templates/fragments/filepath_bar.html deleted file mode 100644 index cff3d04..0000000 --- a/www/templates/fragments/filepath_bar.html +++ /dev/null @@ -1,30 +0,0 @@ -
- -
  • - {{ post.post_metadata.title }} -
  • -
    - - {% set split_post = post.post_path |split('/') %} - {% for i in range(0, split_post|length - 1) %} -
  • - {% if i != 0 %} - > - {% endif %} - {% if i != 0 %} - - {{ split_post[i] }} - - {% else %} - root - {% endif %} -
  • - {% endfor %} - - -
  • - raw - api -
  • -
    -
    \ No newline at end of file diff --git a/www/templates/generic_markdown_post.html b/www/templates/generic_markdown_post.html new file mode 100644 index 0000000..6a0170f --- /dev/null +++ b/www/templates/generic_markdown_post.html @@ -0,0 +1,19 @@ + +{% extends "root.html" %} + +{% block second_title %} +

    Abouts

    +{% endblock %} + +{%block main_content%} +
    + {{ include('about.md')|markdown_to_html }} +
    + + + +{%endblock%} diff --git a/www/templates/index.html b/www/templates/index.html new file mode 100644 index 0000000..50f9c93 --- /dev/null +++ b/www/templates/index.html @@ -0,0 +1,31 @@ + + + + Lucidragons' Fire + + + +

    The dergsite

    +
    + + + +
    + {% block content %}

    Soon there shall be content!

    {% endblock %} +
    + + + + + diff --git a/www/templates/pathed_content.html b/www/templates/pathed_content.html deleted file mode 100644 index df143f4..0000000 --- a/www/templates/pathed_content.html +++ /dev/null @@ -1,18 +0,0 @@ - - -{% extends "root.html" %} - -{% block second_title %} -

    {{ post.post_metadata.title }}

    -{% endblock %} - -{%block main_content%} - - {{ include('fragments/filepath_bar.html') }} - -
    - {%block content_article %} - {%endblock%} -
    - -{%endblock%} diff --git a/www/templates/post_types/directory.html b/www/templates/post_types/directory.html deleted file mode 100644 index 5fa62fc..0000000 --- a/www/templates/post_types/directory.html +++ /dev/null @@ -1,43 +0,0 @@ - - -{% extends "pathed_content.html" %} - -{% block extra_head %} - -{%endblock%} - -{%block content_article%} - {% if subposts|length > 0 %} - - - - - - - - - {% for subpost in subposts %} - - - - - - - {% endfor %} -
    Directory contents:
    NameTitleModified
    - ICN - - {{subpost.post_basename}} - - {{ subpost.post_metadata.title }} - - {{ subpost.post_update_time }} -
    - {%else%} -

    This directory appears to be empty...

    - This shouldn't happen, sorry! - {% endif %} - - {{ post.post_content|markdown_to_html }} - -{%endblock%} diff --git a/www/templates/post_types/image.html b/www/templates/post_types/image.html deleted file mode 100644 index 60ef590..0000000 --- a/www/templates/post_types/image.html +++ /dev/null @@ -1,19 +0,0 @@ - - -{% extends "pathed_content.html" %} - -{% block extra_head %} - -{%endblock%} - -{%block content_article%} -
    - - - - -
    - {{ post.post_content|markdown_to_html }} -
    -
    -{%endblock%} diff --git a/www/templates/post_types/markdown.html b/www/templates/post_types/markdown.html deleted file mode 100644 index d4e79a4..0000000 --- a/www/templates/post_types/markdown.html +++ /dev/null @@ -1,7 +0,0 @@ - - -{% extends "pathed_content.html" %} - -{%block content_article%} - {{ post['post_content']|markdown_to_html }} -{% endblock %} \ No newline at end of file diff --git a/www/templates/upload.html b/www/templates/upload.html index bee8710..6e4ad19 100644 --- a/www/templates/upload.html +++ b/www/templates/upload.html @@ -8,9 +8,8 @@ {%block main_content%}
    -
    + -