From cfc878013dae72147a17db2631106316bc7190ad Mon Sep 17 00:00:00 2001 From: manfromhuh Date: Sat, 2 Jul 2022 12:48:30 -0400 Subject: [PATCH 01/10] Test README.md --- README.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b70f87f --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# simple_blog + +simple_blog is a basic blogging platform. It is designed to be a straightforward way to publish articles written in Markdown and display them using a renderer written in PHP. There is no login page or any way to manage simple_blog from the web. All management is done via the command line. This can be done with a shell script or with the python based [simple_blog_cms](https://20xd6.net/git/20xd6/simple_blog_cms). + +## Requirements + +* Currently tested with PHP 7.4 +* Some shell access is necessary. + * The recommend way is via ssh. + * I don't see a technical reason it can't work with a web manager like cPannel or Ajenti as long has you have the ability to upload files and manage files. + +## Publishing + +## Description + +### blog + +Contains the blog articles. The articles are placed in subdirectories of `by_year` according to the month they were published. + +### common + +This directory contains the files and libraries used to render the site's pages. + +#### Composer files +* composer.json +* composer.lock +* [/common/vendor]() - Stores the composer files and libraries managed via composer. + +#### CSS + +* [styles.css](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 + +#### JS + +* font_size.js +* page_format.js - The main +* gallery.js + +#### PHP + +* [footer.php]() +* [get_month_name.php]() +* [h1_month.php]() +* [header.php]() +* [index.php]() +* [markdown.php]() +* [md_read.php]() +* [menu.php]() +* [modal.php]() +* [page_menu.php]() +* [page_menu_table.php]() +* [path_menu.php]() + +#### /common/error_pages/ + +* /common/403.php +* /common/404.php +* /common/500.php + +#### /common/imgs/ + +Images used site wide. + +* [cursor.gif]() - Blinking cursor used on the front page. +* [icon-rss.png]() - RSS icon + + +#### /common/prisim + +Files for the prism syntax highlighter. + +### license + +This directory contains all the licensing information for simple_blog. simple_blog is licensed under the GPLv2 but uses components that are licensed under the MIT Open Source license. These components are + +#### index.php + +Displays all of the reverent license and the components they apply to. + +* simple_blog is licensed GPLv2. This cannot be changed. +* Default license for articles published. This is [Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/) by default. This licensed can be changed however the site admin wishes. +* [Jmenu](https://github.com/jamesjohnson280/JMenu) is licensed MIT. This cannot be changed. +* [Parsedown](https://github.com/erusev/parsedown) is licensed MIT. This cannot be changed. +* [Parsedown-extra](https://github.com/erusev/parsedown-extra) is licensed MIT. This cannot be changed. + +Copies of all these licenses can be found in the `/license/` directory. \ No newline at end of file From e1ac241f2a75c73f383f14ef206bf267f05c4ed4 Mon Sep 17 00:00:00 2001 From: manfromhuh Date: Tue, 5 Jul 2022 14:18:49 -0400 Subject: [PATCH 02/10] Add Completed README.md --- README.md | 81 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b70f87f..788751f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # simple_blog -simple_blog is a basic blogging platform. It is designed to be a straightforward way to publish articles written in Markdown and display them using a renderer written in PHP. There is no login page or any way to manage simple_blog from the web. All management is done via the command line. This can be done with a shell script or with the python based [simple_blog_cms](https://20xd6.net/git/20xd6/simple_blog_cms). +simple_blog is a basic blogging platform. It is designed to be a straightforward way to publish articles written in Markdown and display them using a renderer written in PHP. There is no login page or any way to manage simple_blog from the web. All management is done via the command line. This can be done with a shell script or with the python based [simple_blog_cms](/git/20xd6/simple_blog_cms). ## Requirements @@ -11,11 +11,54 @@ simple_blog is a basic blogging platform. It is designed to be a straightforward ## Publishing -## Description +Publishing can be done manually or with a script that accomplishes the following tasks. + +1. Create a directory under `/blog/by_year/$CURRENT_YEAR/$CURRENT_MONTH/` + * For a post in January of 2022 this would be `/blog/by_year/2022/01/` + * The directory should start with a numeral otherwise it will be sorted alphabetically +2. Place a file named `article.md` containing the MarkDown formatted text of the article in the directory created in the previous step +3. Copy or symlink `/common/index.php` into the directory created in step 1 +4. Place a file named `tags` containing a comma separated list of tags for the article in the directory created in step 1 +5. Add the article's relative path and title to `/by_tag/tags.csv` under the appropriate headings. + +The recommended method is to use [simple_blog_cms](/git/20xd6/simple_blog_cms "simple_blog_cms") + +## Article Tags + +### Per-article List + +A file named `tags` is placed in the directory for each article. It should contain a comma separated list of tags being applied to the article. This will be parsed and displayed by [`/common/md_read.php`](/git/20xd6/simple_blog/src/branch/master/common/md_read.php) at the bottom of the article. + +### by_tags + +This folder contains an index file that displays an article list generated by parsing the `tags.csv` file. A format example is displayed below. + +| "PHP" | "JS" | "Religion" | "Catholic" | +| ----- | ---- | ---------- | ---------- | +| "/blog/by_year/2021/10/03_Forcing_Elements_to_reload/" | "/blog/by_year/2021/10/03_Forcing_Elements_to_reload/" |"/blog/by_year/2021/10/reproduction_of_Gainer_Bishop_Ronald_4-1-16/" | reproduction_of_Gainer_Bishop_Ronald_4-1-16/" | +| "Forcing page elements to reload" | "Forcing page elements to reload" | "Open Letter to Bishop Ronald Gainer" | "Open Letter to Bishop Ronald Gainer" | +| "/blog/by_year/2022/06/28_A_Test_Post/"| | | +| "A Test Post" | | | + + +## File Descriptions ### blog -Contains the blog articles. The articles are placed in subdirectories of `by_year` according to the month they were published. +Contains the blog articles. The articles are placed in subdirectories of `by_year` according to the year and month they were published. + +``` +├── by_year +│   ├── 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 +``` ### common @@ -36,29 +79,29 @@ This directory contains the files and libraries used to render the site's pages. #### JS * font_size.js -* page_format.js - The main +* [page_format.js]() - The main JS file used for formatting and adding extra functions to pages. * gallery.js #### PHP -* [footer.php]() -* [get_month_name.php]() -* [h1_month.php]() -* [header.php]() -* [index.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 `

` 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. * [markdown.php]() -* [md_read.php]() -* [menu.php]() -* [modal.php]() -* [page_menu.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 `
` 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]() #### /common/error_pages/ -* /common/403.php -* /common/404.php -* /common/500.php +* [/common/403.php]() - The 403 not allowed page. +* [/common/404.php]() - The 404 page. +* [/common/500.php]() - Displayed for all HTTP 500 errors #### /common/imgs/ @@ -74,7 +117,11 @@ Files for the prism syntax highlighter. ### license -This directory contains all the licensing information for simple_blog. simple_blog is licensed under the GPLv2 but uses components that are licensed under the MIT Open Source license. These components are +This directory contains all the licensing information for simple_blog. simple_blog is licensed under the GPLv2 but uses components that are licensed under the MIT Open Source license. These components are: + +* [Jmenu](https://github.com/jamesjohnson280/JMenu) +* [Parsedown](https://github.com/erusev/parsedown) +* [Parsedown-extra](https://github.com/erusev/parsedown-extra) #### index.php From 93514c0e1d3908cc38380c0db378403563d5e836 Mon Sep 17 00:00:00 2001 From: manfromhuh Date: Tue, 5 Jul 2022 14:29:43 -0400 Subject: [PATCH 03/10] Add comments to page_format.js --- common/page_format.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/common/page_format.js b/common/page_format.js index 26b6cec..d36a48f 100644 --- a/common/page_format.js +++ b/common/page_format.js @@ -1,8 +1,10 @@ +// function format_page(){//Set the title of the page based on the main header,

, tag.le != '' )){ if ( document.getElementsByTagName('h1').length !== 0){ document.title = document.getElementsByTagName('h1')[0].innerText; } - //detect if the page contains code blocks to be highlighted and loads the prisim.js and prism.css files to accomplish this. + //Detect if the page contains code blocks to be highlighted and loads the + //prisim.js and prism.css files if codeblocks are found. code_tag = document.getElementsByTagName('code').length; if ( code_tag !== 0 ){ var script = document.createElement('script'); @@ -15,11 +17,14 @@ function format_page(){//Set the title of the page based on the main header,

Date: Tue, 5 Jul 2022 14:32:11 -0400 Subject: [PATCH 04/10] Add comments to get_month_name.php --- common/get_month_name.php | 1 + 1 file changed, 1 insertion(+) diff --git a/common/get_month_name.php b/common/get_month_name.php index eaf67f5..17bbf18 100644 --- a/common/get_month_name.php +++ b/common/get_month_name.php @@ -1,4 +1,5 @@ Date: Tue, 5 Jul 2022 14:33:18 -0400 Subject: [PATCH 05/10] Add comments to h1_month.php --- common/h1_month.php | 1 + 1 file changed, 1 insertion(+) diff --git a/common/h1_month.php b/common/h1_month.php index 2b9e36c..09a9795 100644 --- a/common/h1_month.php +++ b/common/h1_month.php @@ -1,4 +1,5 @@ Date: Tue, 5 Jul 2022 14:36:54 -0400 Subject: [PATCH 06/10] Add comments to header.php This file needs it's Title() function cleaned up. --- common/header.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/header.php b/common/header.php index fae4a98..7b8c202 100644 --- a/common/header.php +++ b/common/header.php @@ -1,7 +1,8 @@ - Date: Tue, 5 Jul 2022 14:40:20 -0400 Subject: [PATCH 07/10] Add comments to index.php --- common/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/index.php b/common/index.php index eb72866..f004ae0 100644 --- a/common/index.php +++ b/common/index.php @@ -1,7 +1,10 @@ Date: Tue, 5 Jul 2022 14:45:16 -0400 Subject: [PATCH 08/10] Add comments to page_menu.php --- common/page_menu.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/common/page_menu.php b/common/page_menu.php index ce207b5..bd5f5c1 100644 --- a/common/page_menu.php +++ b/common/page_menu.php @@ -4,6 +4,7 @@
  • $link_title
  • \n"); + $link_title = ucwords($link_title);//Set the first letter of each word to upercase. + $link_title = get_month_name($link_title);// + $link_title = remove_sorting_number($link_title);//Removes the number used to keep articles in post order from the displayed title. + echo("\n");//Output the result. } } else { From 394e34b7b8f18044ae14fa6dedb52866d5b1196d Mon Sep 17 00:00:00 2001 From: manfromhuh Date: Tue, 5 Jul 2022 15:01:32 -0400 Subject: [PATCH 09/10] Update URL path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 788751f..6880a9d 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ This directory contains the files and libraries used to render the site's pages. #### CSS -* [styles.css](src/branch/master/common/styles.css) - The main site 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 From f1b3eec9d8af19edb810acf0d500f6fd489a1e90 Mon Sep 17 00:00:00 2001 From: manfromhuh Date: Tue, 5 Jul 2022 15:16:48 -0400 Subject: [PATCH 10/10] Readd README.md to resolve merge confilict --- README.md | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6880a9d --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +# simple_blog + +simple_blog is a basic blogging platform. It is designed to be a straightforward way to publish articles written in Markdown and display them using a renderer written in PHP. There is no login page or any way to manage simple_blog from the web. All management is done via the command line. This can be done with a shell script or with the python based [simple_blog_cms](/git/20xd6/simple_blog_cms). + +## Requirements + +* Currently tested with PHP 7.4 +* Some shell access is necessary. + * The recommend way is via ssh. + * I don't see a technical reason it can't work with a web manager like cPannel or Ajenti as long has you have the ability to upload files and manage files. + +## Publishing + +Publishing can be done manually or with a script that accomplishes the following tasks. + +1. Create a directory under `/blog/by_year/$CURRENT_YEAR/$CURRENT_MONTH/` + * For a post in January of 2022 this would be `/blog/by_year/2022/01/` + * The directory should start with a numeral otherwise it will be sorted alphabetically +2. Place a file named `article.md` containing the MarkDown formatted text of the article in the directory created in the previous step +3. Copy or symlink `/common/index.php` into the directory created in step 1 +4. Place a file named `tags` containing a comma separated list of tags for the article in the directory created in step 1 +5. Add the article's relative path and title to `/by_tag/tags.csv` under the appropriate headings. + +The recommended method is to use [simple_blog_cms](/git/20xd6/simple_blog_cms "simple_blog_cms") + +## Article Tags + +### Per-article List + +A file named `tags` is placed in the directory for each article. It should contain a comma separated list of tags being applied to the article. This will be parsed and displayed by [`/common/md_read.php`](/git/20xd6/simple_blog/src/branch/master/common/md_read.php) at the bottom of the article. + +### by_tags + +This folder contains an index file that displays an article list generated by parsing the `tags.csv` file. A format example is displayed below. + +| "PHP" | "JS" | "Religion" | "Catholic" | +| ----- | ---- | ---------- | ---------- | +| "/blog/by_year/2021/10/03_Forcing_Elements_to_reload/" | "/blog/by_year/2021/10/03_Forcing_Elements_to_reload/" |"/blog/by_year/2021/10/reproduction_of_Gainer_Bishop_Ronald_4-1-16/" | reproduction_of_Gainer_Bishop_Ronald_4-1-16/" | +| "Forcing page elements to reload" | "Forcing page elements to reload" | "Open Letter to Bishop Ronald Gainer" | "Open Letter to Bishop Ronald Gainer" | +| "/blog/by_year/2022/06/28_A_Test_Post/"| | | +| "A Test Post" | | | + + +## File Descriptions + +### blog + +Contains the blog articles. The articles are placed in subdirectories of `by_year` according to the year and month they were published. + +``` +├── by_year +│   ├── 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 +``` + +### common + +This directory contains the files and libraries used to render the site's pages. + +#### Composer files +* composer.json +* composer.lock +* [/common/vendor]() - Stores the composer files and libraries managed via composer. + +#### 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 + +#### JS + +* font_size.js +* [page_format.js]() - The main JS file used for formatting and adding extra functions to pages. +* gallery.js + +#### 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 `

    ` 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. +* [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 `
    ` 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]() + +#### /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 + +#### /common/imgs/ + +Images used site wide. + +* [cursor.gif]() - Blinking cursor used on the front page. +* [icon-rss.png]() - RSS icon + + +#### /common/prisim + +Files for the prism syntax highlighter. + +### license + +This directory contains all the licensing information for simple_blog. simple_blog is licensed under the GPLv2 but uses components that are licensed under the MIT Open Source license. These components are: + +* [Jmenu](https://github.com/jamesjohnson280/JMenu) +* [Parsedown](https://github.com/erusev/parsedown) +* [Parsedown-extra](https://github.com/erusev/parsedown-extra) + +#### index.php + +Displays all of the reverent license and the components they apply to. + +* simple_blog is licensed GPLv2. This cannot be changed. +* Default license for articles published. This is [Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/) by default. This licensed can be changed however the site admin wishes. +* [Jmenu](https://github.com/jamesjohnson280/JMenu) is licensed MIT. This cannot be changed. +* [Parsedown](https://github.com/erusev/parsedown) is licensed MIT. This cannot be changed. +* [Parsedown-extra](https://github.com/erusev/parsedown-extra) is licensed MIT. This cannot be changed. + +Copies of all these licenses can be found in the `/license/` directory. \ No newline at end of file