Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gravity-ui/blog-constructor

Package Overview
Dependencies
Maintainers
8
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gravity-ui/blog-constructor

Gravity UI Blog Constructor

  • 4.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-47.06%
Maintainers
8
Weekly downloads
 
Created
Source

@gravity-ui/blog-constructor · npm package CI CI storybook

Install

npm install @gravity-ui/blog-constructor

Blog-constructor

Blog-constructor is a library based on the Page-constructor library for creating blog format web pages. Blog-constructor uses the custom prop from page-constructor to add the components needed for the blog.

Documentation - storybook

Getting started

The blog-constructor has both client components and server components for import. The blog pages is imported as a React component. To make sure it runs properly, wrap it in BlogConstructorProvider:

import {BlogPage, BlogConstructorProvider} from '@gravity-ui/blog-constructor';

// Main blog page
<BlogConstructorProvider {...providerProps}>
    <BlogPage
        content={content}
        posts={posts}
        tags={tags}
        getPosts={handleGetPosts}
        settings={settings}
    />
</BlogConstructorProvider>

---

import {BlogPostPage, BlogConstructorProvider} from '@gravity-ui/blog-constructor';

// Post page
<BlogConstructorProvider {...providerProps}>
    <BlogPostPage
        content={content}
        post={post}
        suggestedPosts={suggestedPosts}
        settings={settings}
        shareOptions={shareOptions}
    />
</BlogConstructorProvider>

Documentation about providerProps.

Also blog-constructor have server components to help you transform your data if you need

import {
  transformPost,
  sanitizeMeta,
  createReadableContent,
  transformPageContent,
} from '@gravity-ui/blog-constructor/server';

i18n

To make sure the i18n library used in your project runs properly, perform its initialization and set the project's current locale value in lang. For example:

import {configure, Lang} from '@gravity-ui/blog-constructor';

configure({lang: Lang.En});

Development

npm ci
npm run dev

FAQs

Package last updated on 28 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc