Skip to content

Commit

Permalink
Update docs to admin v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgr committed Oct 31, 2023
1 parent a820eb2 commit 55f1737
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 115 deletions.
25 changes: 14 additions & 11 deletions docs/getting-started/creating-a-site/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,28 @@ description: |

- Read deco.cx's [**Overview**](/docs/en/overview).

> You can always ask for help or more info on our [discord server](https://deco.cx/discord)!
## Create a deco.cx website

1. Login/Signup on [https://deco.cx/admin](https://deco.cx/admin).
2. Create a new **Team** if you aren't part of one yet.
3. Click on **+ Create Site**.
4. Set a name for your site.
5. **Important:** Select the **Start** template.
6. Click on **Create**.
1. Login/Signup on [https://admin.deco.cx/](https://admin.deco.cx/).
2. Choose your site's template.
3. Set a name for your site.
4. Set a name for your team.
5. Click on **+ Create Site**.
6. **Important:** Select the **Start** template.
7. Click on **Create**.

<img width="1512" alt="Creating a site on deco.cx" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/253386927-287e0b0d-5e96-46a3-9396-5cae24519bf3.png">
![Template selection](https://github.com/deco-sites/storefront/assets/882438/4c4323ec-2aec-4b08-a523-32f0761c8a36)

The site creation process will start and, after it finished, you'll see the site's dashboard:

<img width="1512" alt="Site Dashboard on deco.cx" src="https://github.com/deco-cx/deco/assets/18706156/13d2331e-86b2-4db5-b11a-2cff2ac807ac">
![Site Dashboard on deco.cx](https://github.com/deco-cx/apps/assets/882438/cac4147f-b013-40ca-bf68-e28ab40e831a)

## Navigating on your site

Right below **Production Domain** you can see your site's URL. This URL is public and the site is already online.
You can see your site's URL right below your site name. This URL is public and the site is already online.

You should see something similar to https://start.deco.cx, which was the template chosen in the creation process.
You should see something similar to https://deco-sites-start.deno.dev, which was the template chosen in the creation process.

> deco.cx is free up until 50.000 page view/visits per month. Check our [Pricing](https://www.deco.cx/en/pricing) for more info.
> deco.cx is free up until 5.000 page view/visits per month. Check our [Pricing](https://www.deco.cx/en/pricing) for more info.
14 changes: 8 additions & 6 deletions docs/getting-started/creating-a-site/pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,27 @@ descrição: |

- Leia [**Overview**](/docs/en/overview) da deco.cx.

> Você pode sempre pedir por ajuda ou mais informações no nosso [servidor discord](https://deco.cx/discord)!
## Crie um site deco.cx

1. Faça login/inscreva-se em [https://deco.cx/admin](https://deco.cx/admin).
2. Crie um novo **Time** caso ainda não faça parte de um.
2. Escolha um template para o seu site.
3. Clique em **+ Criar site**.
4. Defina um nome para seu site.
5. **Importante:** Selecione o modelo **Start**.
6. Clique em **Criar**.

<img width="1512" alt="Creating a site on deco.cx" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/253386927-287e0b0d-5e96-46a3-9396-5cae24519bf3.png">
![Seleção de templates](https://github.com/deco-sites/storefront/assets/882438/4c4323ec-2aec-4b08-a523-32f0761c8a36)

O processo de criação do site será iniciado e, após o término, você verá o painel do site:

<img width="1512" alt="Painel do site em deco.cx" src="https://github.com/deco-cx/deco/assets/18706156/13d2331e-86b2-4db5-b11a-2cff2ac807ac">
![Dashboard de site na deco.cx](https://github.com/deco-cx/apps/assets/882438/cac4147f-b013-40ca-bf68-e28ab40e831a)

## Navegando no site

Logo abaixo de **Domínio de Produção** você verá a URL do seu site. Essa URL é pública e o site já está online e acessível..
Logo abaixo no nome do seu projeto, você verá a URL do seu site. Essa URL é pública e o site já está online e acessível.

Você deve ver algo semelhante a https://start.deco.cx, que foi o modelo escolhido no processo de criação.
Você deve ver algo semelhante a https://deco-sites-start.deno.dev, que foi o modelo escolhido no processo de criação.

> A deco.cx é gratuita até 50.000 visualizações/visitas por mês. Verifique nossos [Preços](https://www.deco.cx/en/pricing) para mais informações.
> A deco.cx é gratuita até 5.000 visualizações/visitas por mês. Verifique nossos [Preços](https://www.deco.cx/en/pricing) para mais informações.
48 changes: 23 additions & 25 deletions docs/getting-started/updating-seo/en.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
---
description: |
How to edit a block in deco.cx
How to edit a block in deco.cx
---

Using deco.cx's Admin you can change the site's content without needing to change the code, thanks to the [Blocks](/docs/en/concepts/blocks) concept.
Let's begin updating the website information.
deco.cx allows you, through the Admin, to change content without the need for code changes, and this is done through the concept of [Blocks](/docs/en/concepts/blocks).

The first Block we can edit is the **SEO**, a saved Section that is used by the site's home page. This block configures important metadata about the page such as **title, description and thumbnail** (this information is used in social media previews).
The first Block we can edit is the **site**,
an [App](/docs/en/concepts/app) from deco that configures and prepares a project to operate as a website on the internet. This block configures important metadata about the page, including SEO data and title, description, and thumbnail (this information is used in social media previews).

Conveniently, you can preview how **SEO** is set up in the site's dashboard.
Conveniently, on the Site detail page in deco, you can preview how the **SEO** is configured.

Click on **Edit** on the top right to change its data. You will be redirected to the block editing page.
To edit it, click on **Edit** in the upper right corner. You will be redirected to the block editing page.

<img width="1401" alt="image" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/258239685-81217494-3b40-4025-9385-672cab77008e.png ">
![SEO Editing](https://github.com/deco-cx/apps/assets/882438/c7986877-6c2c-4f21-90e6-3634c73f22f6)

Our block editor is divided into two sections:

1. **Preview**: see how your block will be rendered, on the left. _(or some helpful UI if you're editing metadata)._
2. **Form**: edit the information that was made available by developers.
1. **Form**: edit the information that the people who created the block made available for editing on the right sidebar.
2. **Preview**: when applicable, preview how your block will be rendered on the left side.

In the page's _topbar_, you have access to:
- **URL bar**: test specific URLs for the block you are editing (useful for product pages, for example).
- **Performance Metrics:** check which resources this block is using and the amount of Javascript sent to the browser.
- **View/Edit Toggle**: Disable automatic _overlay_ in preview to test interactive block elements.
In the top bar of the page, you have access to:
- **Address bar**: test specific URLs for the block you are editing (useful for product pages, for example).

And in the sidebar, you can select other views of the page:
- **Performance Metrics:** see which resources this block is using and the amount of JavaScript being sent to the browser.
- **Revisions:** access the version history of the edited content.
- **JSON Editor:** edit form data as JSON.
- **Preview mode:**: disable the automatic overlay on the preview to test interactive elements of the block.

<img width="1512" alt="image" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/258239802-e6bc0f12-a996-4867-930a-df76daebdd9d.png ">
![editor](https://github.com/deco-cx/apps/assets/882438/ebcee0fc-1d97-4b2d-a5e9-54a873d88b1e)

All changes you make in the form are **automatically reflected** in the preview on the left. When you are editing pages, you can also use the preview to select specific sections and reorder them directly on the page.

Any changes you make to the form are **automatically reflected** in the preview on the left. When you're editing pages, you can also use preview to select specific Sections and reorder them right on the page.
## Editing SEO

## Editing the SEO
Edit the title, description, and image of your site's SEO according to what you are building and ensure that social media previews are as expected. You can try different versions to see what suits you best.

Edit your site's SEO title, description, and image to suit what you're building, and ensure social media previews behave as expected. You can test different versions to see what fits best.
After that, **click the Publish button** in the upper right to create a new revision of this block. Revisions are immutable versions of the data edited in deco and are used to track and roll back changes over time. Learn more about them [here](/docs/en/getting-started/releases-revisions).

After that, **click the Save button** on the top right to create a new revision of this block. Revisions are immutable versions of the edited data in the deco and are meant to be able to track and revert changes over time. Learn more about [here](/docs/en/getting-started/releases-revisio ns).

## Publishing the changes

To actually change your site's SEO _meta tags_, you need to publish the current revision you just saved. **Click the Publish button** to make the changes effective.

<img width="384" alt="image" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/258240949-394a198c-f25a-4a83-80a4-76f0aecf6b99.png ">

Ready! Now your site has up-to-date SEO data and you've learned how to edit a block in deco.cx.
There you go! Now your site has updated SEO data, and you have learned how to edit a block in deco.cx.
27 changes: 12 additions & 15 deletions docs/getting-started/updating-seo/pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,37 @@ description: |
Vamos começar a atualizar as informações do site.
A deco.cx permite que, através do Admin, seja possível alterar conteúdo sem precisar de mudanças de código, e isso é feito através do conceito de [Blocks](/docs/pt/concepts/blocks).

O primeiro Block que podemos editar é o **SEO**, uma Section salva que é usada pela página Home do site. Esse bloco configura metadados importantes sobre a página como título, descrição e miniatura (essas informações são usadas nos previews de redes sociais).
O primeiro Block que podemos editar é o de **site**,
um App da deco que configura e prepara um projeto para operar como website na internet. Esse bloco configura metadados importantes sobre a página, incluindo dados de SEO e título, descrição e miniatura (essas informações são usadas nos previews de redes sociais).

Convenientemente, na página de detalhe do Site na deco é possível pré-visualizar como o **SEO** está configurado.

Para editá-lo, clique em **Edit** na parte superior direita. Você será redirecionado para a página de edição de blocks.

<img width="1401" alt="image" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/258239685-81217494-3b40-4025-9385-672cab77008e.png">
![Edição do SEO](https://github.com/deco-cx/apps/assets/882438/c7986877-6c2c-4f21-90e6-3634c73f22f6)

Nosso editor de blocks é divido em duas seções:

1. **Preview**: pré-visualize como seu block será renderizado, na parte esquerda.
2. **Formulário**: edite as informações que as pessoas que criaram o block deixaram disponível para edição, na _sidebar_ direita.
1. **Formulário**: edite as informações que as pessoas que criaram o block deixaram disponível para edição, na _sidebar_ direita.
2. **Preview**: quando aplicável, pré-visualize como seu block será renderizado, na parte esquerda.

Na _topbar_ da página, você tem acesso à:
- **Barra de URL**: teste URLs específicas para o block que você está editando (útil para páginas de produto, por exemplo).
- **Métricas de Performance:** veja quais recursos esse block está usando e a quantidade de Javascript que está sendo enviada para o browser.
- **Toggle de visualização/edição**: desabilite o _overlay_ automático no preview para testar os elementos interativos do block.


<img width="1512" alt="image" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/258239802-e6bc0f12-a996-4867-930a-df76daebdd9d.png">
E na _sidebar_, é possível selecionar outras visões sobre a página:
- **Métricas de Performance:** veja quais recursos esse block está usando e a quantidade de Javascript que está sendo enviada para o browser.
- **Revisões:** acesse o histórico de versões do conteúdo sendo editado.
- **Editor de JSON:** edite os dados do formulário como um JSON.
- **Modo de visualização**: desabilite o _overlay_ automático no preview para testar os elementos interativos do block.

![editor](https://github.com/deco-cx/apps/assets/882438/ebcee0fc-1d97-4b2d-a5e9-54a873d88b1e)

Todas alterações que você faz no formulário são **automaticamente refletidas** no preview à esquerda. Quando você estiver editando páginas, também é possível usar o preview para selecionar Sections específicas e reordená-las direto na página.

## Editando o SEO

Edite o título, descrição e imagem do SEO do seu site de acordo com o que você está construindo e garanta que os previews das redes sociais estão conforme esperado. Você pode testar diferentes versões para ver o que mais lhe agrada.

Após isso, **clique no botão Salvar** na parte superior direita para criar uma nova revisão deste bloco. Revisões são versões imutáveis dos dados editados na deco e servem para conseguirmos acompanhar e revertar as mudanças ao longo do tempo. Saiba mais sobre [aqui](/docs/pt/getting-started/releases-revisions).

## Publicando as mudanças

Para de fato alterar as _metatags_ de SEO do site, é necessário publicar a revisão atual que você acabou de salvar. **Clique no botão Publicar** para efetivar as mudanças.

<img width="384" alt="image" src="https://github-production-user-asset-6210df.s3.amazonaws.com/18706156/258240949-394a198c-f25a-4a83-80a4-76f0aecf6b99.png">
Após isso, **clique no botão Publicar** na parte superior direita para criar uma nova revisão deste bloco. Revisões são versões imutáveis dos dados editados na deco e servem para conseguirmos acompanhar e revertar as mudanças ao longo do tempo. Saiba mais sobre [aqui](/docs/pt/getting-started/releases-revisions).

Pronto! Agora seu site está com os dados de SEO atualizados e você aprendeu como editar um block na deco.cx.
103 changes: 74 additions & 29 deletions docs/overview/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ with [Preact](https://preactjs.com/), [Tailwind](https://tailwindcss.com) and
[Deno](https://deno.land/). We are the platform to create headless commerce
experiences.

<img width="1512" alt="image" src="https://user-images.githubusercontent.com/18706156/224878795-66bc06b8-10bf-4285-9833-d375137e8914.png">
![deco admin](https://github.com/deco-cx/apps/assets/882438/5a497330-93e5-497d-a572-fde44421d6ac)

When you create a site in _deco.cx_, it's automatically **deployed on the edge
in 34 regions world-wide** on [Deno Deploy](https://deno.com). This means your
in 35 regions world-wide** on [Deno Deploy](https://deno.com). This means your
pages are served close to users, ensuring lightning-fast performance.
Additionally, we provide you with a Github repository where you can manage your
code and collaborate with others on your team. With _deco.cx_, you can focus on
Expand Down Expand Up @@ -45,43 +45,88 @@ edit text and images without needing to write any code themselves.
This is what a _deco.cx_'s [Section](/docs/en/concepts/section) looks like:

```tsx
import ProductCard from "$store/components/product/ProductCard.tsx";
import Container from "$store/components/ui/Container.tsx";
import Text from "$store/components/ui/Text.tsx";
import ProductCard, {
Layout as cardLayout,
} from "$store/components/product/ProductCard.tsx";
import Icon from "$store/components/ui/Icon.tsx";
import Header from "$store/components/ui/SectionHeader.tsx";
import Slider from "$store/components/ui/Slider.tsx";
import type { Product } from "deco-sites/std/commerce/types.ts";
import SliderJS from "$store/islands/SliderJS.tsx";
import { useId } from "$store/sdk/useId.ts";
import { useOffer } from "$store/sdk/useOffer.ts";
import { usePlatform } from "$store/sdk/usePlatform.tsx";
import type { Product } from "apps/commerce/types.ts";

export interface Props {
title: string;
products: Product[];
products: Product[] | null;
title?: string;
description?: string;
layout?: {
headerAlignment?: "center" | "left";
headerfontSize?: "Normal" | "Large";
};
cardLayout?: cardLayout;
}

function ProductShelf({
title,
products,
title,
description,
layout,
cardLayout,
}: Props) {
const id = useId();
const platform = usePlatform();

if (!products || products.length === 0) {
return null;
}

return (
<Container class="flex flex-col items-center gap-10 py-10">
{title && (
<h2>
<Text variant="heading-2">{title}</Text>
</h2>
)}
<Slider class="gap-6">
{products?.map((product, index) => {
const ml = index === 0 ? "ml-6 sm:ml-0" : "";
const mr = index === products.length - 1 ? "mr-6 sm:mr-0" : "";

return (
<div
class={`min-w-[220px] max-w-[220px] sm:min-w-[287px] sm:max-w-[287px] ${ml} ${mr}`}
<div class="w-full container py-8 flex flex-col gap-12 lg:gap-16 lg:py-10">
<Header
title={title || ""}
description={description || ""}
fontSize={layout?.headerfontSize || "Large"}
alignment={layout?.headerAlignment || "center"}
/>

<div
id={id}
class="container grid grid-cols-[48px_1fr_48px] px-0 sm:px-5"
>
<Slider class="carousel carousel-center sm:carousel-end gap-6 col-span-full row-start-2 row-end-5">
{products?.map((product, index) => (
<Slider.Item
index={index}
class="carousel-item w-[270px] sm:w-[292px] first:pl-6 sm:first:pl-0 last:pr-6 sm:last:pr-0"
>
<ProductCard key={index} product={product} />
</div>
);
})}
</Slider>
</Container>
<ProductCard
product={product}
itemListName={title}
layout={cardLayout}
platform={platform}
index={index}
/>
</Slider.Item>
))}
</Slider>

<>
<div class="hidden relative sm:block z-10 col-start-1 row-start-3">
<Slider.PrevButton class="btn btn-circle btn-outline absolute right-1/2 bg-base-100">
<Icon size={24} id="ChevronLeft" strokeWidth={3} />
</Slider.PrevButton>
</div>
<div class="hidden relative sm:block z-10 col-start-3 row-start-3">
<Slider.NextButton class="btn btn-circle btn-outline absolute left-1/2 bg-base-100">
<Icon size={24} id="ChevronRight" strokeWidth={3} />
</Slider.NextButton>
</div>
</>
<SliderJS rootId={id} />
</div>
</div>
);
}

Expand Down
Loading

0 comments on commit 55f1737

Please sign in to comment.