Expand description
Markdown blogs for Laravel Rust in several languages, where every language has its own URL.
One folder per post, one file per language. Each file declares its own slug, so the English post
lives at /blog/chat-moderation-games and the Spanish one at
/es/blog/moderacion-chat-videojuegos, and each page knows the other: hreflang, a language
switcher, the sitemap and a link shared in the wrong language all just work.
ⓘ
Application::configure().with_providers(|providers| {
providers.add(LarablogServiceProvider::new().routes("blog"));
})It is the port of the PHP package edulazaro/larablog
to Laravel Rust 0.1 (beta), and its API follows the framework’s changes until 1.0.
Re-exports§
pub use author::Author;pub use blog::Blog;pub use blog::Pagination;pub use blog::SitemapEntry;pub use blog::Tag;pub use blog::flush;pub use blog::scoped;pub use category::Category;pub use conditionals::Condition;pub use config::CacheSettings;pub use config::CardSettings;pub use config::CollectionConfig;pub use config::FeedSettings;pub use config::HtmlInput;pub use config::LarablogConfig;pub use config::Localized;pub use config::MarkdownSettings;pub use config::Segments;pub use config::Views;pub use error::Error;pub use feed::Feed;pub use http::UseLocale;pub use index::IndexError;pub use larablog::Larablog;pub use markdown::Heading;pub use markdown::Markdown;pub use post::Post;pub use provider::LarablogServiceProvider;
Modules§
- author
- blog
- cards
- One social card per post and language, for every collection with cards on.
- category
- conditionals
::: if-published post="folder"blocks.- config
config/larablog.php, as a configuration section.- console
- error
- feed
- http
- The collection’s pages. Larablog finds and paginates; the site’s views draw.
- index
- Everything a collection holds on disk, read once and cached until a file changes.
- larablog
- markdown
- Reads a post file: its frontmatter, and its body as HTML with an anchor on every heading.
- post
- provider
- routes
- The routes of a collection, as names and addresses.
- support
- Small helpers shared by the rest of the crate: slugs, localized values,
data_get, dates and the PHP word count. - views
- What the views receive.
- yaml
- YAML into plain
serde_jsonvalues, so the rest of the crate handles frontmatter and the two shared files like PHP handles the arrays Symfony’s parser returns.
Functions§
- collection
- A collection by its name: PHP’s
Larablog::collection('blog'). - collections
- Every collection of the configuration: PHP’s
Larablog::collections(). - manager
- The manager of the running application.