Skip to content

AltBlog is a javascript client-side engine for blog development, used in Watermelon, Quanta Blog, El Rayo, etc.

Notifications You must be signed in to change notification settings

Ctrl-Alt-Tec/altBlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

altBlog

Ctrl Alt Tec altBlog is a javascript client-side engine for blog development, used in Watermelon, Quanta Blog, El Rayo, etc.

IMPORTANT

As of april 21, v1 of altBlog is deprecated. For retrocompatibility reasons, the current directory will be kept as-is. Please head to v2.

Getting started

Include files

In index.html, include the following scripts

<script src="https://cdn.jsdelivr.net/gh/Ctrl-Alt-Tec/altBlog/index.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Ctrl-Alt-Tec/altBlog/index.css">
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/header@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/paragraph@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/raw@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/simple-image@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/table@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/embed@latest"></script>

Setup

Instantiate altBlog with configuration options listed below

let Blog = new altBlog(options);

To start the blog, simply run

Blog.getData().then(()=>{Blog.showPosts()})

Configuration

Initiate altBlog(options) where options is an object with keys:

Key Default Description
data () async () Should return an array of posts
login (username, password) ()=>{} Connects with backend for log in
update (id, post) ()=>{} Connects with backend to update post with id id with content post
delete (id, post) ()=>{} Connects with backend to delete post with id id
create (post) ()=>{} Connects with backend to push new post into data
fileUpload (stream, name, callback) async () Connects with backend to upload dataStream stream and store with name, should return url
allPosts document.querySelector("#allPosts") DOM element where Blog content should be displayed
sections [] Array with Blog sections, to be displayed in navbar and selector boxes
name window.location.host Name of blog to be displayed in title
navBar {} Object containing navbar config.

navBar options

Contains configuration for navbar object

Key Default Description
logo 'logo.png' URL to logo to display in navbar
visible true (boolean) Show or hide navbar

Examples

altBlog is used to develop several blog projects, including:

Contribution

To contribute to this repo, you must first fork it and make a pull request. Because of its nature in supporting multiple projects, modifications should not break current working features, and experimental features must be marked as so.

Credits

altBlog is free software developed by Ctrl Alt Tec by @louloubadillo and @edvilme in its initial release.

altBlog.Editor is built upon codex editor.js Further contributions will also be listed below

About

AltBlog is a javascript client-side engine for blog development, used in Watermelon, Quanta Blog, El Rayo, etc.

Resources

Stars

Watchers

Forks

Packages

No packages published