Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa921bcf39 | |||
| c312dbf995 | |||
| b91d699261 | |||
| 858d880837 | |||
| a06e7dabeb | |||
| e624e7c287 | |||
| b4ffc0b9f8 | |||
| b40b877a3f | |||
| 7734de9fa4 | |||
| 470773721a | |||
| 5d7b4cc121 | |||
| efe61157e8 | |||
| 5016fa8ce8 | |||
| 206f94f5db | |||
| 8da50f2841 | |||
| 7ff2cf1d0f | |||
| f80bc8dafa | |||
| 32f7d23ee4 | |||
| d2861f1203 |
74
README.md
74
README.md
@@ -40,6 +40,11 @@ This folder contains an index file that displays an article list generated by pa
|
||||
| "/blog/by_year/2022/06/28_A_Test_Post/"| | |
|
||||
| "A Test Post" | | |
|
||||
|
||||
## Authors
|
||||
|
||||
Post authors can be kept under `/blog/authors/`. Authors are kept in separate directories.
|
||||
|
||||
The authors directory is parsed by [`article.php`](/git/20xd6/simple_blog/src/commit/7734de9fa483257a90a658b74b78b47e4de716e2/common/php/article.php#L25) using a file named `author` from the post's directory. This file should contain a single line with the author's name.
|
||||
|
||||
## File Descriptions
|
||||
|
||||
@@ -49,14 +54,14 @@ Contains the blog articles. The articles are placed in subdirectories of `by_yea
|
||||
|
||||
```
|
||||
├── by_year
|
||||
│  ├── 2021
|
||||
│  │  ├── 12
|
||||
│  │  └── index.php -> /path/to/common/index.php
|
||||
│  ├── 2022
|
||||
│  │  ├── 01
|
||||
│  │  ├── 02
|
||||
│  │  └── index.php -> /path/to/common/index.php
|
||||
│  └── index.php
|
||||
│ ├── 2021
|
||||
│ │ ├── 12
|
||||
│ │ └── index.php -> /path/to/common/index.php
|
||||
│ ├── 2022
|
||||
│ │ ├── 01
|
||||
│ │ ├── 02
|
||||
│ │ └── index.php -> /path/to/common/index.php
|
||||
│ └── index.php
|
||||
└── index.php -> /path/to/common/index.php
|
||||
```
|
||||
|
||||
@@ -69,49 +74,44 @@ This directory contains the files and libraries used to render the site's pages.
|
||||
* composer.lock
|
||||
* [/common/vendor]() - Stores the composer files and libraries managed via composer.
|
||||
|
||||
#### CSS
|
||||
#### [CSS](/git/20xd6/simple_blog/src/branch/master/common/css)
|
||||
|
||||
* [styles.css](/git/20xd6/simple_blog/src/branch/master/common/styles.css) - The main site CSS.
|
||||
* [jmenu.css]() - Used to render the responsive menus.
|
||||
* [print.css]() - Used to style printed pages.
|
||||
* [gallery.css]() - Styles the floating
|
||||
* [styles.css](/git/20xd6/simple_blog/src/branch/master/common/css/styles.css) - The main site CSS.
|
||||
* [jmenu.css](/git/20xd6/simple_blog/src/branch/master/common/css/jmenu.css) - Used to render the responsive menus.
|
||||
* [print.css](/git/20xd6/simple_blog/src/branch/master/common/css/print.css) - Used to style printed pages.
|
||||
|
||||
#### JS
|
||||
#### [JS](/git/20xd6/simple_blog/src/branch/master/common/js)
|
||||
|
||||
* font_size.js
|
||||
* [page_format.js]() - The main JS file used for formatting and adding extra functions to pages.
|
||||
* gallery.js
|
||||
* [page_format.js](/git/20xd6/simple_blog/src/branch/master/common/js/page_format.js) - The main JS file used for formatting and adding extra functions to pages.
|
||||
|
||||
#### PHP
|
||||
#### [PHP](/git/20xd6/simple_blog/src/branch/master/common/php)
|
||||
|
||||
* [footer.php]() - The common page footer. Contains copyright information and links to the license.
|
||||
* [get_month_name.php]() - Translates a numeral month into the corresponding name. I.E. 01 into January.
|
||||
* [h1_month.php]() - Adds the proper `<h1>` heading based on the location of the
|
||||
* [header.php]() - The common page header.
|
||||
* [index.php]() - The index file used for most of the pages on the site.
|
||||
* [footer.php](/git/20xd6/simple_blog/src/branch/master/common/php/footer.php) - The common page footer. Contains copyright information and links to the license.
|
||||
* [get_month_name.php](/git/20xd6/simple_blog/src/branch/master/common/php/get_month_name.php) - Translates a numeral month into the corresponding name. I.E. 01 into January.
|
||||
* [h1_month.php](/git/20xd6/simple_blog/src/branch/master/common/php/h1_month.php) - Adds the proper `<h1>` heading based on the location of the
|
||||
* [header.php](/git/20xd6/simple_blog/src/branch/master/common/php/header.php) - The common page header.
|
||||
* [index.php](/git/20xd6/simple_blog/src/branch/master/common/php/index.php) - The index file used for most of the pages on the site.
|
||||
* [markdown.php]()
|
||||
* [md_read.php]() - Renders Markdown files and adds
|
||||
* [menu.php]() - Generates the blog menu items in the navigation menu.
|
||||
* [modal.php]() - Adds the modal `<div>` for displaying the image pop out.
|
||||
* [page_menu.php]() - Generates a menu from the files and directories where it's run from.
|
||||
* [page_menu_table.php]()
|
||||
* [path_menu.php]()
|
||||
* [md_read.php](/git/20xd6/simple_blog/src/branch/master/common/php/md_read.php) - Renders Markdown files and adds
|
||||
* [menu.php](/git/20xd6/simple_blog/src/branch/master/common/php/menu.php) - Generates the blog menu items in the navigation menu.
|
||||
* [modal.php](/git/20xd6/simple_blog/src/branch/master/common/php/modal.php) - Adds the modal `<div>` for displaying the image pop out.
|
||||
* [page_menu.php](/git/20xd6/simple_blog/src/branch/master/common/php/page_menu.php) - Generates a menu from the files and directories where it's run from.
|
||||
|
||||
#### /common/error_pages/
|
||||
#### [/common/error_pages/](/git/20xd6/simple_blog/src/branch/master/common/error_pages)
|
||||
|
||||
* [/common/403.php]() - The 403 not allowed page.
|
||||
* [/common/404.php]() - The 404 page.
|
||||
* [/common/500.php]() - Displayed for all HTTP 500 errors
|
||||
* [403.php](/git/20xd6/simple_blog/src/branch/master/common/error_pages/403.php) - The 403 not allowed page.
|
||||
* [404.php](/git/20xd6/simple_blog/src/branch/master/common/error_pages/404.php) - The 404 page.
|
||||
* [500.php](/git/20xd6/simple_blog/src/branch/master/common/error_pages/500.php) - Displayed for all HTTP 500 errors
|
||||
|
||||
#### /common/imgs/
|
||||
#### [/common/imgs/](/git/20xd6/simple_blog/src/branch/master/common/imgs)
|
||||
|
||||
Images used site wide.
|
||||
|
||||
* [cursor.gif]() - Blinking cursor used on the front page.
|
||||
* [icon-rss.png]() - RSS icon
|
||||
* [cursor.gif](/git/20xd6/simple_blog/src/branch/master/common/imgs/cursor.gif) - Blinking cursor used on the front page.
|
||||
* [icon-rss.png](/git/20xd6/simple_blog/src/branch/master/common/imgs/icon-rss.png) - RSS icon
|
||||
|
||||
|
||||
#### /common/prisim
|
||||
#### [/common/prisim](/git/20xd6/simple_blog/src/branch/master/common/prisim)
|
||||
|
||||
Files for the prism syntax highlighter.
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
echo "<article><h1 id=\"page_title\">Posts by Tag</h1></article>";
|
||||
echo "<div id=\"search_inputs\"><input type=\"text\" id=\"tag_sort\" onkeyup=\"tag_search()\" placeholder=\"Search Tags...\" title=\"Type a tage to search\"><input id=\"search_toggle\" type=\"button\" value=\"Search Titles\" onclick=\"search_toggle()\"></div><!--End Div Search Inputs-->";
|
||||
function read_tags($tags_file){
|
||||
if (filesize($tags_file) == 0){
|
||||
echo "<br/>\n<br/>";
|
||||
return;
|
||||
}
|
||||
$tags_csv = array_map('str_getcsv', file('tags.csv'));
|
||||
$tags_rows = sizeof($tags_csv);
|
||||
$tags_coloums = sizeof($tags_csv[0]);
|
||||
@@ -49,6 +53,8 @@
|
||||
$empty_csv = fopen("tags.csv", "w") or die("Cannot write new tags.csv file.");
|
||||
fwrite($empty_csv, "");
|
||||
fclose($empty_csv);
|
||||
chmod('./tags.csv', 0666);
|
||||
read_tags('tags.csv');
|
||||
}
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
|
||||
@@ -22,20 +22,17 @@
|
||||
|
||||
echo "\n</div><!--End of print-content div-->\n";
|
||||
echo("<nav class=\"jmenu\"><div class=\"pmenu\"><ul id=\"back_btn\"><li><a href='..'>Back</a></li></ul></div></nav>\n");
|
||||
if (file_exists('author')){
|
||||
$author_name_raw = fopen('author', 'r');
|
||||
$author_name = fread($author_name_raw, filesize('author'));
|
||||
$author_name = str_replace("\n", "", $author_name);
|
||||
$byline_path = $_SERVER['DOCUMENT_ROOT'].'blog/authors/'.$author_name.'/byline.md';
|
||||
if (file_exists($byline_path)){
|
||||
echo "<div class =\"byline\">\n"
|
||||
. read_md($byline_path)
|
||||
."</div><!--End byline div-->\n";
|
||||
} else {
|
||||
echo "<h2>No byline</h2>";
|
||||
echo "<p>$byline_path</p>";
|
||||
}
|
||||
fclose($author_name_raw);
|
||||
if (file_exists('author') && (filesize('author') != 0)){
|
||||
$author_name_raw = fopen('author', 'r');
|
||||
$author_name = fread($author_name_raw, filesize('author'));
|
||||
$author_name = str_replace("\n", "", $author_name);
|
||||
$byline_path = $_SERVER['DOCUMENT_ROOT'].'blog/authors/'.$author_name.'/byline.md';
|
||||
if (file_exists($byline_path)){
|
||||
echo "<div class =\"byline\">\n"
|
||||
. read_md($byline_path)
|
||||
."</div><!--End byline div-->\n";
|
||||
}
|
||||
fclose($author_name_raw);
|
||||
}
|
||||
if ($tag_data != NULL){
|
||||
$page_tags = str_getcsv($tag_data);
|
||||
|
||||
@@ -2,20 +2,11 @@
|
||||
<html lang="en-US">
|
||||
<?php
|
||||
//Sets the page title based on the name of the current directory
|
||||
function Title() {//Needs cleanup.
|
||||
//~ $new_title = $_SERVER['REQUEST_URI'];
|
||||
|
||||
//~ $new_title = preg_replace("/^^\//i", "", $new_title);
|
||||
//~ $new_title = preg_replace("/\//i", "", $new_title);
|
||||
//~ $page_title = $_SERVER['REQUEST_URI'];
|
||||
//~ $page_title = preg_replace("/^(.*)\//i", "", $page_title);
|
||||
function Title() {
|
||||
$page_title = basename($_SERVER['SCRIPT_FILENAME'], '.php');
|
||||
//~ echo($page_title);
|
||||
if(strtolower($page_title) == 'index'){
|
||||
parse_str($_SERVER['REQUEST_URI'], $page_uri);
|
||||
$page_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
//~ echo($page_path);
|
||||
//~ $folder_name = sizeof($page_path);
|
||||
$folder_name = explode("/", trim($page_path, "/"));
|
||||
$page_title = $folder_name[(sizeof($folder_name) - 1)];
|
||||
} elseif(strtolower($page_title) == 'homepage'){
|
||||
|
||||
Reference in New Issue
Block a user