How to use @sindresorhus/slugify - 10 common examples

To help you get started, we’ve selected a few @sindresorhus/slugify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github saasify-sh / saasify / packages / react-saasify / src / components / Section / Section.js View on Github external
const {
      inverted,
      stretch,
      title,
      subtitle,
      desc,
      id,
      className,
      style = {},
      children
    } = this.props

    const sectionProps = {}

    if (id || title) {
      sectionProps.id = id || slugify(title.toLowerCase())
    }

    const themeArgs = [
      styles,
      'section',
      theme(styles, `${sectionProps.id}-section`),
      inverted && theme(styles, 'inverted'),
      className
    ]

    return (
github keystonejs / keystone / packages / fields / src / types / Slug / Implementation.js View on Github external
const generateSlug = valueToSlugify => slugify(valueToSlugify || '');
github vadimdemedes / draqula / docs / src / components / mdx / H2.js View on Github external
const H2 = ({children}) => (
	<a id="{slugify(children)}" href="{`#${slugify(children)}`}">
		<h1>{children}</h1>
	</a>
);
github atomiclabs / hyperdex / app / renderer / views / Settings / Export.js View on Github external
handleClick = async () => {
		const portfolioNameSlug = slugify(appContainer.state.portfolio.name).slice(0, 20);
		const filename = `hyperdex-${t('export.trades')}-${portfolioNameSlug}-${formatDate(Date.now(), 'YYYY-MM-DD')}`;

		const filePath = dialog.showSaveDialog(remote.getCurrentWindow(), {
			title: t('export.exportTradeHistory'),
			defaultPath: path.join(app.getPath('downloads'), filename),
			buttonLabel: 'Export',
			filters: [
				{
					name: 'CSV',
					extensions: ['csv'],
				},
			],
		});

		if (!filePath) {
			return;
github oceanprotocol / commons / client / src / components / molecules / VersionNumbers / VersionTableRow.tsx View on Github external
const { getCollapseProps, getToggleProps, isOpen } = useCollapse({
        collapseStyles,
        expandStyles
    })

    return (
        &lt;&gt;
            
                
                    {(value.name === 'Commons' || value.contracts) &amp;&amp; (
                        <button>
                            
                        </button>
                    )}
                    <a href="{`https://github.com/oceanprotocol/${slugify(">
                        <strong>{value.name || value.software}</strong>
                    </a>
github yuanqing / create-figma-plugin / packages / common / src / read-config.js View on Github external
const packageJsonPath = join(process.cwd(), 'package.json')
  if ((await exists(packageJsonPath)) === false) {
    return defaultConfig
  }
  const packageJson = require(packageJsonPath)
  const config = packageJson[constants.packageJson.configKey]
  if (typeof config === 'undefined' || Object.keys(config).length === 0) {
    return defaultConfig
  }
  return {
    ...createMenuItem(config),
    apiVersion:
      typeof config.apiVersion !== 'undefined'
        ? config.apiVersion
        : constants.apiVersion,
    id: typeof config.id === 'undefined' ? slugify(config.name) : config.id
  }
}
github wilsson / papyrum / packages / papyrum-core / src / init.ts View on Github external
paths.map(async item => {
        const filePath = path.resolve(process.cwd(), `./${item}`);
        const ast = await parseMdx(filePath);
        const metasArray = getMetadata(ast);
        const finalRoute = path.basename(item).replace(path.extname(item), '');
        planEntries[item] = {
          filepath: item
        };
        metasArray &&
          metasArray.forEach(({ key, value }) => {
            if (key && value) planEntries[item][key] = value;
          });
        planEntries[item] = {
          ...planEntries[item],
          name: planEntries[item].name || humanize(slugify(finalRoute)),
          route: planEntries[item].route || `/${slugify(finalRoute)}`,
          nameChunk: `${slugify(finalRoute)}`,
          path: item,
        };
      })
    );
github doczjs / docz / packages / docz / src / Doc.ts View on Github external
constructor(name: string) {
    const slug = slugify(name)

    this._name = name
    this._slug = slug
    this._route = `/${slug}`
    this._order = 0

    return this
  }

@sindresorhus/slugify

Slugify a string

MIT
Latest version published 12 months ago

Package Health Score

77 / 100
Full package analysis

Popular @sindresorhus/slugify functions