PageDepot: Installation
Installation
Section titled “Installation”-
Install the following prerequisites first:
-
Clone the PageDepot repository:
Terminal window git clone git@gitlab.kiwis-and-brownies.de:kibro/brezelproducts/kab/page-depot.git -
Install dependencies:
Terminal window npm installGo to the
templatesdirectory and install dependencies for each template:Terminal window cd templates/astrowind && npm install -
Fill out your PageDepot
.env:APP_ENV=localDEPOT_SECRET=<choose a secret># WEBSOCKET_PORT=6001# PORT=3000# REDIS_HOST=127.0.0.1# REDIS_PORT=6379REDIS_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. Usuallyhttps://kab.page.PAGE_DEPOT_WS_HOST: the hostname of the PageDepot websockets service. Usuallyws.kab.page.PAGE_DEPOT_SECRET: the secret used to access the PageDepot service (DEPOT_SECRET).
-
To start the web and websocket servers, run the following inside PageDepot:
Terminal window npm run start
Usage in Brezel
Section titled “Usage in Brezel”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 templates module with SiteBuilderTemplate capabilities
- a layouts module with PageDepotLayout capability
- a pages module with PageDepotPage capability
- a sections module with PageDepotSection capability
Templates
Section titled “Templates”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)
Layouts
Section titled “Layouts”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:
Astrowind
Section titled “Astrowind”PageLayout.astro (extends BaseLayout.astro)
Section titled “PageLayout.astro (extends BaseLayout.astro)”Slots: announcements, header, default, footer
This is the recommended base layout.
BaseLayout.astro
Section titled “BaseLayout.astro”Slots: default
MarkdownLayout.astro
Section titled “MarkdownLayout.astro”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.
Layout
Section titled “Layout”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].