Beauty Playbook Documentation
website·Indexed 29 days ago
https://witty-coast-024eee41e.6.azurestaticapps.netResources 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.
What's inside Beauty Playbook
- 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.
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 theblog/directory using the naming conventionYYYY-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.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.
Create a new documentation page in Docusaurus
To create a new document, create a Markdown file within thedocsdirectory. For example, creatingdocs/hello.mdwill make the document available at the URL path/docs/hello.# Hello This is my **first Docusaurus document**!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> !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
ratingsarray 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" } ]} />Manage Comparison Table data and templates
Comparison Table data is managed via the table editor located at/admin/table-editor. To create a reusable starting point for new comparison tables, create a new table and include-templatein the table name.Create a blog post in Docusaurus
Docusaurus automatically generates a page for each blog post file created in theblog/directory. It also provides a blog index page, a tag system, and an RSS feed. To create a post, create a markdown file in theblog/folder using a filename pattern likeYYYY-MM-DD-title.md. The post's URL is determined by theslugdefined 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.Create standalone pages using the src/pages directory
To create a standalone page, add a Markdown (.md) or React (.js) file to thesrc/pagesdirectory. 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/barUse the ComparisonBlock component to compare two services
TheComparisonBlockcomponent 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>Create callouts using Admonitions
Docusaurus provides a special syntax using triple colons (:::) to create themed admonitions and callouts, such astipordanger.:::tip[My tip] Use this awesome feature option ::: :::danger[Take care] This action is dangerous :::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.