JSPM

@miletorix/vitepress-enhanced-site-links

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q66859F
  • License MIT

Vue components for enhanced link cards and link groups for VitePress.

Package Exports

  • @miletorix/vitepress-enhanced-site-links
  • @miletorix/vitepress-enhanced-site-links/style.css

Readme

vitepress-enhanced-site-links

Vue components for enhanced link cards in VitePress.

vitepress-enhanced-site-links demo

Live Demo and more information

See it in action:
👉 https://miletorix.github.io/vitepress-enhanced-site-links/

Installation

npm i @miletorix/vitepress-enhanced-site-links

Usage

Configuration

// docs/.vitepress/theme/index.ts
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'

import { Card, CardsGroup } from '@miletorix/vitepress-enhanced-site-links' // [!code ++]
import '@miletorix/vitepress-enhanced-site-links/style.css' // [!code ++]

export default {
  extends: DefaultTheme,
  enhanceApp(ctx) {
    ctx.app.component('Card', Card) // [!code ++]
    ctx.app.component('CardsGroup', CardsGroup) // [!code ++]
  }
}
<Card
  title="title..."
  link="https://url.../" 
  desc="desc..."
  logo="path-to-img"
/>
<CardsGroup :cards="[
  { title: 'title...', link: 'https://url.../', desc: 'desc...' },
  { title: 'title...', link: 'https://url.../', desc: 'desc...' },
  { title: 'title...', link: 'https://url.../', desc: 'desc...', logo: 'path-to-url' }
]" />

Examples

Example 1

Input

<Card title="Github" link="https://github.com/" />

Output

demo-2

Example 2

Input

<Card title="Github" link="https://github.com/" desc="Github Homepage" />

Output

demo-3

Example 3

Input

<Card
  title="YouTube"
  link="https://youtube.com/" 
  desc="YouTube Homepage"
  logo="/img/youtube-logo-1.png"
/>

Output

demo-4

Example 4

Input

<CardsGroup :cards="[
  { title: 'YouTube', link: 'https://youtube.com/', desc: '' },
  { title: 'Github', link: 'https://github.com/', desc: 'Github Homepage' },
  { 
    title: 'Notepad', 
    link: 'https://apps.microsoft.com/detail/9msmlrh6lzf3?hl=en-US&gl=US', 
    desc: 'MS Store',
    logo: '/img/notepad-logo.png' 
  }
]" />  

Output

demo-5