From c9f6746756d9afb53633147c02bcf3f7ea274075 Mon Sep 17 00:00:00 2001 From: bangnokia Date: Sun, 24 Mar 2024 02:45:27 +0700 Subject: [PATCH] wip --- skeleton/content/index.md | 40 ++++++++++++++++++++----- skeleton/public/style.css | 9 ++++++ skeleton/resources/views/home.blade.php | 1 - 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/skeleton/content/index.md b/skeleton/content/index.md index 1200b03..7a8466b 100644 --- a/skeleton/content/index.md +++ b/skeleton/content/index.md @@ -5,18 +5,44 @@ layout: home **Lina** is an opinionated flat-file CMS for who want a simple and fast blog. The template using Blade template engine, so you can use all Blade features. -## Get all content in a directory +To help you get started, we have created a few example posts. You can find them in the `content/posts` directory. +## Requirements +- PHP 8.3 + +## Getting started +```bash +lina new my-blog +``` + +### Create a blog +```bash +composer global require bangnokia/lina +``` + +### Folder structure +``` +content/ + posts/ + 2020-11-01-hello.md + index.md + +resources/ + views/ + +public/ +``` + +There are some function that you can use to get content from your site. + +### Get all content in a directory ```php foreach (cf()->index('post') as $post) { echo $post->title; } ``` -```html -

Hello world

-``` - -``` -normal no html

welcome to vietnam

+### Get a single content +```php +$post = cf()->get('posts/2020-11-01-hello.md'); ``` diff --git a/skeleton/public/style.css b/skeleton/public/style.css index 5285292..7c47b70 100644 --- a/skeleton/public/style.css +++ b/skeleton/public/style.css @@ -33,6 +33,15 @@ pre { } } +p { + code { + background-color: #f4f4f4; + padding: 2px 6px; + border-radius: 0.25rem; + font-size: 0.875rem; + color: #4F95D1; + } +} p { line-height: 1.75rem; diff --git a/skeleton/resources/views/home.blade.php b/skeleton/resources/views/home.blade.php index fc44ee2..1caea67 100644 --- a/skeleton/resources/views/home.blade.php +++ b/skeleton/resources/views/home.blade.php @@ -2,7 +2,6 @@ @section('content')

{{ $data->title }}

-

This is a static blog build with PHP.

{!! $data->content !!}