Beauty Playbook Documentation

website·Indexed 29 days ago

https://witty-coast-024eee41e.6.azurestaticapps.net

Resources for managing and publishing content, featuring a library of components such as ComparisonBlock, Star Reviews, Key Features, Quote Component, and Elite Eight. Includes guides for creating blog posts, press releases, and pages using Hygraph CMS and Docusaurus.

Tokens
5.2K
Snippets
27
Records
47
Agent score
49%

What's inside Beauty Playbook

  1. Overview of Beauty Playbook Components

    Beauty Playbook components are pre-made React components designed to ensure content added in Hygraph adheres to the Beauty Playbook design system. These components are integrated directly into the markdown documents of BP Posts within the Vagaro Hygraph Project; once added to the content flow, they are automatically rendered with the appropriate styling.
  2. Create a blog post in Docusaurus

    Docusaurus automatically generates a page for each blog post, along with a blog index page, a tag system, and an RSS feed. To create a new post, create a markdown file within the blog/ directory using the naming convention YYYY-MM-DD-title.md.
    ---
    slug: greetings
    title: Greetings!
    authors:
      - name: Joel Marcey
        title: Co-creator of Docusaurus 1
        url: https://github.com/JoelMarcey
        image_url: https://github.com/JoelMarcey.png
      - name: Sébastien Lorber
        title: Docusaurus maintainer
        url: https://sebastienlorber.com
        image_url: https://github.com/slorber.png
    tags: [greetings]
    ---
    
    Congratulations, you have made your first post!
    
    Feel free to play around and edit this post as much as you like.
  3. Add components to Hygraph CMS pages

    Hygraph supports the insertion of pre-built components directly into the content section of a page. Available components include:

    • Text blocks
    • Image galleries
    • Video embeds
    • Custom React components

    For specialized components such as quotes or comparison tables, refer to the Beauty Playbook Components documentation.

  4. Use React components in Markdown via MDX

    Docusaurus supports MDX, allowing developers to export and use React components directly within Markdown files to create interactive documentation.
    export const Highlight = ({children, color}) => (
      <span
        style={{
          backgroundColor: color,
          borderRadius: '20px',
          color: '#fff',
          padding: '10px',
          cursor: 'pointer',
        }}
        onClick={() => {
          alert(`You clicked the color ${color} with label ${children}`)
        }}>
        {children}
      </span>
    );
    
    This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
  5. Implement the Star Reviews component in Hygraph

    The Star Reviews component displays a block of text containing a rating and the number of reviews. To use it, copy the component code and paste it into the content section of a BP Post in Hygraph. The component accepts a ratings array of objects, where each object defines a specific rating entry with the following properties:

    • rating: The numerical rating value.
    • imgSrc: The URL source for the rating image.
    • reviews: The number of reviews to display.
    • height: The height of the image.
    • width: The width of the image.
    • imageClassName: CSS classes for styling the image (e.g., Tailwind CSS classes).
     <StarRating ratings={[
        {
          rating: 4.5,
          imgSrc: "https://us-west-2.graphassets.com/AalLHDRueT6SDLkGLppQVz/cm9ivig4dpt4g07n83a2d9k5m",
          reviews: 4,
          height: 80,
          width: 80,
          imageClassName: "w-10 h-10"
        },
        {
          rating: 4.8,
          imgSrc: "https://us-west-2.graphassets.com/AalLHDRueT6SDLkGLppQVz/cm9ivig9vq2q208lfn0myyfzh",
          reviews: 12,
          height: 60,
          width: 120,
          imageClassName: "w-32 h-auto"
        },
        {
          rating: 4.2,
          imgSrc: "https://us-west-2.graphassets.com/AalLHDRueT6SDLkGLppQVz/cm9ivig4lpt4l07n86wujs5dj",
          reviews: 8,
          height: 70,
          width: 200,
          imageClassName: "w-42 h-auto"
        }
      ]} />
  6. Create a blog post in Docusaurus

    Docusaurus automatically generates a page for each blog post file created in the blog/ directory. It also provides a blog index page, a tag system, and an RSS feed. To create a post, create a markdown file in the blog/ folder using a filename pattern like YYYY-MM-DD-title.md. The post's URL is determined by the slug defined in the front matter.
    ---
    slug: greetings
    title: Greetings!
    authors:
      - name: Joel Marcey
        title: Co-creator of Docusaurus 1
        url: https://github.com/JoelMarcey
        image_url: https://github.com/JoelMarcey.png
      - name: Sébastien Lorber
        title: Docusaurus maintainer
        url: https://sebastienlorber.com
        image_url: https://github.com/slorber.png
    tags: [greetings]
    ---
    
    Congratulations, you have made your first post!
    
    Feel free to play around and edit this post as much as you like.
  7. Create standalone pages using the src/pages directory

    To create a standalone page, add a Markdown (.md) or React (.js) file to the src/pages directory. The file system path determines the URL route of the page.
    src/pages/index.js      -> localhost:3000/
    src/pages/foo.md        -> localhost:3000/foo
    src/pages/foo/bar.js    -> localhost:3000/foo/bar
  8. Use the ComparisonBlock component to compare two services

    The ComparisonBlock component creates a two-column layout to compare two companies or products. It is used by pasting the component into the content section of a BP Post in Hygraph. The component accepts text or markdown content within two <div> tags: the first <div> renders in the left column (Company A) and the second <div> renders in the right column (Company B).
    <ComparisonBlock 
      companyA="VAGARO" 
      companyB="GLOSS GENIUS" 
      companyAStatus="check" 
      companyBStatus="x"
    >
      <div>
        Content for Company A (Left Column). Supports markdown.
      </div>
    
      <div>
        Content for Company B (Right Column). Supports markdown.
      </div>
    </ComparisonBlock>
  9. Create a new page in Hygraph CMS

    To create a new page in Hygraph CMS, navigate to the Content section and add a new entry to the Page content type. You must configure the following fields:

    • Title: The display title of the page.
    • Slug: The URL path for the page.
    • SEO Model: Define the SEO title, description, and keywords. Use the 'No Index' setting for pages under construction.
    • Content: Use the rich text editor to add page content.
    • Featured Image: Upload an optional image for the page.

    After filling in the details, click 'Save' to keep the page as a draft or 'Save & Publish' to make it live. Note that new pages require a site build and may take a few hours to appear live.