Fleeksite JavaScript Documentation

javascript documentation version 1.2
Updated: January 15, 2021


Introduction


First of all, Thank you so much for supporting the fleeksite templating initiative, you're helping build something great. You are awesome!

This documentation is to help you regarding each step of customization. Please go through the documentation carefully to understand how the templates are made and how to edit this properly. Basic HTML and CSS knowledge is required to customize this template. You may learn basics at: w3 Schools, Mozilla Developers and Shayhowe.

Requirements

You will need the following to build and customize templates.

  1. Web Browser for testing (eg: Google Chrome )

Be careful while editing the template. If not edited properly, the design layout may break completely.
No free support is provided for faulty customization.

Javascript Calls #back to top

How To Load Your Posts and Comments Using Javascript

Sometimes, you want to use javascript to load your assets - and we've got you covered.


We have a few endpoints:

/api/v1

GET REQUESTS


/POSTS

/ - to load your posts, pass the same parameters you would in the liquid tags.
/{{uid}} - to load a specific post


/USERS

/ - to load your user, pass the same parameters you would in the liquid tags.
/{{uid}} - to load a specific user

/COMMENTS

/comments/{{parent_id}} - to load the comments of a post where the parent_id is the id of the post.


POST REQUESTS


/COMMENTS
/ - creates a comment, requires the parent_id, which is the post_id and the body of the comment
/like - likes a comment, requires only the id of the comment
/delete - deletes a comment, requires only the id of the comment



Comments Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate comments created on the site.

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /COMMENTS

To retrieve a list of comments, pass the same parameters you would in the liquid tags. eg. {'tag': 'featured'}

FUNCTION: GET

METHOD: GET

ENDPOINT: /COMMENTS/:ID

To retrieve a single comment, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: COMMENT

ENDPOINT: /COMMENTS

To create a single comment, minimum required fields are:
  1. Title
  2. Type
  3. Permalink

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /COMMENTS/:ID

To update a single comment.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /COMMENTS/:ID

To remove a single comment.

Orders Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate orders created on the site.

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /ORDERS

To retrieve a list of orders, pass the same parameters you would in the liquid tags. eg. {'tag': 'featured'}

FUNCTION: GET

METHOD: GET

ENDPOINT: /ORDERS/:ID

To retrieve a single order, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: ORDER

ENDPOINT: /ORDERS

To create a single order, minimum required fields are:
  1. Title
  2. Type
  3. Permalink

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /ORDERS/:ID

To update a single order.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /ORDERS/:ID

To remove a single order.


Variants Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate posts created on the site.

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /VARIANTS

To retrieve a list of variants, pass the same parameters you would in the liquid tags. eg. {'tag': 'featured'}

FUNCTION: GET

METHOD: GET

ENDPOINT: /VARIANTS/:ID

To retrieve a single variant, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: VARIANT

ENDPOINT: /VARIANTS

To create a single variant, minimum required fields are:
  1. Title
  2. Type
  3. Permalink

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /VARIANTS/:ID

To update a single variant.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /VARIANTS/:ID

To remove a single variant.


Users Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate users created on the site.

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /USERS

To retrieve a list of users, pass the same parameters you would in the liquid tags. eg. {'tag': 'featured'}

FUNCTION: GET

METHOD: GET

ENDPOINT: /USERS/:ID

To retrieve a single user, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: POST

ENDPOINT: /USERS

To create a single user, minimum required fields are:
  1. Title
  2. Type
  3. Permalink

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /USERS/:ID

To update a single user.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /USERS/:ID

To remove a single user.

Files Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate files created on the site.

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /FILES

To retrieve a list of files, pass the same parameters you would in the liquid tags. eg. {'tag': 'featured'}

FUNCTION: GET

METHOD: GET

ENDPOINT: /FILES/:ID

To retrieve a single file, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: POST

ENDPOINT: /FILES

To create a single file, minimum required fields are:
  1. Title
  2. Type
  3. Permalink

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /FILES/:ID

To update a single file.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /FILES/:ID

To remove a single file.

Leads Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate leads created on the site.

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /LEADS

To retrieve a list of leads, pass the same parameters you would in the liquid tags. eg. {'tag': 'featured'}

FUNCTION: GET

METHOD: GET

ENDPOINT: /LEADS/:ID

To retrieve a single lead, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: POST

ENDPOINT: /LEADS

To create a single lead, minimum required fields are:
  1. Title
  2. Body
  3. User Email
  4. User Name

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /LEADS/:ID

To update a single lead.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /LEADS/:ID

To remove a single lead.

Templates Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate templates created on the site.

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /TEMPLATES

To retrieve a list of templates, pass the same parameters you would in the liquid tags. eg. {'tag': 'featured'}

FUNCTION: GET

METHOD: GET

ENDPOINT: /TEMPLATES/:ID

To retrieve a single template, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: POST

ENDPOINT: /TEMPLATES

To create a single template, minimum required fields are:
  1. Title
  2. Type

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /TEMPLATES/:ID

To update a single template.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /TEMPLATES/:ID

To remove a single template.

Posts Module #back to top

This module contains functions that interface with the FleekSite REST API Endpoint to manipulate posts created on the site.

Sometimes, you want to use javascript to load your assets - and we've got you covered.

We have a few endpoints:

Namespace: /api/v1


FUNCTION: LIST

METHOD: GET

ENDPOINT: /POSTS

To retrieve a list of posts, pass the same parameters you would in the liquid tags. eg. {"tag": "featured"}

FUNCTION: GET

METHOD: GET

ENDPOINT: /POSTS/:ID

To retrieve a single post, accepts both the ID and UID fields for the ID parameter.

FUNCTION: CREATE

METHOD: POST

ENDPOINT: /POSTS

To create a single post, minimum required fields are:
  1. Title
  2. Type
  3. Permalink

FUNCTION: UPDATE

METHOD: PATCH/PUT

ENDPOINT: /POSTS/:ID

To update a single post.

FUNCTION: DELETE

METHOD: DELETE

ENDPOINT: /POSTS/:ID

To remove a single post.