Download the PHP package calevans/staticforge-social-metadata without Composer

On this page you can find all versions of the php package calevans/staticforge-social-metadata. 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 staticforge-social-metadata

Social Metadata Feature

Welcome to the StaticForge Social Metadata feature! We know how important it is for your content to look great when shared on social media. Whether it's a link dropped in Slack, a tweet, or a Facebook post, you want that rich preview card with a nice image and title.

This feature handles all the heavy lifting for you. It automatically generates Open Graph (Facebook, LinkedIn, etc.) and Twitter Card metadata tags and injects them right into your page's <head>.


How It Works

You don't need to do anything special. StaticForge looks at the frontmatter you're already writing for your pages and uses it to build the metadata.

  1. You Write Content: Add standard fields like title, description, and hero (or image) to your page's frontmatter.
  2. We Generate Tags: During the build process, we convert that data into <meta property="og:title">, <meta name="twitter:card">, and more.
  3. We Inject: We find the </head> tag in your HTML and slip those meta tags in right before it closes.

Configuration

While per-page data is great, you don't want to repeat your Twitter handle on every single file. That's where siteconfig.yaml comes in. You can set site-wide defaults that act as a fallback.

Add this to your siteconfig.yaml:

We also use your main site.name from siteconfig.yaml to populate the og:site_name property.


Usage in Content

StaticForge is smart about finding your metadata. It looks for specific social overrides first, then falls back to your standard frontmatter.

Here is what your Markdown frontmatter might look like:

Disabling for a Specific Page

If you want to disable social metadata for a specific page (like a private landing page), you can set social: false in the frontmatter:

Supported Fields & Fallbacks

Here is the full list of frontmatter keys we look for and what they map to:

Frontmatter Key Fallback Chain (checked in order) Maps To
Title social.title → title → site.title og:title, twitter:title
Description social.description → description → site.description og:description, twitter:description
Image social.image → image → hero (or hero.image when hero is a map) → social.default_image og:image, twitter:image
Facebook Image social.facebook_image → Generic Image og:image
Twitter Image social.twitter_image → Generic Image twitter:image
Alt Text social.image_alt → image_alt og:image:alt, twitter:image:alt
Creator social.creator → author twitter:creator
URL url og:url
Type type (defaults to website) og:type

Site Auditing

This feature integrates with the StaticForge Auditor. When you run staticforge site:audit, we will check your compiled pages for missing social tags.

The auditor checks for the presence of:

If any of these are missing, you will see a warning in your audit report.


Troubleshooting

"I don't see the tags in my source code!" Check your template. This feature looks for the </head> closing tag to know where to insert the metadata. If your template is missing that tag (or if it's malformed), we can't inject the metadata.

"The image isn't showing up on Twitter!" Make sure your image path is correct. While we support relative paths, social networks often prefer absolute URLs (starting with https://). We try to help, but providing a full URL or ensuring your SITE_BASE_URL is set correctly in .env is best practice.


All versions of staticforge-social-metadata with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
eicc/staticforge Version ^3.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 calevans/staticforge-social-metadata contains the following files

Loading the files please wait ...