converted page template to twig, plugged nav, streamlined render class
This commit is contained in:
parent
30c0ff72cf
commit
d92d888fca
6 changed files with 101 additions and 314 deletions
11
config.json
11
config.json
|
@ -6,7 +6,7 @@
|
|||
"base_path": "/src/front/",
|
||||
"default_bg": "/assets/images/global/default-bg.jpg",
|
||||
"default_avi": "/assets/images/global/default-avi.png",
|
||||
"content": "This is some content, yo",
|
||||
"content": "<img src='/assets/images/global/default-avi.png'><br>The path of the <a href='#'>righteous</a> man is beset on ALL sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. <code>And I will strike down upon thee with great vengeance</code> and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.<pre><code>server\n { listen 80; server_name yourcoolassdomain.com; \n\tlocation / \n\t\t{ \n\t\t\tproxy_pass https://127.0.0.1:2314; \n\t\t\tproxy_http_version 1.1; \n\t\t\tproxy_set_header \n\t\t\tUpgrade $http_upgrade; \n\t\t\tproxy_set_header Connection 'upgrade'; \n\t\t\tproxy_set_header Host $host; \n\t\t\tproxy_cache_bypass $http_upgrade; \n\t\t} \n\t} </code></pre>",
|
||||
"bucket": [{ "item": "one" }, { "item": "two" }, { "item": "three" }],
|
||||
"tag_list": [
|
||||
{ "title": "Swaggy Disgust", "slug": "swaggy-disgust", "path": "2020/06" }
|
||||
|
@ -28,19 +28,22 @@
|
|||
"title": "This is the first page",
|
||||
"id": "3",
|
||||
"slug": "page-one",
|
||||
"uuid": "b60d6843-e957-43ac-8425-65145142236c"
|
||||
"uuid": "b60d6843-e957-43ac-8425-65145142236c",
|
||||
"path": "2021/04"
|
||||
},
|
||||
{
|
||||
"title": "This is the second page",
|
||||
"id": "4",
|
||||
"slug": "page-two",
|
||||
"uuid": "b60d6843-e957-43ac-8425-65145142236d"
|
||||
"uuid": "b60d6843-e957-43ac-8425-65145142236d",
|
||||
"path": "2021/04"
|
||||
},
|
||||
{
|
||||
"title": "This is the second page",
|
||||
"id": "5",
|
||||
"slug": "page-three",
|
||||
"uuid": "b60d6843-e957-43ac-8425-65145142236d"
|
||||
"uuid": "b60d6843-e957-43ac-8425-65145142236d",
|
||||
"path": "2021/04"
|
||||
}
|
||||
],
|
||||
"recent_posts": [
|
||||
|
|
89
index.php
89
index.php
|
@ -17,52 +17,79 @@ class ThemeEngine
|
|||
|
||||
public function router(string $request)
|
||||
{
|
||||
$pageInfo = [
|
||||
"keywords" => $this->data["keywords"],
|
||||
"description" => $this->data["description"],
|
||||
"image" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
];
|
||||
|
||||
$menu = $this->data["menu"];
|
||||
switch ($request) {
|
||||
case "/":
|
||||
$recent = $this->data["recent_posts"];
|
||||
$featured = $this->data["featured_posts"];
|
||||
echo $this->twig->render(
|
||||
"theme-fipamo-default/fipamo-default/index.twig",
|
||||
[
|
||||
"debug" => true,
|
||||
"title" => "This is Fipamo",
|
||||
"background" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
"recent" => $recent,
|
||||
"featured" => $featured,
|
||||
]
|
||||
);
|
||||
$template = "theme-fipamo-default/fipamo-default/index.twig";
|
||||
|
||||
$pageOptions = [
|
||||
"debug" => true,
|
||||
"title" => "This is Fipamo",
|
||||
"background" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
"recent" => $recent,
|
||||
"featured" => $featured,
|
||||
"info" => $pageInfo,
|
||||
"menu" => $menu,
|
||||
];
|
||||
break;
|
||||
case "/page":
|
||||
$content = $this->data["content"];
|
||||
$meta = $this->data["meta"];
|
||||
$template = "theme-fipamo-default/fipamo-default/page.twig";
|
||||
$pageOptions = [
|
||||
"debug" => true,
|
||||
"title" => "Page Title",
|
||||
"background" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
"content" => $content,
|
||||
"meta" => $meta,
|
||||
"info" => $pageInfo,
|
||||
"menu" => $menu,
|
||||
];
|
||||
break;
|
||||
case "/tags":
|
||||
$tags = $this->data["tag_list"];
|
||||
echo $this->twig->render(
|
||||
"theme-fipamo-default/fipamo-default/tags.twig",
|
||||
[
|
||||
"debug" => true,
|
||||
"title" => "Pages Tagged as Tag",
|
||||
"background" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
"tag_list" => $tags,
|
||||
]
|
||||
);
|
||||
$template = "theme-fipamo-default/fipamo-default/tags.twig";
|
||||
$pageOptions = [
|
||||
"debug" => true,
|
||||
"title" => "Pages Tagged as Tag",
|
||||
"background" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
"tag_list" => $tags,
|
||||
"info" => $pageInfo,
|
||||
"menu" => $menu,
|
||||
];
|
||||
break;
|
||||
case "/archive":
|
||||
$archive = $this->data["archives"];
|
||||
echo $this->twig->render(
|
||||
"theme-fipamo-default/fipamo-default/archive.twig",
|
||||
[
|
||||
"debug" => true,
|
||||
"title" => "Archive",
|
||||
"background" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
"archives" => $archive,
|
||||
]
|
||||
);
|
||||
$template = "theme-fipamo-default/fipamo-default/archive.twig";
|
||||
$pageOptions = [
|
||||
"debug" => true,
|
||||
"title" => "Archive",
|
||||
"background" =>
|
||||
"/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg",
|
||||
"archives" => $archive,
|
||||
"info" => $pageInfo,
|
||||
"menu" => $menu,
|
||||
];
|
||||
break;
|
||||
default:
|
||||
http_response_code(404);
|
||||
require __DIR__ . "/views/404.php";
|
||||
break;
|
||||
}
|
||||
|
||||
echo $this->twig->render($template, $pageOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
246
pug.config.js
246
pug.config.js
|
@ -1,246 +0,0 @@
|
|||
module.exports = {
|
||||
locals: {
|
||||
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:
|
||||
"<img src='/assets/images/global/default-avi.png'><br>The path of the <a href='#'>righteous</a> man is beset on ALL sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. <code>And I will strike down upon thee with great vengeance</code> and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee." +
|
||||
'<pre><code>' +
|
||||
"server { listen 80; server_name yourcoolassdomain.com; location / { proxy_pass https://127.0.0.1:2314; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } </code></pre>",
|
||||
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: [
|
||||
{
|
||||
metadata: {
|
||||
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"
|
||||
},
|
||||
{
|
||||
metadata: {
|
||||
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: [
|
||||
{
|
||||
metadata: {
|
||||
id: 1,
|
||||
uuid: '29338b67-68d9-4b05-99ac-8d031d27e95c',
|
||||
title: 'Swaggy Disgust 1',
|
||||
slug: 'swaggy-disgust'
|
||||
},
|
||||
content: 'My man looks so fed up right now'
|
||||
},
|
||||
{
|
||||
metadata: {
|
||||
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: [
|
||||
{
|
||||
metadata: {
|
||||
id: 1,
|
||||
uuid: '29338b67-68d9-4b05-99ac-8d031d27e95c',
|
||||
title: 'Swaggy Disgust 3',
|
||||
slug: 'swaggy-disgust'
|
||||
},
|
||||
content: 'My man looks so fed up right now'
|
||||
},
|
||||
{
|
||||
metadata: {
|
||||
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: [
|
||||
{
|
||||
metadata: {
|
||||
id: 1,
|
||||
uuid: '29338b67-68d9-4b05-99ac-8d031d27e95c',
|
||||
title: 'Swaggy Disgust 5',
|
||||
slug: 'swaggy-disgust'
|
||||
},
|
||||
content: 'My man looks so fed up right now'
|
||||
},
|
||||
{
|
||||
metadata: {
|
||||
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: [
|
||||
{
|
||||
metadata: {
|
||||
id: 1,
|
||||
uuid: '29338b67-68d9-4b05-99ac-8d031d27e95c',
|
||||
title: 'Swaggy Disgust 7',
|
||||
slug: 'swaggy-disgust'
|
||||
},
|
||||
content: 'My man looks so fed up right now'
|
||||
},
|
||||
{
|
||||
metadata: {
|
||||
id: 1,
|
||||
uuid: '29338b67-68d9-4b05-99ac-8d031d27e95c',
|
||||
title: 'Swaggy Disgust 8',
|
||||
slug: 'swaggy-disgust'
|
||||
},
|
||||
content: 'My man looks so fed up right now'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
|
@ -15,23 +15,30 @@
|
|||
</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 name="keywords" content="{{ info['keywords'] }}") />
|
||||
<meta name="description" content="{{info['description']}} " />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta property="og:image" content="{{image}}" />
|
||||
<meta name="twitter:image" content="{{image}}" />
|
||||
<meta property="og:image" content="{{info[image]}}" />
|
||||
<meta name="twitter:image" content="{{info[image]}}" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ assetPath~"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="{{ assetPath~"/images/global/the-logo.svg" }}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
</div>
|
||||
{% apply spaceless %}
|
||||
<div class="left">
|
||||
<a href="/" class="logo-link">
|
||||
<img id="logo" src="{{ assetPath~"/images/global/the-logo.svg" }}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
{% if menu is defined %}
|
||||
{% for link in menu %}
|
||||
<a href="{{"/"~link.path~"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br />
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endapply %}
|
||||
</nav>
|
||||
</header>
|
||||
<div id="main-content" class="container">
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
extends frame
|
||||
|
||||
block main-content
|
||||
section
|
||||
.page-title
|
||||
span= title
|
||||
article
|
||||
.page
|
||||
p !{content}
|
||||
.meta
|
||||
| !{meta.who}
|
||||
|
||||
| dropped this
|
||||
|
||||
| !{meta.when}
|
||||
br
|
||||
|
||||
| tags:
|
||||
- var i = 0;
|
||||
- for (i; i < meta.tags.length; i++)
|
||||
- var tag = meta.tags[i]
|
||||
a(href="/tags/"+tag.slug)= tag.label
|
18
src/themes/theme-fipamo-default/fipamo-default/page.twig
Normal file
18
src/themes/theme-fipamo-default/fipamo-default/page.twig
Normal file
|
@ -0,0 +1,18 @@
|
|||
{% 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">
|
||||
<p>{{content | raw}}</p>
|
||||
</div>
|
||||
</article>
|
||||
{% endblock %}
|
Loading…
Reference in a new issue