Skip to content

Commit

Permalink
Add example site
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed Aug 12, 2024
1 parent d4e04bb commit edb5d66
Show file tree
Hide file tree
Showing 19 changed files with 17,291 additions and 73 deletions.
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/missing-types.d.ts

example/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Docusaurus Native Ideal Image Plugin

A docuaurus plugin for pre-processing images to multiple formats, sizes and low quality image placeholders
20 changes: 20 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
3 changes: 3 additions & 0 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
}
90 changes: 90 additions & 0 deletions example/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import type { Config } from '@docusaurus/types'
import type * as Preset from '@docusaurus/preset-classic'
import { themes } from 'prism-react-renderer'
import type { NativeIdealImageOptions } from 'docusaurus-plugin-native-ideal-image'

const config: Config = {
title: 'Docusaurus Native Ideal Image Plugin',
tagline: 'Pre-process images to multiple formats and low quality image placeholders',
// favicon: 'images/favicon.ico',

// Set the production url of your site here
url: 'https://legend-master.github.io/',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/docusaurus-plugin-native-ideal-image',

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
{
docs: false,
blog: false,
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],

plugins: [
[
'native-ideal-image',
{
presets: {
card: {
sizes: [800, 1200],
formats: ['avif', 'webp', 'jpeg'],
},
},
// disableInDev: false,
} satisfies NativeIdealImageOptions,
],
],

themeConfig: {
navbar: {
title: 'Docusaurus Native Ideal Image Plugin',
items: [
{
label: 'GitHub',
position: 'right',
href: 'https://github.com/Legend-Master/docusaurus-plugin-native-ideal-image',
},
],
},
footer: {
links: [
// {
// title: 'Docs',
// items: [
// {
// label: 'Tutorial',
// to: '/docs/intro',
// },
// ],
// },
],
},
prism: {
theme: themes.github,
darkTheme: themes.vsDark,
},
colorMode: {
respectPrefersColorScheme: true,
},
} satisfies Preset.ThemeConfig,
}

export default config
Binary file added example/images/stone-road.webp
Binary file not shown.
Loading

0 comments on commit edb5d66

Please sign in to comment.