Dead simple blog engine
nhymxu / tramkho-blog-engine Goto Github PK
View Code? Open in Web Editor NEWDead simple blog engine
License: BSD 3-Clause "New" or "Revised" License
Dead simple blog engine
License: BSD 3-Clause "New" or "Revised" License
Current
<meta name="description" content="">
<meta property="og:type" content="website">
<meta property="og:title" content="">
<meta property="og:url" content="">
<meta property="og:site_name" content="Dz notes">
<meta property="og:description" content="">
Need filled data to this
Basic auth currently only work if not running on subfolder
Eg: http://localhost/admin
If running on subfolder, auth not run
Eg: http://localhost/tramkho/admin
Should handle this case using $app->getBasePath()
;
Sample code:
<?php
declare(strict_types = 1);
namespace Middlewares;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
class ResponseTime implements MiddlewareInterface
{
const HEADER = 'X-Response-Time';
/**
* Process a server request and return a response.
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$server = $request->getServerParams();
$startTime = $server['REQUEST_TIME_FLOAT'] ?? microtime(true);
$response = $handler->handle($request);
return $response->withHeader(self::HEADER, sprintf('%2.3fms', (microtime(true) - $startTime) * 1000));
}
}
Need add as first middleware
Need filter dropdown on blog list
List all project
Have some detail
Maybe create simple table on database
Very simple blog engine.
rakit/validation
php-di/php-di
insideme
tag from indextech blog
and insideme blog
I want to check template file exists or not.
If not, fallback to archive.twig
Currently, this engine using CommonMark v1.6.
Need upgrade to v2.0 with some breaking change:
https://commonmark.thephpleague.com/2.0/upgrading/
https://commonmark.thephpleague.com/2.0/changelog/
Release info: slimphp/Slim#3023
Currently, when I want to debug, I need add multi line to this .env.php
file
define('NX_DEBUG', true);
$settings['error']['display_error_details'] = true;
$settings['error']['log_errors'] = true;
$settings['error']['log_error_details'] = true;
$settings['logger']['level'] = \Monolog\Logger::DEBUG;
$settings['twig']['options']['debug'] = true;
$settings['twig']['options']['cache_enabled'] = false;
I want create seperate file, put all of settings to this file.
When I need debug, just import this file.
Maybe can put on docs/
folder with name env.debug.php
and modify .env.php
like this
<?php
require __DIR__ . '/docs/env.debug.php';
check https://mdxeditor.dev/ and consider replace or not
I want change theme, just using config file. Not need edit direct to twig config bootstrap file
FLoC
is Google's Federated Learning of Cohorts. New way Google tracking user.
I want prevent this using https://github.com/nhymxu/php-floc-disable middleware
need command to clear twig cache
I need to know first time post published.
I want rss feed for my blog
Need SQL builder for easier, better write models
Currently, homepage and tag list page only get simple post detail.
I want get tag for each post. But not fixed (base on each theme).
So I want add config $settings['homepage']['get_post_tag'] = false;
to know when I need to get tags for each post.
When create new post, need remove Trash
option
And default status is Draft
I want config number of post per pagination
Each post have layout properties on metadata. When render post, choose template to render based on this properties
I need embed youtube video to post.
So I think syntax maybe:
[youtube_embed](https://www.youtube.com/watch?v={video_id_here})
If markdown parser match youtube_embed
keyword and check link is youtube video
=> create youtube embed frame over clickable-link
We need customize how markdown lib parsing document.
Because blog post not change frequently, so I want caching this to static html file on cache
folder.
Apache or Nginx can direct access this cache file over php process + database query.
It's good for frontend
So I need
Hightlightjs just need loaded on single post.
Move from layout
to post
template
Need manage upload file
Currently tag list order by total post have tag.
Should be order by tag name
When I forgot change owner for database.sqlite
from upload user to www-data.
Everything still fine before I saved post => read-only database error.
Need validate this and display warning on admin page
Need compress html output for better serving
When NX_DEBUG
flag == true, disable miniy html output
Missing button
Need button point to http://blog.com/admin/post/new
Tailwind is take time, just using other template like Tabler
https://tabler.io/
It's faster time to build.
No response
BasePath on http://domain.com will return /
.
Should return empty string to work well
Expected: http://domain.com/post-slug
Actual: http://domain.compost-slug
tramkho-blog-engine/src/Domain/Blog/AdminRepository.php
Lines 107 to 118 in 4efd266
On this function, wrong param name make publish post action always error.
Just changed from 'published_at' => $publish_time
to 'publish_time' => $publish_time
Replace @css import with html preload
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Anonymous+Pro&display=swap" rel="stylesheet">
and
font-family: 'Anonymous Pro', monospace;
Need health check url for validate.
Maybe:
/status
/health
/ping
Response can be pong
only or json with many value want to check
Because not pass tag list to twig
Have checkbox, if enable checkbox -> allow edit
No response
Currently, sitemap only re-build when run CLI command.
I want this auto re-build when published new post
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.