An open API service indexing awesome lists of open source software.

https://github.com/platane/january

Static blog generator
https://github.com/platane/january

b blog page-transitions react single-page-applications static-site

Last synced: 2 months ago
JSON representation

Static blog generator

Awesome Lists containing this project

README

          

[![Travis](https://img.shields.io/travis/Platane/january.svg?style=flat-square)](https://travis-ci.org/Platane/january)

Static blog generator.

# features

- 🍰 as simple as git push
- 🖋 read content as markdown.
- 📦 generate optimized images resolutions.
- 🔌 progressive web app, works offline.
- 👓 rss feed.
- 🛰 SEO friendly with server side rendering.

along with neat ui 👍

# build

## Dev

The app can be served trought webpack-dev-server for developpement purpose. Still, you need at least to build the posts as json and the images.

`yarn run build:contentData && yarn run build:images && yarn run start`

## Production

The build process is composed of several steps:

- __yarn run build:contentData__
parse the files in `src/content/posts`, write the parsed posts as `dist/posts.jon`

- __yarn run build:asset__ run webpack to build the static assets.

- __yarn run build:images__ parse the `dist/posts.jon` file, generating several versions of images for several dimensions. rewrites the `dist/post.json` to include path to generated images.

- __yarn run build:icons__ generates severals version of the favicon, make them readable in `dist/icons.json`
__/!\ this step require to have graphicMagic in path__

- __yarn run build:pages__ pre-render the html pages, reading the `post.json` file.

- __yarn run build:manifest__ build the manifest file, reading the generated icons.

- __yarn run build:serviceWorker__ build the serviceWorker file, reading the assets generated by webpack.

- __yarn run build:rss__ build the rss page.

## path

As the router later the route, requiring relative path will fail.

In order to re-write path absolutely, the `ROOT_URL` can be defined and will be append at the start of the paths.

For example as this project is hosted at `platane.github.io/january`, the style url must be `//platane.github.io/january/asset/style.css`. The base path to set is `//platane.github.io/january`.

## CI

The `.travis` file allows to build at every push and deploy to gh-pages.

`GITHUB_TOKEN` env var must be set. As well as `BASE_PATH` if applyable.

## tl;dr

`yarn run build` to build the static files.

__/!\ graphicMagic must be installed__

But you probably shouldn't care as every thing runs on CI 😃.