{"id":45505968,"url":"https://github.com/olssonm/ampersand","last_synced_at":"2026-04-01T19:36:01.873Z","repository":{"id":44537878,"uuid":"353083427","full_name":"olssonm/ampersand","owner":"olssonm","description":"Plug and play flat file markdown blog for your Laravel-projects","archived":false,"fork":false,"pushed_at":"2026-03-20T07:07:23.000Z","size":83,"stargazers_count":27,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-21T00:04:10.675Z","etag":null,"topics":["blog","flat-file","laravel","markdown"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olssonm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.YML","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["olssonm"]}},"created_at":"2021-03-30T17:20:54.000Z","updated_at":"2026-03-20T07:05:38.000Z","dependencies_parsed_at":"2024-03-22T11:43:10.492Z","dependency_job_id":"1884d729-a713-44ca-94d0-b0012b338673","html_url":"https://github.com/olssonm/ampersand","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.2857142857142857,"last_synced_commit":"f88adb91514f210cacbbded9a2290d4dc230e3e9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/olssonm/ampersand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olssonm%2Fampersand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olssonm%2Fampersand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olssonm%2Fampersand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olssonm%2Fampersand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olssonm","download_url":"https://codeload.github.com/olssonm/ampersand/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olssonm%2Fampersand/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","flat-file","laravel","markdown"],"created_at":"2026-02-22T18:47:42.883Z","updated_at":"2026-04-01T19:36:01.865Z","avatar_url":"https://github.com/olssonm.png","language":"PHP","funding_links":["https://github.com/sponsors/olssonm"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://user-images.githubusercontent.com/907114/113181484-20c9c600-9252-11eb-9e13-7c361f4f5134.png\" width=\"120px\" alt=\"Ampersand – Blogging for Laravel\" /\u003e\n\n# Ampersand\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/olssonm/ampersand.svg?style=flat-square)](https://packagist.org/packages/olssonm/ampersand)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/olssonm/ampersand/test.yml?branch=main\u0026style=flat-square\u0026label=tests)](https://github.com/olssonm/ampersand/actions?query=workflow%3A%22Run+tests%22)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n\u003c!-- [![Supported PHP-versions](https://img.shields.io/packagist/php-v/olssonm/ampersand?style=flat-square)](https://packagist.org/packages/olssonm/ampersand)--\u003e\n\nPlug-and-play flat file markdown blog tool for your Laravel-project. Create an article or blog-section on your site without the hassle of setting up tables, models or your own flat file-system.\n\nBuilt upon [spatie/sheets](https://github.com/spatie/sheets) to handle the markdown-files and YAML-front matter parsing.\n\n\u003eNote: This package is built for quick and easy setup and use – don't expect a fully featured CMS.\n\n### 🛠 Install and configure\n\nRequire package:\n\n```\n$ composer require olssonm/ampersand\n```\n\nPublish config-files and views:\n\n```\n$ php artisan vendor:publish --provider=\"Olssonm\\Ampersand\\AmpersandServiceProvider\"\n```\n\nIn `config/ampersand.php` you can now customize the settings to your liking. Views are available at `resources/views/vendor/ampersand`\n\n### ✏️ Writing posts\n\n#### Filename format\n\nAll posts should be stores in your `posts_path`-directory with the filename format of `2021-03-30.my-post.md`, i.e. `{date:Y-m-d}.{slug}.md`.\n\nThe slug is what determines at what URL your post will be available at.\n\n#### Artisan command\n\nYou can quickly create a new post via the artisan command:\n\n```\nphp artisan ampersand:new\n```\n\n#### YAML front matter\n\nPosts can contain any number of attributes via YAML-front matter:\n\n```\n---\ntitle: This is a new post\ndate: '2020-01-01 20:00:01'\ncover: https://amazingimages.com/my-cover.jpg\n---\n\nMy post in **Markdown**\n```\n\n### 🖥 Displaying posts\n\nTwo views are shipped with this package; an index-view and a show-view (used for single posts). They are located in `/resources/vendor/views/ampersand` after installation and are fully customizable.\n\nIn `index.blade.php` a collection of post-objects is available via the `$posts`-variable. It behaves much as a standard Eloquent-collection.\n\n``` php\n@foreach ($posts as $post)\n    \u003ch2\u003e{{ $post-\u003etitle }}\u003c/h2\u003e\n    \u003cdiv\u003e\n        {!! $post-\u003econtents !!}\n    \u003c/div\u003e\n@endforeach\n```\n\nPagination-links are also available:\n\n``` php\n{{ $posts-\u003elinks() }}\n```\n\nThe Post-object contains all your front matter attributes as well as `slug`, `date` and `contents`.\n\n``` php\n{{ $post-\u003eslug }} // my-post\n{{ $post-\u003edate-\u003eformat('Y-m-d') }} // 2021-03-30\n{{ $post-\u003econtents }} // \u003cp\u003eMy post in \u003cstrong\u003emarkdown\u003c/strong\u003e\u003c/p\u003e\n{{ $post-\u003ecover }} // https://amazingimages.com/my-cover.jpg\n```\n\n#### Retrieve posts in your application\n\nYou can retrieve posts and filter them as a collection anywhere in your application using the Post-model:\n\n``` php\nuse Olssonm\\Ampersand\\Models\\Post;\n\n// Reject posts where is_draft is true or has a date in the future\n$posts = Post::all()-\u003ereject(function($item) {\n    return $item-\u003eis_draft || $post-\u003edate-\u003elessThan(now());\n});\n```\n\nThe posts are sorted by descending date per default, so to get the latest post:\n\n``` php\n// Get first post\n$post = Post::all()-\u003efirst();\n```\n\n### 🚦 Routes\n\nThe package routes are `ampersand.index` and `ampersand.show`:\n\n```php\n{{ route('ampersand.index') }} // http://mysite.test/blog\n\n@foreach ($posts as $post)\n    // The show-route accepts either a Olssonm\\Ampersand\\Models\\Post-object\n    // or a string; the post's slug\n    {{ route('ampersand.show', $post) }} // http://mysite.test/blog/post-slug\n    {{ route('ampersand.show', 'post-slug') }} // http://mysite.test/blog/post-slug\n@endforeach\n```\n\n#### Defining your own routes\n\nThe default routes are registered with the ampersand-name and the default web-middleware group.\n\nIf you by any reason want to override this (for example if you want to have your articles behind a login or maybe you don't use the standard web-middleware group), you may set `register_routes` to `false` in ampersand.php, and then register them yourself:\n\n``` php\n// /routes/web.php\nuse Olssonm\\Ampersand\\Http\\Controllers\\PostController;\n\nRoute::group(['middleware' =\u003e 'can:read'], function() {\n    Route::get('/articles', [PostController::class, 'index'])-\u003ename('article.index');\n    Route::get('/articles/{post}', [PostController::class, 'show'])-\u003ename('article.show');\n}]);\n\n// A link to the blog index in some view\n{{ route('article.index') }} // http://mysite.test/articles\n```\n\n### See it in action\n\nSites in the wild that uses Ampersand\n\n[esignering.se/blogg](https://esignering.se/blogg)\n\n*Do you use Ampersand and want your site featured here? Submit a PR!*\n\n### License\n\nThe MIT License (MIT). Please see the [LICENSE.md](LICENSE.md) for more information.\n\n© 2021-2026 [Marcus Olsson](https://marcusolsson.me).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folssonm%2Fampersand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folssonm%2Fampersand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folssonm%2Fampersand/lists"}