From bbdacffc7d2e32b2069e6f66aa49458a2ac04f42 Mon Sep 17 00:00:00 2001 From: "Marcel Kapfer (mmk2410)" Date: Tue, 2 Aug 2016 19:51:06 +0200 Subject: [PATCH] Excerpt feature. https://phab.mmk2410.org/T121 Res T121 --- config.yaml | 1 + index.php | 6 +++--- lang/de.php | 1 + lang/en.php | 1 + res/css/rangitaki.css | 2 +- res/css/rangitaki.css.map | 2 +- res/php/ArticleGenerator.php | 33 ++++++++++++++++++++++++++++++--- src/sass/rangitaki.sass | 3 +++ 8 files changed, 41 insertions(+), 8 deletions(-) diff --git a/config.yaml b/config.yaml index 8d97c14..a7f8ce7 100644 --- a/config.yaml +++ b/config.yaml @@ -16,6 +16,7 @@ design: drawer: 'on' theme: material-light pagination: 0 + excerpt: 'off' favicon: 'http://example.com/res/img/favicon.png' rcc: rcc: 'on' diff --git a/index.php b/index.php index 531ce39..b0d7e3e 100644 --- a/index.php +++ b/index.php @@ -318,7 +318,7 @@ if ($config["design"]["drawer"] == "on") { if (strlen($article) >= 3 && substr($article, -3) == ".md") { // generate the article ArticleGenerator::newArticle( - $articlesdir, $article, $getblog + $articlesdir, $article, $getblog, $config["design"]["excerpt"], $BLOGLANG["Read More"] ); } } @@ -336,12 +336,12 @@ if ($config["design"]["drawer"] == "on") { if ($config["design"]["pagination"]) { if ($posts_amount < $pag_max && $posts_amount >= $pag_min) { ArticleGenerator::newArticle( - $articlesdir, $article, $getblog + $articlesdir, $article, $getblog, $config["design"]["excerpt"], $BLOGLANG["Read More"] ); } } else { ArticleGenerator::newArticle( - $articlesdir, $article, $getblog + $articlesdir, $article, $getblog, $config["design"]["excerpt"], $BLOGLANG["Read More"] ); } } diff --git a/lang/de.php b/lang/de.php index fb82593..0e0624b 100644 --- a/lang/de.php +++ b/lang/de.php @@ -8,4 +8,5 @@ $BLOGLANG = [ "Check out" => "Schau dir das an:", "Next Page" => "Nächste Seite", "Previous Page" => "Vorherige Seite", + "Read More" => "Weiterlesen", ]; diff --git a/lang/en.php b/lang/en.php index 0ae409a..c87a8df 100644 --- a/lang/en.php +++ b/lang/en.php @@ -8,4 +8,5 @@ $BLOGLANG = [ "Check out" => "Check out:", "Next Page" => "Next Page", "Previous Page" => "Previous Page", + "Read More" => "Read More", ]; diff --git a/res/css/rangitaki.css b/res/css/rangitaki.css index 58fe6aa..3f92068 100644 --- a/res/css/rangitaki.css +++ b/res/css/rangitaki.css @@ -1,3 +1,3 @@ -body{margin-top:94px}.main{height:100%;margin-left:0}.overlay{opacity:0;position:fixed;top:0;left:0;background-color:black;width:100%;z-index:30;height:100%;display:none}.header{top:0;right:0;left:0;width:100%;height:64px;position:absolute}.title{color:#fff;font-size:23px;text-decoration:none;line-height:64px;vertical-align:middle;left:75px}.title>a{text-decoration:none;color:#fff}.fadeout{position:absolute;height:64px;top:0;right:0;width:40px}.nav-img{height:26px;padding:19px;cursor:pointer}.nav{width:300px;position:fixed;height:100%;top:0;left:-301px;z-index:40}.nav-item,.nav-item-static{text-decoration:none;text-indent:0;display:inline-block;height:48px;vertical-align:middle;width:284px;line-height:48px;padding-left:16px;transition:background-color 125ms ease-in-out 0ms}.nav-close{cursor:pointer}.nav-close-img{height:35px;padding:12px}.nav-item{cursor:pointer}.divider{width:100%}.card{margin-right:auto;margin-left:auto;width:75%;padding:24px;margin-bottom:40px;max-width:1160px}.card a{-moz-hyphens:auto;-epub-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;word-wrap:break-word}.headline{display:block;padding-bottom:8px}.card img{max-width:100%;max-height:400px;display:block;margin-left:auto;margin-right:auto}.author{display:block}.fabmenu{position:fixed;bottom:20px;right:20px}.fab{height:60px;width:60px;border-radius:30px;cursor:pointer}.fab-img{width:28px;padding:15px}.subfab{height:45px;width:45px;border-radius:30px;margin-right:auto;margin-left:auto;margin-bottom:25px;display:none}.subfab-img{width:22px;padding:12px}.pag_buttons{margin-right:auto;margin-left:auto;width:calc(75% + 48px);margin-bottom:80px;max-width:1160px;text-align:right}.button{text-decoration:none;color:#fff;line-height:36px;min-width:64px;text-align:center;height:36px;padding:8px;margin-top:4px;margin-bottom:5px;cursor:pointer}.pag_next{margin-left:8px}.footer a{transition:border-bottom-color 150ms ease-in-out 100ms}.footer a:hover{border-bottom-color:#383838}@media screen and (min-width: 1440px){.nav{left:0;padding-top:64px}.nav-close-img{display:none}.nav-close{display:none}.nav-img{display:none}.header{left:300px}.main{margin-left:300px;width:calc(100% - 300px)}}@media screen and (max-width: 720px){.card{width:82%}.pag_buttons{width:calc(82% + 48px)}} +body{margin-top:94px}.main{height:100%;margin-left:0}.overlay{opacity:0;position:fixed;top:0;left:0;background-color:black;width:100%;z-index:30;height:100%;display:none}.header{top:0;right:0;left:0;width:100%;height:64px;position:absolute}.title{color:#fff;font-size:23px;text-decoration:none;line-height:64px;vertical-align:middle;left:75px}.title>a{text-decoration:none;color:#fff}.fadeout{position:absolute;height:64px;top:0;right:0;width:40px}.nav-img{height:26px;padding:19px;cursor:pointer}.nav{width:300px;position:fixed;height:100%;top:0;left:-301px;z-index:40}.nav-item,.nav-item-static{text-decoration:none;text-indent:0;display:inline-block;height:48px;vertical-align:middle;width:284px;line-height:48px;padding-left:16px;transition:background-color 125ms ease-in-out 0ms}.nav-close{cursor:pointer}.nav-close-img{height:35px;padding:12px}.nav-item{cursor:pointer}.divider{width:100%}.card{margin-right:auto;margin-left:auto;width:75%;padding:24px;margin-bottom:40px;max-width:1160px}.card a{-moz-hyphens:auto;-epub-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;word-wrap:break-word}.headline{display:block;padding-bottom:8px}.card img{max-width:100%;max-height:400px;display:block;margin-left:auto;margin-right:auto}.author{display:block}.readmore{padding:12px 0 25px 0}.fabmenu{position:fixed;bottom:20px;right:20px}.fab{height:60px;width:60px;border-radius:30px;cursor:pointer}.fab-img{width:28px;padding:15px}.subfab{height:45px;width:45px;border-radius:30px;margin-right:auto;margin-left:auto;margin-bottom:25px;display:none}.subfab-img{width:22px;padding:12px}.pag_buttons{margin-right:auto;margin-left:auto;width:calc(75% + 48px);margin-bottom:80px;max-width:1160px;text-align:right}.button{text-decoration:none;color:#fff;line-height:36px;min-width:64px;text-align:center;height:36px;padding:8px;margin-top:4px;margin-bottom:5px;cursor:pointer}.pag_next{margin-left:8px}.footer a{transition:border-bottom-color 150ms ease-in-out 100ms}.footer a:hover{border-bottom-color:#383838}@media screen and (min-width: 1440px){.nav{left:0;padding-top:64px}.nav-close-img{display:none}.nav-close{display:none}.nav-img{display:none}.header{left:300px}.main{margin-left:300px;width:calc(100% - 300px)}}@media screen and (max-width: 720px){.card{width:82%}.pag_buttons{width:calc(82% + 48px)}} /*# sourceMappingURL=rangitaki.css.map */ diff --git a/res/css/rangitaki.css.map b/res/css/rangitaki.css.map index c02a79c..db79c3a 100644 --- a/res/css/rangitaki.css.map +++ b/res/css/rangitaki.css.map @@ -1 +1 @@ -{"version":3,"file":"rangitaki.css","sources":["rangitaki.sass"],"sourcesContent":["/*\n * Rangitaki Project\n *\n * The MIT License\n *\n * Copyright 2015 mmk2410.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * A stylesheet for overriding the default styles if the navigation drawer is disabled\n */\n\n/* BODY */\n\nbody {\n margin-top: 94px; }\n\n.main {\n height: 100%;\n margin-left: 0; }\n\n.overlay {\n opacity: 0;\n position: fixed;\n top: 0;\n left: 0;\n background-color: black;\n width: 100%;\n z-index: 30;\n height: 100%;\n display: none; }\n\n/* HEADER */\n.header {\n top: 0;\n right: 0;\n left: 0;\n width: 100%;\n height: 64px;\n position: absolute; }\n\n.title {\n color: #fff;\n font-size: 23px;\n text-decoration: none;\n line-height: 64px;\n vertical-align: middle;\n left: 75px; }\n\n.title > a {\n text-decoration: none;\n color: #fff; }\n\n.fadeout {\n position: absolute;\n height: 64px;\n top: 0;\n right: 0;\n width: 40px; }\n\n.nav-img {\n height: 26px;\n padding: 19px;\n cursor: pointer; }\n\n/* NAV DRAWER */\n\n.nav {\n width: 300px;\n position: fixed;\n height: 100%;\n top: 0;\n left: -301px;\n z-index: 40; }\n\n.nav-item, .nav-item-static {\n text-decoration: none;\n text-indent: 0;\n display: inline-block;\n height: 48px;\n vertical-align: middle;\n width: 284px;\n line-height: 48px;\n padding-left: 16px;\n transition: background-color 125ms ease-in-out 0ms; }\n\n.nav-close {\n cursor: pointer; }\n\n.nav-close-img {\n height: 35px;\n padding: 12px; }\n\n.nav-item {\n cursor: pointer; }\n\n.divider {\n width: 100%; }\n\n/* MAIN */\n\n.card {\n margin-right: auto;\n margin-left: auto;\n width: 75%;\n padding: 24px;\n margin-bottom: 40px;\n max-width: 1160px; }\n\n.card a {\n -moz-hyphens: auto;\n -epub-hyphens: auto;\n -ms-hyphens: auto;\n -webkit-hyphens: auto;\n hyphens: auto;\n word-wrap: break-word; }\n\n.card a:hover {}\n\n.headline {\n display: block;\n padding-bottom: 8px; }\n\n.card img {\n max-width: 100%;\n max-height: 400px;\n display: block;\n margin-left: auto;\n margin-right: auto; }\n\n.date {}\n\n.articletext {}\n\n.author {\n display: block; }\n\n.tag {}\n\n/* FAB */\n\n.fabmenu {\n position: fixed;\n bottom: 20px;\n right: 20px; }\n\n.fab {\n height: 60px;\n width: 60px;\n border-radius: 30px;\n cursor: pointer; }\n\n.fab-img {\n width: 28px;\n padding: 15px; }\n\n.subfab {\n height: 45px;\n width: 45px;\n border-radius: 30px;\n margin-right: auto;\n margin-left: auto;\n margin-bottom: 25px;\n display: none; }\n\n.subfab-img {\n width: 22px;\n padding: 12px; }\n\n/* BUTTON */\n\n.pag_buttons {\n margin-right: auto;\n margin-left: auto;\n width: calc(75% + 48px);\n margin-bottom: 80px;\n max-width: 1160px;\n text-align: right; }\n\n.button {\n text-decoration: none;\n color: #fff;\n line-height: 36px;\n min-width: 64px;\n text-align: center;\n height: 36px;\n padding: 8px;\n margin-top: 4px;\n margin-bottom: 5px;\n cursor: pointer; }\n\n.pag_next {\n margin-left: 8px; }\n\n/* FOOTER */\n\n.footer {}\n\n.footer a {\n transition: border-bottom-color 150ms ease-in-out 100ms; }\n\n.footer a:hover {\n border-bottom-color: #383838; }\n\n@media screen and (min-width: 1440px) {\n\n .nav {\n left: 0;\n padding-top: 64px; }\n\n .nav-close-img {\n display: none; }\n\n .nav-close {\n display: none; }\n\n .nav-img {\n display: none; }\n\n .header {\n left: 300px; }\n\n .main {\n margin-left: 300px;\n width: calc(100% - 300px); } }\n\n@media screen and (max-width: 720px) {\n\n .card {\n width: 82%; }\n\n .pag_buttons {\n width: calc(82% + 48px); } }\n"],"mappings":"AA8BA,AAAA,IAAI,AAAC,CACD,UAAU,CAAE,IAAK,CAAG,AAExB,AAAA,KAAK,AAAC,CACF,MAAM,CAAE,IAAK,CACb,WAAW,CAAE,CAAE,CAAG,AAEtB,AAAA,QAAQ,AAAC,CACL,OAAO,CAAE,CAAE,CACX,QAAQ,CAAE,KAAM,CAChB,GAAG,CAAE,CAAE,CACP,IAAI,CAAE,CAAE,CACR,gBAAgB,CAAE,KAAM,CACxB,KAAK,CAAE,IAAK,C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CACF,WAAW,CAAE,KAAM,CACnB,KAAK,CAAE,kBAAI,CAAiB,CAEpC,MAAM,CAAN,MAAM,MAAM,SAAS,EAAE,KAAK,EAExB,AAAA,KAAK,AAAC,CACF,KAAK,CAAE,GAAI,CAAG,AAElB,AAAA,YAAY,AAAC,CACT,KAAK,CAAE,gBAAI,CAAe","names":[]} \ No newline at end of file +{"version":3,"file":"rangitaki.css","sources":["rangitaki.sass"],"sourcesContent":["/*\n * Rangitaki Project\n *\n * The MIT License\n *\n * Copyright 2015 mmk2410.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * A stylesheet for overriding the default styles if the navigation drawer is disabled\n */\n\n/* BODY */\n\nbody {\n margin-top: 94px; }\n\n.main {\n height: 100%;\n margin-left: 0; }\n\n.overlay {\n opacity: 0;\n position: fixed;\n top: 0;\n left: 0;\n background-color: black;\n width: 100%;\n z-index: 30;\n height: 100%;\n display: none; }\n\n/* HEADER */\n.header {\n top: 0;\n right: 0;\n left: 0;\n width: 100%;\n height: 64px;\n position: absolute; }\n\n.title {\n color: #fff;\n font-size: 23px;\n text-decoration: none;\n line-height: 64px;\n vertical-align: middle;\n left: 75px; }\n\n.title > a {\n text-decoration: none;\n color: #fff; }\n\n.fadeout {\n position: absolute;\n height: 64px;\n top: 0;\n right: 0;\n width: 40px; }\n\n.nav-img {\n height: 26px;\n padding: 19px;\n cursor: pointer; }\n\n/* NAV DRAWER */\n\n.nav {\n width: 300px;\n position: fixed;\n height: 100%;\n top: 0;\n left: -301px;\n z-index: 40; }\n\n.nav-item, .nav-item-static {\n text-decoration: none;\n text-indent: 0;\n display: inline-block;\n height: 48px;\n vertical-align: middle;\n width: 284px;\n line-height: 48px;\n padding-left: 16px;\n transition: background-color 125ms ease-in-out 0ms; }\n\n.nav-close {\n cursor: pointer; }\n\n.nav-close-img {\n height: 35px;\n padding: 12px; }\n\n.nav-item {\n cursor: pointer; }\n\n.divider {\n width: 100%; }\n\n/* MAIN */\n\n.card {\n margin-right: auto;\n margin-left: auto;\n width: 75%;\n padding: 24px;\n margin-bottom: 40px;\n max-width: 1160px; }\n\n.card a {\n -moz-hyphens: auto;\n -epub-hyphens: auto;\n -ms-hyphens: auto;\n -webkit-hyphens: auto;\n hyphens: auto;\n word-wrap: break-word; }\n\n.card a:hover {}\n\n.headline {\n display: block;\n padding-bottom: 8px; }\n\n.card img {\n max-width: 100%;\n max-height: 400px;\n display: block;\n margin-left: auto;\n margin-right: auto; }\n\n.date {}\n\n.articletext {}\n\n.author {\n display: block; }\n\n.tag {}\n\n.readmore {\n padding: 12px 0 25px 0; }\n\n/* FAB */\n\n.fabmenu {\n position: fixed;\n bottom: 20px;\n right: 20px; }\n\n.fab {\n height: 60px;\n width: 60px;\n border-radius: 30px;\n cursor: pointer; }\n\n.fab-img {\n width: 28px;\n padding: 15px; }\n\n.subfab {\n height: 45px;\n width: 45px;\n border-radius: 30px;\n margin-right: auto;\n margin-left: auto;\n margin-bottom: 25px;\n display: none; }\n\n.subfab-img {\n width: 22px;\n padding: 12px; }\n\n/* BUTTON */\n\n.pag_buttons {\n margin-right: auto;\n margin-left: auto;\n width: calc(75% + 48px);\n margin-bottom: 80px;\n max-width: 1160px;\n text-align: right; }\n\n.button {\n text-decoration: none;\n color: #fff;\n line-height: 36px;\n min-width: 64px;\n text-align: center;\n height: 36px;\n padding: 8px;\n margin-top: 4px;\n margin-bottom: 5px;\n cursor: pointer; }\n\n.pag_next {\n margin-left: 8px; }\n\n/* FOOTER */\n\n.footer {}\n\n.footer a {\n transition: border-bottom-color 150ms ease-in-out 100ms; }\n\n.footer a:hover {\n border-bottom-color: #383838; }\n\n@media screen and (min-width: 1440px) {\n\n .nav {\n left: 0;\n padding-top: 64px; }\n\n .nav-close-img {\n display: none; }\n\n .nav-close {\n display: none; }\n\n .nav-img {\n display: none; }\n\n .header {\n left: 300px; }\n\n .main {\n margin-left: 300px;\n width: calc(100% - 300px); } }\n\n@media screen and (max-width: 720px) {\n\n .card {\n width: 82%; }\n\n .pag_buttons {\n width: calc(82% + 48px); } }\n"],"mappings":"AA8BA,AAAA,IAAI,AAAC,CACD,UAAU,CAAE,IAAK,CAAG,AAExB,AAAA,KAAK,AAAC,CACF,MAAM,CAAE,IAAK,CACb,WAAW,CAAE,CAAE,CAAG,AAEtB,AAAA,QAAQ,AAAC,CACL,OAAO,CAAE,CAAE,CACX,QAAQ,CAAE,KAAM,CAChB,GAAG,CAAE,CAAE,CACP,IAAI,CAAE,CAAE,CACR,gBAAgB,CAAE,KAAM,CACxB,KAAK,CAAE,IAAK,CACZ,OAAO,CAAE,EAAG,CACZ,MAAM,CAAE,IAAK,CACb,OAAO,CAAE,IAAK,CAAG,AAGrB,AAAA,OAAO,AAAC,CACJ,GAAG,CAAE,CAAE,CACP,KAAK,CAAE,CAAE,CACT,IAAI,CAAE,CAAE,CACR,KAAK,CAAE,IAAK,CACZ,MAAM,CAAE,IAAK,CACb,QAAQ,CAAE,QAAS,CAAG,AAE1B,AAAA,MAAM,AAAC,CACH,KAAK,CAAE,IAA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ArticleGenerator.php b/res/php/ArticleGenerator.php index e66f259..6d48b99 100644 --- a/res/php/ArticleGenerator.php +++ b/res/php/ArticleGenerator.php @@ -59,7 +59,7 @@ class ArticleGenerator * * @return Null */ - function newArticle($directory, $articlefile, $blog) + function newArticle($directory, $articlefile, $blog, $excerpt, $readmore) { $article = file_get_contents($directory . $articlefile); // get the file @@ -96,12 +96,39 @@ class ArticleGenerator echo "
"; + // print only a excerpt of the post + // with at least 200 characters if possible. + if ( $excerpt == 'on' ) { + $emptyline = strpos($article, "\n\n"); + if ( $emptyline !== false ) { + if ( $emptyline < 200) { + $emptyline2 = strpos($article, "\n\n", $emptyline); + if ( $emptyline2 !== false ) { + $article = substr($article, 0, $emptyline2); + } else { + $article = substr($article, 0, $emptyline); + } + } else { + $article = substr($article, 0, $emptyline); + } + } else { + // correct $excerpt for use in line 127. + $excerpt = 'off'; + } + } + echo Parsedown::instance() ->setBreaksEnabled(true) ->text($article); // print now the article text as html echo "
"; + + if ( $excerpt == 'on' ) { + echo "
$readmore
"; + } + + if (isset($author)) { echo "$author"; // print the author } @@ -198,9 +225,9 @@ class ArticleGenerator { $text = ArticleGenerator::getText($directory, $articlefile); - $pos = stripos($text, "."); + $pos = stripos($text, "\n\n"); - if ($pos) { + if ($pos !== false) { $offset = $pos; $pos = stripos($text, ".", $offset); $summary = substr($text, 0, $pos) . "."; diff --git a/src/sass/rangitaki.sass b/src/sass/rangitaki.sass index 030aa3f..5accff0 100644 --- a/src/sass/rangitaki.sass +++ b/src/sass/rangitaki.sass @@ -153,6 +153,9 @@ body .tag +.readmore + padding: 12px 0 25px 0 + /* FAB */ .fabmenu