Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Themes Documentation page update #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 64 additions & 20 deletions pages/api/create-a-new-page/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,26 @@ POST /api/pages/{key}

<h2 id="parameters">Parameters</h2>

| key | value | Default value |
|-----|-------|---------------|
| `required` token | `string` API Token. | |
| `required` authentication | `string` Authentication token. | |
| title | `string` Page title. | |
| content | `string` Page content. | |
| tags | `string` Page tags, separated by comma. | |
| type | `string` Page type. | |
| date | `string` Page date (formatted as "YYYY-MM-DD Hours:Minutes:Seconds"). | |
| slug | `string` Page URL slug. | (Derived from lowercased title) |
| dateModified | `string` Page modified date. | |
| position | `string` Page position. | |
| coverImage | `string` Page cover image. | |
| category | `string` Page category. | |
| template | `string` Page template. | |
| noindex | `string` Page noindex. | |
| nofollow | `string` Page nofollow. | |
| noarchive | `string` Page noarchive. | |
| key | value |
|-----|-------|
| `required` token | `string` API Token. |
| `required` authentication | `string` Authentication token. |
| title | `string` Page title. |
| content | `string` Page content. |
| description | `string` Page description. |
| tags | `string` Page tags, separated by comma. |
| type | `string` Page type. |
| date | `string` Page date (formatted as "YYYY-MM-DD Hours:Minutes:Seconds"). |
| dateModified | `string` Page modified date. |
| slug | `string` Page URL slug. |
| position | `string` Page position. |
| coverImage | `string` Page cover image. |
| category | `string` Page category. |
| template | `string` Page template. |
| noindex | `string` Page noindex. |
| nofollow | `string` Page nofollow. |
| noarchive | `string` Page noarchive. |
| custom | `map` Custom field. |

<h2 id="response">Response</h2>

Expand All @@ -57,8 +59,10 @@ Body:
}
```

<h2 id="curl-example">CURL command example</h2>
Here is an example that shows you how to create a new page via the command line with the `curl` command. The `data.json` file has the basic data needed to create a new page.
<h2 id="curl-example-1">CURL command example 1</h2>
This example shows you how to create a new page via the command line with the `curl` command.

The `data.json` file has the basic data needed to create a new page.

Content of file `data.json`:

Expand Down Expand Up @@ -91,3 +95,43 @@ Response Body
}
}
```

<h2 id="curl-example-2">CURL command example 2</h2>
This example shows you how to create a new page via the command line with the `curl` command and include custom fields.

First, you need to create the custom field, follow the [Quick example](https://docs.bludit.com/en/content/custom-fields#quick-example) from the documentation to create the custom field `subtitle`.

Create a file `data.json` with the page's fields.

```bash
{
"token": "24a8857ed78a8c89a91c99afd503afa7",
"authentication": "193569a9d341624e967486efb3d36d75",
"title": "My dog",
"content": "Content of the page here, support Markdown code and HTML code.",
"custom": {
"subtitle": "Mi perro dinamita"
}
}
```

Execute the command and attach the `data.json` file:

```bash
$ curl -X POST \
-H "Content-Type: application/json" \
-d @data.json \
"https://www.example.com/api/pages"
```

Response Body

```bash
{
"status": "0",
"message": "Page created.",
"data": {
"key": "my-dog"
}
}
```
88 changes: 44 additions & 44 deletions pages/developers/folder-structure/index.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
# Folder structure
# Structure of directories and files
<!-- position: 2 -->

Here's the basic folder structure for Bludit.
## First layer of directories
```
/bl-content/ <-- Databases and uploaded images
/bl-kernel/ <-- Core of Bludit
/bl-languages/ <-- Languages files
/bl-plugins/ <-- Plugins
/bl-themes/ <-- Themes
/bl-content/ <-- Databases and images
/bl-kernel/ <-- Bludit's core
/bl-languages/ <-- Languages files for Bludit's core
/bl-plugins/ <-- Plugins
/bl-themes/ <-- Themes
```

## bl-content
This folder is very important, as it is where Bludit stores all files, as well as databases and images. Before updating your Bludit installation, it's highly recommended to make a backup of this folder.
This directory is very important, as it is where Bludit store all the files, databases and images.

Before updating Bludit, it's highly recommended to make a backup of this directory.

```
/bl-content/

databases/
plugins/ <-- Database: plugins
pages.php <-- Database: pages
security.php <-- Database: black list, brute force protection, others
site.php <-- Database: site variables, name, description, slogan, others
tags.php <-- Database: tags
users.php <-- Database: users
databases/
plugins/ <-- Database: plugins
pages.php <-- Database: pages
security.php <-- Database: black list, brute force protection, others
site.php <-- Database: site variables, name, description, slogan, others
tags.php <-- Database: tags
users.php <-- Database: users

pages/ <-- Content: pages
about/index.txt
food/index.txt
pages/
about/index.txt <-- Page "about", the url match with the directory path, https://mydomain/about
food/index.txt

tmp/ <-- Temp files
tmp/ <-- Temp files

uploads/ <-- Uploaded files
profiles/ <-- Profiles images
thumbnails/ <-- Thumbnails images
photo1.jpg
photo2.png
uploads/ <-- Uploaded files
profiles/ <-- Profiles images
pages/about/ <-- Files and images for the page "about"

workspaces/ <-- Workspaces for the plugins
workspaces/ <-- Workspaces for the plugins
```

## bl-kernel
This folder contains the core of Bludit.
This directory contains the core of Bludit.

## bl-languages
This folder contains all language files. Each file is a JSON document, encoded in UTF-8.
This directory contains all language files. Each file is a JSON document, encoded in UTF-8.

```
/bl-languages/
bg_BG.json
cs_CZ.json
de_CH.json
en.json
es.json
...
bg_BG.json
cs_CZ.json
de_CH.json
en.json
es.json
...
```

## bl-plugins
This folder contains all plugins. New plugins you download should be uploaded here.
This directory contains all plugins. New plugins you download should be uploaded here.

```
/bl-plugins/
about/
disqus/
rss/
sitemap/
tinymce/
...
about/
disqus/
rss/
sitemap/
tinymce/
...
```

## bl-themes
This folder contains all themes. New themes you download should be uploaded here.
This directory contains all themes. New themes you download should be uploaded here.

```
/bl-themes/
alternative/
blogx/
...
alternative/
blogx/
...
```
26 changes: 26 additions & 0 deletions pages/developers/pages-files-and-images/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Pages' files and images
<!-- position: 3 -->

The files and images are store in the directory `/bl-content/uploads/pages/<page key>`.

## Thumbnails
The thumbnails are generate when the user uploaded an image to the page.

There are 2 thumbnails, small and medium. You can configure the size and the quality of the thumbnails from the Bludit's settings.

The thumbnails are store in the same directory as the original image.

Original image uploaded path for the page "about".
```
/bl-content/uploads/pages/about/photo1.jpg
```

Small size thumbnail for the image "photo1.jpg" for the page "about".
```
/bl-content/uploads/pages/about/photo1-thumbnail-s.jpg
```

Medium size thumbnail for the image "photo1.jpg" for the page "about".
```
/bl-content/uploads/pages/about/photo1-thumbnail-m.jpg
```
30 changes: 15 additions & 15 deletions pages/themes/example-my-second-theme/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Let's work on the `index.php` file; create the file inside the `/bl-themes/mars/

<h2 id="css-files">CSS files</h2>
Add some CSS files:
- Using the Helper object `Theme::css()`
- Using the Helper object `HTML::css()`
- or using the HTML tag `<link href="..." rel="stylesheet" type="text/css" />`

In this case, we are going to use the Helper to add the CSS file `/bl-themes/mars/css/style.css`. With the Helper, you don't need to specify the absolute path.
Expand All @@ -78,7 +78,7 @@ In this case, we are going to use the Helper to add the CSS file `/bl-themes/mar
<meta charset="UTF-8">

<!-- CSS -->
<?php echo Theme::css('css/style.css') ?>
<?php echo HTML::css('css/style.css') ?>
</head>
<body>

Expand All @@ -88,7 +88,7 @@ In this case, we are going to use the Helper to add the CSS file `/bl-themes/mar

<h2 id="javascript-files">Javascript files</h2>
Add some Javascript files:
- Using the Helper object `Theme::js()`
- Using the Helper object `HTML::js()`
- or using the HTML tag `<script>...</script>`

In this case, we are going to use the Helper to add the Javascript file `/bl-themes/mars/js/mars.js`. With the Helper you don't need to specify the absolute path.
Expand All @@ -100,10 +100,10 @@ In this case, we are going to use the Helper to add the Javascript file `/bl-the
<meta charset="UTF-8">

<!-- CSS -->
<?php echo Theme::css('css/style.css') ?>
<?php echo HTML::css('css/style.css') ?>

<!-- Javascript -->
<?php echo Theme::js('js/mars.js') ?>
<?php echo HTML::js('js/mars.js') ?>
</head>
<body>

Expand All @@ -126,10 +126,10 @@ The plugin hooks for the site are as follows:
<meta charset="UTF-8">

<!-- CSS -->
<?php echo Theme::css('css/style.css') ?>
<?php echo HTML::css('css/style.css') ?>

<!-- Javascript -->
<?php echo Theme::js('js/mars.js') ?>
<?php echo HTML::js('js/mars.js') ?>

<!-- Load plugins with the hook siteHead -->
<?php Theme::plugins('siteHead') ?>
Expand All @@ -156,10 +156,10 @@ You can use the Site-Object to get the logo, title and slogan.
<meta charset="UTF-8">

<!-- CSS -->
<?php echo Theme::css('css/style.css') ?>
<?php echo HTML::css('css/style.css') ?>

<!-- Javascript -->
<?php echo Theme::js('js/mars.js') ?>
<?php echo HTML::js('js/mars.js') ?>

<!-- Load plugins with the hook siteHead -->
<?php Theme::plugins('siteHead') ?>
Expand Down Expand Up @@ -190,10 +190,10 @@ To locate what page the user is browsing on the site, you can use the variable `
<meta charset="UTF-8">

<!-- CSS -->
<?php echo Theme::css('css/style.css') ?>
<?php echo HTML::css('css/style.css') ?>

<!-- Javascript -->
<?php echo Theme::js('js/mars.js') ?>
<?php echo HTML::js('js/mars.js') ?>

<!-- Load plugins with the hook siteHead -->
<?php Theme::plugins('siteHead') ?>
Expand Down Expand Up @@ -227,10 +227,10 @@ If the user is on the home page, Bludit generates a global array `$pages` with a
<meta charset="UTF-8">

<!-- CSS -->
<?php echo Theme::css('css/style.css') ?>
<?php echo HTML::css('css/style.css') ?>

<!-- Javascript -->
<?php echo Theme::js('js/mars.js') ?>
<?php echo HTML::js('js/mars.js') ?>

<!-- Load plugins with the hook siteHead -->
<?php Theme::plugins('siteHead') ?>
Expand Down Expand Up @@ -265,10 +265,10 @@ If the user is viewing a particular page, Bludit generates a global Page-Object
<meta charset="UTF-8">

<!-- CSS -->
<?php echo Theme::css('css/style.css') ?>
<?php echo HTML::css('css/style.css') ?>

<!-- Javascript -->
<?php echo Theme::js('js/mars.js') ?>
<?php echo HTML::js('js/mars.js') ?>

<!-- Load plugins with the hook siteHead -->
<?php Theme::plugins('siteHead') ?>
Expand Down
Loading