0.1.1 • Published 3 years ago

@blogmd/core v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@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
0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago