Skip to content

Commit

Permalink
update skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
bangnokia committed Apr 5, 2024
1 parent 5368145 commit 9f14322
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
43 changes: 2 additions & 41 deletions skeleton/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,9 @@ title: Welcome to Lina
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.
Welcome to Lina, a simple and lightweight blog platform built on top of Laravel Blade. Lina is designed to be easy to use and.

To help you get started, we have created a few example posts. You can find them in the `content/posts` directory.
Checkout the [documentation](https://github.com/bangnokia/lina) on our Github repository to get started.

## 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 (lina()->index('post') as $post) {
echo $post->title;
}
```

### Get a single content

```php
$post = lina()->get('posts/2020-11-01-hello.md');
```
2 changes: 1 addition & 1 deletion skeleton/content/posts/2020-11-01-hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title: Hello world
layout: post
---

this is your first post, you can customize it by editing `resources/views/post.blade.php` file.
this is your first post, you can customize the view by editing `resources/views/post.blade.php` file.
2 changes: 1 addition & 1 deletion skeleton/resources/views/home.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends('app')
@extends('layout')

@php
$posts = collect(lina()->index('posts'))->sort(fn($a, $b) => $b->createdAt <=> $a->createdAt);
Expand Down
2 changes: 1 addition & 1 deletion skeleton/resources/views/post.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends('app')
@extends('layout')

@section('content')
<h1 class="text-center">{{ $data->title }}</h1>
Expand Down

0 comments on commit 9f14322

Please sign in to comment.