Download the PHP package spekulatius/laravel-commonmark-blog without Composer

On this page you can find all versions of the php package spekulatius/laravel-commonmark-blog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-commonmark-blog

Laravel Commonmark Blog

Total Downloads

The Laravel Commonmark Blog is kind of a static site generator for Laravel. It is a simple filesystem-based & SEO-optimized structure-blog for Laravel using Commonmark and Laravel SEO.

Goals & Main Concepts

The goal of this package is to separate the blog content from the application while keeping the content hosted under the root domain (e.g. project.com/blog instead of blog.project.com). This is preferred from an SEO point of view.

Maximal performance is achieved by avoiding rendering and passing content through the framework. The framework is only used initially to prepare and render the blog content. The rendered files are written directly to the public/-directory to avoid hitting the application. Assuming correct server configuration, the blog achieves (near) static-site performance levels.

For each file, a directory with an index.htm is created to avoid additional server configuration. For example, the file blog/my-article.md would be stored as blog/my-article/index.htm. Most web-server are already configured to serve these files directly.

With a focus on SEO, CommonMark is the logical choice: It is highly extensible allowing for any customization you might need to rank. There is also an example repository demonstrating the blog further.

Core Features

SEO-Enhancements

There are several SEO improvements included or easily configurable via extensions:

SEO improvements are usually active by default or can be configured using the config file.

Planned / Considered SEO-related enhancements

The following extension/improvements are considered for the blog package:

How to Use This Package

Below are examples of how to use the blog package.

How to Add a Post

Any blog page is following a simple structure using Frontmatter & Commonmark. The YAML Frontmatter is used to define post-level information such as titles, social sharing images, etc. with the CommonMark content following:

Default values can be set under defaults in the config file. If you are unsure which headers to include consult joshbuchea/HEAD.

How to Add an Article Listing Page

Listing pages can be created by adding a file called index.md within a directory. With this, the rendering method gets the following parameters passed in:

With this information, your Blade-file should be able to render a complete article listing page. In addition to the numbered page files an index file is added to allow a "root"-page without a page number. The following example explains this more.

If three listing pages with articles need to be created the following files would be created:

Most web-servers will serve these as:

Note:

Multi-language blogs with hreflang

The blog module supports multi-lingual blogs using hreflang. Each language version of an article will live in a separate markdown file and is cross-references using hreflang:

English article:

German article:

Please note: This doesn't consider embargo (delayed publishing) at the moment. You will need to ensure that your site doesn't reference a not-yet-published article manually.

Requirements & Installation

Requirements

Installation

This package is distributed using composer. If you aren't using composer you probably already know how to install a package. Here are the steps for composer-based installation:

Next, publish the configuration file:

Review, extend and adjust the configuration under config/blog.php as needed. The required minimum is a BLOG_SOURCE_PATH and some default frontmatter.

Adding Commonmark Extensions

You can add Commonmark extensions to your configuration file under extensions:

Make sure to run the required composer install commands for the extensions before. Packages are usually not required by default.

In the configuration file config/blog.php, you can add additional configuration for the extensions under config.

Usage: Rendering of the Blog Posts

The build of the blog is done using an Artisan command:

You can optionally pass some parameters, see php artisan help blog:build for details.

Usually, this step would be triggered as part of the deployment process. You can set up two repositories (one for your project and one for your blog) and let both trigger the build as needed.

You could also schedule the command in your app/Console/Kernel.php to ensure regular updates.

Hint: Make sure to update your sitemap.xml after each build.

Naturally, the way you integrate the blog in your project depends on the deployment tools and process.

Contributing & License

Please see CONTRIBUTING for details.

Released under the MIT license. Please see License File for more information.


All versions of laravel-commonmark-blog with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
nesbot/carbon Version ^2.0
laravel/framework Version ^8.75|^9.0
league/commonmark Version ^2.0
romanzipp/laravel-seo Version ^2.1.3
spatie/yaml-front-matter Version ^2.0
symfony/finder Version ^6.0
symfony/filesystem Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spekulatius/laravel-commonmark-blog contains the following files

Loading the files please wait ....