From d90aebe04f9db8233801b358c5074230ada466eb Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Wed, 7 May 2025 23:02:24 +0200 Subject: added web files --- blogarticledate | 3 ++ index.php | 112 +++++++++++++++++++++++++++++++++++++++++ search.php | 93 ++++++++++++++++++++++++++++++++++ sticky.php | 72 ++++++++++++++++++++++++++ style.css | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 434 insertions(+) create mode 100644 index.php create mode 100644 search.php create mode 100644 sticky.php create mode 100644 style.css diff --git a/blogarticledate b/blogarticledate index 845ddcf..888f06a 100755 --- a/blogarticledate +++ b/blogarticledate @@ -1,5 +1,8 @@ #!/bin/sh +# resets blog articles file date to the date indicated +# in the article + postArray=( $(ls *.html) ) for posts in "${postArray[@]}"; do post=$posts diff --git a/index.php b/index.php new file mode 100644 index 0000000..9fdc8f3 --- /dev/null +++ b/index.php @@ -0,0 +1,112 @@ + + + + + + + + + + + + Bloggings + + +
+

Bloggings

+

Blog | Sticky | Search | Français | Git | RSS | Bluesky

+
+

This is my personal minimalist blog. + It has no Javascript, cookies or bloat, it won't track you or sell your soul and can be viewed in any browser. + GDPR notice

+
+ +isDir() && !$dirinfo->isDot()) { + $yeardirs[] = $dirinfo->getFilename(); + } +} +rsort($yeardirs); +// iterate through years +if (is_array($yeardirs)) { + foreach ($yeardirs as $key => $dirname) { + echo "

" . $dirname . "

"; + echo ""; + } +} else { + echo "Not an array"; +} +?> + +

 

+
+

§

+ + + + + + + + + + + + + + + + + + + diff --git a/search.php b/search.php new file mode 100644 index 0000000..72d65c4 --- /dev/null +++ b/search.php @@ -0,0 +1,93 @@ + + + + + + + + + Bloggings + + +
+

Bloggings

+

Blog | Sticky | Search | Français | Git | RSS | Bluesky

+
+
+

Search this blog

+
+ + +
+ + +Results"; + echo 'Search terms: "' . $string . '"'; + echo "

Static Pages

"; + $dir = new RecursiveDirectoryIterator("./sticky"); + echo ""; + echo "

Articles

"; + $dir = new RecursiveDirectoryIterator("./articles"); + echo ""; +} ?> + + +

 

+
+

§

+ + + + + + diff --git a/sticky.php b/sticky.php new file mode 100644 index 0000000..abf6650 --- /dev/null +++ b/sticky.php @@ -0,0 +1,72 @@ + + + + + + + + Bloggings + + +
+

Bloggings

+

Blog | Sticky | Search | Français | Git | RSS | Bluesky

+
+
+

Sticky pages

+ +"; +// iterate through files +$i = 0; +$thisdir = new DirectoryIterator("./sticky"); +foreach ($thisdir as $file) { + if ((!$file->isDot()) && (!$file->isDir())) { + $i++; + $content = file_get_contents($file->getPathname()); + preg_match("/
(.*?)<\/h5>/s", $content, $date); + $filedate = date("Y-m-d"); + + if (isset($date[1]) && strtotime($date[1])) { + $filedate = date("Y-m-d", strtotime($date[1])); + } + + preg_match("/

(.*?)<\/h2>/s", $content, $titre); + $title = "?"; + + if (isset($titre[1])) { + $title = ucfirst($titre[1]); + } + $items[$i][0] = $i; + $items[$i][1] = $file->getPathname(); + $items[$i][2] = $title; + } +} +$values = array_column($items, 2); +array_multisort($values, SORT_ASC, $items); + +$i = 0; +while ($i < count($items)) { + echo "
  • " . + '' . + ucfirst($items[$i][2]) . + "
  • "; + $i++; +} +echo ""; +?> + +

     

    +
    +

    §

    + + diff --git a/style.css b/style.css new file mode 100644 index 0000000..4d7716b --- /dev/null +++ b/style.css @@ -0,0 +1,154 @@ +@font-face { + font-family: 'Ultra'; + src: url('fonts/Ultra-Regular-reduced.ttf') format('truetype'); +} + +body, +html { + height: 100%; + color: #FBF1C7; + margin: 10px; + font-family: monospace; + font-size: 18px; + line-height:1.4; + letter-spacing: 0.6; + background-color: #1D2021; +} +html { + display: table; + margin: auto; + width:100%; + max-width:80ch; +} +body { + display: table-cell; +} +p,li,ul,table,pre,code,div { + max-width: 32em; + max-width: 80ch; + text-align:justify; +} +li {list-style-type: disc;} +h1 { + color: #458588; + font-family: Ultra; + font-size:3em; +} +h2 { + color: #8EC07C; +} +h3{ + color: #cc241d; +} +h4{ + color: #689D6A; + font-size:1.2em; +} +h5, +h6 { + color: #A89984; + font-size: 1em; +} +a { + color: #83A598; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +ul {line-height:2;} +p { +} +strong, +em { + color: #8da29b; + padding-left: 2px; + padding-right: 2px; +} +b {color: #FABD2F;} + +small {color: #8ec07c;} +img { + max-width:100%; +} +blockquote { + border-left:2px solid khaki; + padding-left:20px; + margin-left:0px; +} +blockquote p { + font-style: italic; +} +hr { + height: 0; + border: 0; + border-top: 2px solid #458588; + margin: 1em 0; + padding: 0; +} +table { + border-collapse: collapse; +} +td { + border: 1px solid antiquewhite; + padding: 4px; +} +th { + border: 1px solid antiquewhite; + color: black; + background-color: antiquewhite; + padding: 4px; + text-align: div class="center"; +} +pre { + font-family: monospace; + white-space: pre-wrap; + font-size: 0.8em; + border-left: 1px solid #999999; + padding: 10px; + text-align:left; +} +code { + color: #282828; + font-family: monospace; + background: #928374; + white-space: pre-wrap; + display:block; + padding:4px; + text-align:left; +} +iframe { border: 1px solid #928374;} + +figure { + margin: 0; + margin-top:30px; + background: #8EC07C; + width:400px; + } +figure img { + width:400px; +} +figcaption { + margin-bottom:10px; + padding: 10px; + background: #8EC07C; + color: #fff; + font-size:16px; + width:380px; +} +.center {text-align: center;} +@media only screen and (max-width: 600px) { + body { + padding:2px; + font-size:14px; + margin: 0; + } + ul {padding:0;} + li { + padding:0; + text-align:left; + } + iframe { + max-width:100%; + } +} -- cgit v1.2.3