Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bangnokia committed Mar 23, 2024
1 parent 936d034 commit c9f6746
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
40 changes: 33 additions & 7 deletions skeleton/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<h1>Hello world</h1>
```

```
normal no html <h1>welcome to vietnam</h1>
### Get a single content
```php
$post = cf()->get('posts/2020-11-01-hello.md');
```
9 changes: 9 additions & 0 deletions skeleton/public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion skeleton/resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

@section('content')
<h1 class="text-center">{{ $data->title }}</h1>
<p class="text-center">This is a static blog build with PHP.</p>

{!! $data->content !!}

Expand Down

0 comments on commit c9f6746

Please sign in to comment.