flipped kit to php, built class for basic routing, updated archive template to twig

develop
Are0h 4 years ago
parent 498b52c64d
commit 8e5eaf4e34

2
.gitignore vendored

@ -4,3 +4,5 @@ dist
.cache .cache
.DS_Store .DS_Store
assets assets
vendor
config.codekit3

@ -1,5 +0,0 @@
.babelrc
README.md
*.pug
*.styl

@ -1,17 +0,0 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": true,
"parser": "babel",
"proseWrap": "preserve",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"useTabs": true,
"tabWidth": 4,
"printWidth": 100
}

@ -0,0 +1,5 @@
{
"require": {
"twig/twig": "^3.0"
}
}

254
composer.lock generated

@ -0,0 +1,254 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6a6772df2521c6860a448e9115f2793a",
"packages": [
{
"name": "symfony/polyfill-ctype",
"version": "v1.22.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-01-07T16:49:33+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.22.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
"reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-01-22T09:19:47+00:00"
},
{
"name": "twig/twig",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "1f3b7e2c06cc05d42936a8ad508ff1db7975cdc5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/1f3b7e2c06cc05d42936a8ad508ff1db7975cdc5",
"reference": "1f3b7e2c06cc05d42936a8ad508ff1db7975cdc5",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/phpunit-bridge": "^4.4.9|^5.0.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Twig Team",
"role": "Contributors"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "https://twig.symfony.com",
"keywords": [
"templating"
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.3.0"
},
"funding": [
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
"type": "tidelift"
}
],
"time": "2021-02-08T09:54:36+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.0.0"
}

@ -0,0 +1,219 @@
{
"title": "This is Fipamo",
"welcome_message": "Hey there. So this is a long ass title to see how it breaks",
"keywords": "creative technoglogist, graphic design, web development, designer developer, social thought, political discussion, music producer, creative culture, black creative, black geek",
"description": "The home site of Creative Technologist, music maker, and social philoshoper, Ro. Ha, I know. Me too.",
"base_path": "/src/front/",
"default_bg": "/assets/images/global/default-bg.jpg",
"default_avi": "/assets/images/global/default-avi.png",
"content": "",
"bucket": [{ "item": "one" }, { "item": "two" }, { "item": "three" }],
"tag_list": [
{ "title": "Swaggy Disgust", "slug": "swaggy-disgust", "path": "2020/06" }
],
"meta": {
"who": "Are0h",
"when": "6 hours ago",
"tags": [
{ "label": "star trek discovery", "slug": "star-trek-discovery" },
{ "label": " sonequa martin-green", "slug": "sonequa-martin-green" },
{ "label": " faves", "slug": "faves" },
{ "label": " damn", "slug": "damn" },
{ "label": " sci-fi", "slug": "sci-fi" },
{ "label": " tv", "slug": "tv" }
]
},
"menu": [
{
"title": "This is the first page",
"id": "3",
"slug": "page-one",
"uuid": "b60d6843-e957-43ac-8425-65145142236c"
},
{
"title": "This is the second page",
"id": "4",
"slug": "page-two",
"uuid": "b60d6843-e957-43ac-8425-65145142236d"
},
{
"title": "This is the second page",
"id": "5",
"slug": "page-three",
"uuid": "b60d6843-e957-43ac-8425-65145142236d"
}
],
"recent_posts": [
{
"title": "Teyonah Parris",
"slug": "teyonah-parris",
"feature": "content/blog-images/2018/11/chi-raq.jpg",
"path": "2020/06",
"created": "2018 Nov 11th"
},
{
"title": "Aja Naomi-King",
"slug": "aja-naomi-king",
"feature": "content/blog-images/2018/11/chi-raq.jpg",
"path": "2020/06",
"created": "2018 Nov 11th"
},
{
"title": "Sonequa Martin-Green",
"slug": "sonequa-martin-green",
"feature": "content/blog-images/2018/11/chi-raq.jpg",
"path": "2020/06",
"created": "2018 Nov 11th"
},
{
"title": "Jameela Jamil",
"slug": "jameela-jamil",
"feature": "content/blog-images/2018/11/chi-raq.jpg",
"path": "2020/06",
"created": "2018 Nov 11th"
},
{
"title": "I/'m so behind",
"slug": "im-so-behind",
"feature": "content/blog-images/2018/11/chi-raq.jpg",
"path": "2020/06",
"created": "2018 Nov 11th"
}
],
"featured_posts": [
{
"id": 6,
"uuid": "e322f21e-3317-4795-a7e8-a280c4611406",
"title": "Roberta MF Draper",
"feature": "/assets/images/blog/2020/06/bobbie-draper-the-expanse-1170x585.jpg",
"path": "2020/06",
"layout": "page",
"tags": "faves, damn, the expanse, sci-fi, frankie adams",
"author": "Are0h",
"deleted": false,
"menu": false,
"featured": true,
"published": true,
"slug": "roberta-mf-draper",
"content": "Even Amos doesn/'t want any smoke with Mars/' Finest. She will fuck your whole shit up. Bad. \r\n\r\nRENDER ON SAVE WORKS!\r\n"
},
{
"id": 4,
"uuid": "9051e9df-c723-42c6-bf77-59f5bb8caeac",
"title": "Michael MF Burnam",
"feature": "/assets/images/blog/2020/06/Sonequa-Martin-Green-as-Michael-Burnham-in-Star-Trek-Discovery-season-3.jpg",
"path": "2020/06",
"layout": "page",
"tags": "star trek discovery, sonequa martin-green, faves, damn, sci-fi, tv",
"author": "Are0h",
"deleted": false,
"menu": true,
"featured": true,
"published": true,
"slug": "michael-mf-burnam",
"content": "Yall acting like Michael won/'t give you those hands."
}
],
"archives": [
{
"year": "2020",
"year_data": [
{
"month": "06",
"full_month": "June",
"count": 1,
"pages": [
{
"id": 1,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 1",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
},
{
"id": 2,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 2",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
}
]
},
{
"month": "05",
"full_month": "May",
"count": 1,
"pages": [
{
"id": 1,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 3",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
},
{
"id": 1,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 4",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
}
]
}
]
},
{
"year": "2019",
"year_data": [
{
"month": "04",
"full_month": "April",
"count": 1,
"pages": [
{
"id": 1,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 5",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
},
{
"id": 1,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 6",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
}
]
}
]
},
{
"year": "2018",
"year_data": [
{
"month": "06",
"full_month": "June",
"count": 1,
"pages": [
{
"id": 1,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 7",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
},
{
"id": 1,
"uuid": "29338b67-68d9-4b05-99ac-8d031d27e95c",
"title": "Swaggy Disgust 8",
"slug": "swaggy-disgust",
"content": "My man looks so fed up right now"
}
]
}
]
}
]
}

@ -0,0 +1,45 @@
<?php
require "vendor/autoload.php";
class ThemeEngine
{
public $data = [];
public $loader;
public $twig;
public function __construct()
{
$this->data = json_decode(file_get_contents("./config.json"), true);
$this->loader = new \Twig\Loader\FilesystemLoader("src/themes/");
$this->twig = new \Twig\Environment($this->loader, []);
$this->router($_SERVER["REQUEST_URI"]);
}
public function router(string $request)
{
switch ($request) {
case "/":
echo "this is the index";
break;
case "":
require __DIR__ . "/views/index.php";
break;
case "/archive":
$archive = $this->data["archives"];
echo $this->twig->render(
"theme-fipamo-default/fipamo-default/archive.twig",
[
"title" => "Archive",
"archives" => $archive,
]
);
break;
default:
http_response_code(404);
require __DIR__ . "/views/404.php";
break;
}
}
}
new ThemeEngine();

7683
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,18 +0,0 @@
{
"name": "fipamo-theme-kit",
"version": "1.0.0",
"private": true,
"description": "Theming tool pack for Fipamo",
"repository": "https://code.playvicio.us/Are0h/Fipamo",
"scripts": {
"dev-default-theme": "stylus -w -m -o src/themes/theme-fipamo-default/fipamo-default/assets/css src/themes/theme-fipamo-default/styles/base.styl & parcel watch src/themes/theme-fipamo-default/com/Start.mjs --out-dir src/themes/theme-fipamo-default/fipamo-default/assets/scripts --out-file start.min.js & parcel src/themes/theme-fipamo-default/fipamo-default/*.pug"
},
"engines": {
"node": ">=10.16.0"
},
"devDependencies": {
"parcel": "^1.12.4",
"pug": "^2.0.4",
"stylus": "^0.54.7"
}
}

@ -0,0 +1,36 @@
{% extends "theme-fipamo-default/fipamo-default/frame.twig" %}
{% block title %}
{{ title }}
{% endblock %}
{% block mainContent %}
<section>
<div class="page-title">
<span>{{title}}</span>
</div>
</section>
<article>
<div class="page">
{% for item in archives %}
<div class="archive-item">
<span class="year">
{{item.year}}
</span>
{% for data in item.year_data %}
<div class="archive-month">
<span class="month">
{{data.full_month}}
</span>
{% for page in data.pages %}
<a href="{{ "/"~item.year~"/"~data.month~"/"~page.slug~".html" }}">{{page.title}}</a>
{% endfor %}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</article>
{% endblock %}

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<title>
{% block title %}
{{ title }}
{% endblock %}
</title>
<meta charset="UTF-8" />
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta name="keywords" content="{{ keywords }}") />
<meta name="description" content="{{description}} " />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta property="og:image" content="{{image}}" />
<meta name="twitter:image" content="{{image}}" />
<link rel="stylesheet" type="text/css" href="/assets/css/base.css?=adfafd">
</head>
<body>
<header style="background: url({{ background }}) no-repeat center center; background-size: cover">
<nav>
<div class="left">
<a href="/" class="logo-link">
<img id="logo" src="/assets/image/global/the-logo.svg" />
</a>
</div>
<div class="right">
</div>
</nav>
</header>
<div id="main-content" class="container">
{% block mainContent %}{% endblock %}
</div>
<footer>
<div class="inner">
<a href="/archives">Archives</a><br />
© 2020 By Fipamo
</div>
</footer>
<script src="/assets/scripts/start.min.js" type="text/javascript"></script>
</body>
</html>
Loading…
Cancel
Save