Skip to content

PageDepot: Installation

Back to PageDepot.

  1. Install the following prerequisites first:

  2. Clone the PageDepot repository:

    Terminal window
    git clone git@gitlab.kiwis-and-brownies.de:kibro/brezelproducts/kab/page-depot.git
  3. Install dependencies:

    Terminal window
    npm install

    Go to the templates directory and install dependencies for each template:

    Terminal window
    cd templates/astrowind && npm install
  4. Fill out your PageDepot .env:

    APP_ENV=local
    DEPOT_SECRET=<choose a secret>
    # WEBSOCKET_PORT=6001
    # PORT=3000
    # REDIS_HOST=127.0.0.1
    # REDIS_PORT=6379
    REDIS_PASSWORD=<specify the password>
    # Only needed when you want to use ingress management in your Kubernetes cluster:
    # DEPOT_BASE_DOMAIN=kab.page
    # DEPOT_INGRESS_NAMESPACE=page-depot
    # DEPOT_INGRESS_NAME=external-domains
    # DEPOT_SERVICE_NAME=page-depot
    # Only needed when you want to use hostnames in your Cloudflare zones:
    # CLOUDFLARE_ZONE_ID=
    # CLOUDFLARE_TOKEN=

    In your Brezel .env, specify the following environment variables:

    • PAGE_DEPOT_URL: the full URL to the PageDepot service. Usually https://kab.page.
    • PAGE_DEPOT_WS_HOST: the hostname of the PageDepot websockets service. Usually ws.kab.page.
    • PAGE_DEPOT_SECRET: the secret used to access the PageDepot service (DEPOT_SECRET).
  5. To start the web and websocket servers, run the following inside PageDepot:

    Terminal window
    npm run start

You can use PageDepot in Brezel via the action/buildSite and action/buildSite workflow elements.

For building a site, you need the following modules:

A template has a name and a base template. It is just a logical entity to specify what base template a layout should use. The actual contents and structures of base templates are not configurable. But choosing the base template has consequences for how to write the code of sections and choosing a **base layout **.

Available base templates in Astro are:

  • Astrowind (astrowind)

A layout has a name, a base layout, scripts and slots. The base layout always refers to a layout file inside the base template. This file is usually an Astro file that defines slots that you can fill. While the layout can fill slots defined by the base layout, the layout can also provide slots to be filled by pages that inherit from it.

Available base layouts are:

PageLayout.astro (extends BaseLayout.astro)
Section titled “PageLayout.astro (extends BaseLayout.astro)”

Slots: announcements, header, default, footer

This is the recommended base layout.

Slots: default

Slots: default

Pages define what pages of the static site are generated. A page has a name, a layout, slots, parameters as well as a title, description and scripts.

The layout specifies what layout the page inherits, and thus also what slots the page can fill.

The slots specify the filling of the slots of the parent layout with sections, and what parameters the sections are initialized with.

The slot name defines what slot should be overwritten. Each slot can have a list of sections. Each section, in turn, is an object that has a section definition, section parameters, and section subslots. The section definition is an entity of the module defining the sections (usually called sections). The Section parameters are the inputs to that section, and correspond to the section entity’s props.

Example section entity “Post”:

{
"id": 10,
"name": "Post",
"type": "vue",
"props": {
"post": {
"type": "select",
"options": {
"references": "posts"
}
}
},
"code": "<template><div>{{ post.title }}</div></template><script>export default { props: { post: Object } }</script>"
}

Example value of a page’s slots where this section entity is used:

[
{
"slot": "default",
"sections": [
{
"section": {
"id": 10
},
"params": {
"post": {
"id": 42
}
}
}
]
}
]

This means that the default slot in the page’s layout is filled with one section, a “Post”, with its post prop filled with the post entity 42.

The name defines the route where the page will be accessible. For example, the name posts will make the page available at https://mysite.kab.page/posts. The name posts/[lang]/[post] will, for example, make the page available at https://mysite.kab.page/posts/en/lorem-ipsum, depending on parameters given for [lang] and [post].