Coder Social home page Coder Social logo

kjirou / unlimited-blog-works Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 1.0 1.11 MB

A simple static blog generator for publishing on GitHub Pages

Home Page: https://www.npmjs.com/package/unlimited-blog-works

JavaScript 0.22% TypeScript 79.47% CSS 20.32%
blog-engine blog-generator static-site-generator nodejs

unlimited-blog-works's Introduction

unlimited-blog-works

run-checks

A simple static blog generator for publishing on GitHub Pages

๐Ÿš€ Installation

Software Preparation

Package Installation

npm install -g unlimited-blog-works

๐Ÿ‘€ Overview

๐Ÿ—บ๏ธ Overall View of the Structure

Execute the following command at any place as a trial.

ubw init my-blog
cd ./my-blog
ubw article new
ubw compile

The following files will be generated.

tree .
.
โ”œโ”€โ”€ blog-publication
โ”‚ย ย  โ”œโ”€โ”€ articles
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 20190310-0001.html
โ”‚ย ย  โ”œโ”€โ”€ atom-feed.xml
โ”‚ย ย  โ”œโ”€โ”€ external-resources
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ github-markdown.css
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ index.css
โ”‚ย ย  โ”œโ”€โ”€ index.html
โ”‚ย ย  โ””โ”€โ”€ robots.txt
โ”œโ”€โ”€ blog-source
โ”‚ย ย  โ”œโ”€โ”€ articles
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 20190310-0001.md
โ”‚ย ย  โ””โ”€โ”€ external-resources
โ”‚ย ย      โ”œโ”€โ”€ _direct
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ robots.txt
โ”‚ย ย      โ”œโ”€โ”€ github-markdown.css
โ”‚ย ย      โ””โ”€โ”€ index.css
โ””โ”€โ”€ ubw-configs.js

7 directories, 11 files
cat blog-source/articles/20190310-0001.md
---
publicId: 20190310-0001
lastUpdatedAt: '2019-03-10 08:23:09+0000'
---

# Page Title
cat blog-publication/articles/20190310-0001.html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Page Title | My Blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/external-resources/index.css">
    <meta property="og:title" content="Page Title">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://example.com/articles/20190310-0001.html">
    <meta property="og:site_name" content="My Blog">
  </head>
  <body>
    <div class="ubw-article">
      <div class="markdown-body ubw-main-content">
        <h1 id="page-title">Page Title<a class="ubw-heading-slug" aria-hidden data-ubw-autolink href="">#</a></h1>
      </div>
      <hr class="ubw-end-of-main-content">
      <ul class="ubw-meta-data">
        <li class="ubw-meta-data-last-updated-at"><span>Last updated at:</span><span>2019-03-10 08:23:09 (UTC)</span></li>
        <li class="ubw-meta-data-back-to-top"><a href="/">Back to the Top</a></li>
      </ul>
    </div>
  </body>
</html>

๐Ÿฑ Concept

  • Save sentences with the Markdown format
    • Because it is the simplest form that can express sentence structure.
  • NO Article Status Management
    • Manage drafts and editing history with VCS such as Git.
  • NO Posting Comments
    • It is more interesting to talk on external SNS.
  • NO Text Editor
    • I think it would be better to use the text editor you are using routinely.
    • Also, if you want to write easily, I recommend using the WYSIWYG editor on GitHub Web.
  • NO JS/CSS Preprocessor
    • Because it's hard work...

๐Ÿ“š CLI API Reference

  • ubw article new [OPTIONS]
    • Create an empty article
    • OPTIONS
      • --config-file, -c
        • A path of ubw-configs.js file, default is "./ubw-configs.js"
  • ubw compile [OPTIONS]
    • Compile Markdown articles into HTML
    • OPTIONS
      • --config-file, -c
        • A path of ubw-configs.js file, default is "./ubw-configs.js"
  • ubw help
    • Display help
  • ubw init BLOG_SOURCE_DIR
    • Initialize a new blog
    • BLOG_SOURCE_DIR
      • A location to generate
  • ubw now
    • Display current time by "YYYY-MM-DD HH:ii:ss+0000" format. It can be used to configure lastUpdatedAt in articles.
  • ubw version
    • Display version of npm package

๐Ÿ“œ ubw-configs.js

Most of the commands reflect the configuration of "ubw-configs.js".

For details of setting, refer to the following source code and its comment at present.

โœ๏ธ Markdown Format

Basically it is a GitHub compatible format, so please refer to the following articles.

However, for example, the following functions are not yet available.

๐Ÿ”ง Development

Softwares that needs to be locally installed

Installation

git clone [email protected]:kjirou/unlimited-blog-works.git
cd ./unlimited-blog-works
npm install

Integration Test

Note

Defining test commands as npm scripts changes the result of process.cwd(), causing it to not work properly.

Execute TypeScript code directly

The reason this command was not added as one of the npm scripts is that process.cwd() points to the wrong directory.

npx tsx src/cli-runner.ts {ubw commands}

Execute built JavaScript code

npm run build
./bin/cli.js {ubw commands}

๐Ÿ”— Reference Urls

unlimited-blog-works's People

Contributors

kjirou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unlimited-blog-works's Issues

Tasks

  • ใ‚„ใ‚‹
    • ใƒ–ใƒญใ‚ฐ่จ˜ไบ‹ใ‚’ๆ›ธใใชใŒใ‚‰ v1.0 ใซใ—ใฆใ‚‚่‰ฏใ„ใจๆ€ใ†ใพใงใ‚ขใƒ—ใ‚ฐใƒฌ
  • ใ‚ใจใงใ‚„ใ‚‹
    • ๅ›บๅฎšใƒ˜ใƒƒใƒ€ or ใƒ•ใƒƒใ‚ฟใ‚’ใคใ‘ใ‚‹
    • CSSใŒใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใพใพใฎๅ ดๅˆใฏใ€JSๅดใŒpresetsใ‚’ๅ‚็…งใ—ใฆindex.cssใ‚’็”Ÿๆˆใ™ใ‚‹ใ‚ˆใ†ใซ
      • ใ‚ขใƒ—ใƒ‡ใฎ้š›ใซๅฟ˜ใ‚ŒใŒใกใชใฎใง
    • ๅ€‹ๅˆฅ่จ˜ไบ‹ใฎGitHubใƒชใƒณใ‚ฏใ‚’ๅ‡บใ—ใŸใ„
      • additionalArticlePageLinks ๏ผŸใซใชใ‚Šใใ†... ่‰ฏใ„ใฎใ‹ใชใ“ใ‚Œ
    • ่จ˜ไบ‹ใ‚’ใƒžใƒผใ‚ฏใƒ€ใ‚ฆใƒณใงไฟๅญ˜ใ—ใจใใŸใ„ใ“ใจใ‚’ Concept ใธ่ฟฝๅŠ ใ™ใ‚‹
      • HTML ใ‚ˆใ‚Šๆ–‡ๆ›ธๆง‹้€ ใŒใ ใ„ใถใ‚ทใƒณใƒ—ใƒซใ ใ‹ใ‚‰ใ€ใ‚ฝใƒผใ‚นใจใ—ใฆใตใ•ใ‚ใ—ใ„
      • ใ“ใฎใƒ„ใƒผใƒซใงใ„ใ„่จณใชใ„ใฎใงใ€ไปŠๅพŒใฎไน—ใ‚Šๆ›ใˆใ‚’ใตใพใˆใฆใใ†ใ—ใจใใŸใ„
    • Pluggable Theme Setting
    • AMP
    • ๅ…ฑ้€šใƒ•ใƒƒใ‚ฟใƒผ
    • ใ‚ณใƒผใƒ‰ใฎใ‚ทใƒณใ‚ฟใƒƒใ‚ฏใ‚นใƒใ‚คใƒฉใ‚คใƒˆ
    • https://github.com/mizchi/next-editor ้€ฃๆบใฎใƒ†ใ‚นใƒˆ
  • ใƒชใƒ•ใ‚กใ‚ฏใ‚ฟใƒชใƒณใ‚ฐใƒป้–‹็™บ็’ฐๅขƒๆ”นๅ–„
    • README ใฎๅฎŸ่กŒไพ‹ๆ›ดๆ–ฐใ‚นใ‚ฏใƒชใƒ—ใƒˆใ‚’ไฝœใ‚‹
  • ๅฟ…่ฆใชใ‚‰ใ‚„ใ‚‹
    • ใƒ–ใƒฉใ‚ฆใ‚ถใ‚ญใƒฃใƒƒใ‚ทใƒฅๅฏพ็ญ–
      • GitHub Pages ใฎๆŒ™ๅ‹•่ชฟๆŸป
      • ็พไปฃใฎใƒ™ใ‚นใƒˆใƒ—ใƒฉใ‚ฏใƒ†ใ‚ฃใ‚นใธใฎ็Ÿฅ่ฆ‹ใŒใชใ„
    • ่‡ช่จ˜ไบ‹ใธใฎใƒชใƒณใ‚ฏใ‚’็›ธๅฏพใƒ‘ใ‚นใงๆ›ธใ„ใŸๅ ดๅˆใซใ€GitHub ไธŠใงใƒชใƒณใ‚ฏ่ฝใกใ—ใชใ„ใ‚ˆใ†ใซใ™ใ‚‹
    • Feed ใซๅซใ‚ใ‚‹ๆƒ…ๅ ฑใ‚’ๅข—ใ‚„ใ™
    • ๅ…ฑ้€šใƒ˜ใƒƒใƒ€ใƒผ
      • ๅ…ฑ้€šใƒ•ใƒƒใ‚ฟใƒผใจๆฏ”ในใฆ้‚ช้ญ”ใซใชใ‚‹ใฎใง่€ƒใˆใ‚‹ใ“ใจใŒๅคšใ„
    • "extrenal-resources" ใŒ้•ทใ„ใ‹ใ‚‰่จ˜ไบ‹ใ‚’ๆ›ธใๆ™‚ใซ้ขๅ€’ใ‹ใ‚‚ใ—ใ‚Œใชใ„ๆ‡ธๅฟต
  • ใ‚„ใ‚‰ใชใ„
    • GitHub ไบ’ๆ›ใฎ :icon: ๅๆ˜ 
      • ่จ˜ไบ‹ Markdown ใ‚ฝใƒผใ‚นใฎใƒใƒผใ‚ฟใƒ“ใƒชใƒ†ใ‚ฃใŒไธ‹ใŒใ‚‹ๅบฆๅˆใ„ใŒๅคงใใ„
      • Unicode ใฎ Emoji ใ‚’ไฝฟใ†ใ“ใจใงใ‚ใ‚‹็จ‹ๅบฆใฏ่งฃๆฑบใงใใ‚‹

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.