adrienpayet / praticable-blocks
Store Vue Praticable blocks coming from the front-end to Kirby blocks.
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Type:kirby-plugin
pkg:composer/adrienpayet/praticable-blocks
Requires
README
This plugin mainly allows several blocks processes at the heart of the praticable.fr website.
Installation
Download
Download and copy this repository to /site/plugins/praticable-blocks.
Composer
composer require adrienpayet/praticable-blocks
Features
Documentation in progress
Store JSON data as Kirby blocks
One of the main features consist in storing JSON data sent from the front-end through a POST request to Kirby blocks. POST request can fetch any route ending by save.php, eg. www.your-website.com/save.json or www.your-website.com/page/save.json. Data should be stored in the body request, following that structure :
type BodyRequest = {
  pageUri: string
  blocks: Array<MarkdownBlock | ImageBlock>
}
type MarkdownBlock = {
  type: "markdown"
  content: {
    text: string
    width?: string = "400px"
    height?: string = "200px"
    transform?: string = "translate(912px, 240px)"
    zindex?: number = 0
    refs?: string = ""
  }
}
type ImageBlock = {
  type: "image"
  content: {
    image: Array<string> // eg. ['example-image.jpeg']
    b64: string // A b64 string of the image
    width?: string = "400px"
    height?: string = "400px"
    transform?: string = "translate(0px, 0px)"
    zindex?: number = 0
    iscover?: boolean = false
    caption?: string = ""
  }
}
Representatives
Concept

Representatives are blocks that represent spaces (pages) and allow to navigate to it. At least, they contain the title of the represented space, linked to it (wrapped in a <a> tag). Optionnaly, they can contain a cover image and a introduction text.
Usage
License
MIT