Skip to content

BlogMd/core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@blogmd/core

BlogMd is an open-source blog engine

Usage

  1. install blogmd on your repository
npm install @blogmd/core
  1. prepare files like bellow
.
├── articles
│   ├── summer-journey
│   │   ├── article.md
│   │   ├── ebay.png
│   │   ├── meta.jsonld
│   │   ├── airport.jpg
│   │   ├── grandmother.jpg
│   │   ├── great-dish.jpg
│   │   └── souvenior.jpg
│   └── my-favorite-movie
│       ├── article.md
│       ├── meta.jsonld
│       └── the-third-man.jpg
├── package-lock.json
└── package.json

Each folders of ./articles must include article.md and meta.jsonld. meta.jsonld is important to build blog posts. I will show you an example below.

{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "blog.example.com" // URL of the blog
  },
  "headline": "My summer journey", // title of the post
  "image": "./airport.jpg", // main picture
  "author": {
    "@type": "Person",
    "name": "Torichan", // Author's name
    "url": "https://example.com/torichan" // Author's profile page
  },
  "publisher": {
    "@type": "Organization",
    "name": "Torichan Labo", // Publisher's name
    "logo": {
      "@type": "ImageObject",
      "url": "https://pbs.twimg.com/profile_images/1435134138659475456/rV1YHF06_400x400.jpg" // Publisher's icon
    }
  },
  "datePublished": "2021-10-28", // Created date
  "dateModified": "2021-10-28" // Last updated
}
  1. write a script
// script.js
const BlogMd = require("@blogmd/core").default;

const blogmd = new BlogMd({});
blogmd.build();
blogmd.buildIndex();
  1. run the script
node script.js

About

BlogMd is an open-source blog engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published