-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
9,246 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
open_collective: svgo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Discord | ||
url: https://discord.gg/z8jX8NYxrE | ||
about: Please ask questions in our Discord server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Deploy | ||
|
||
on: | ||
release: | ||
types: | ||
- 'published' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: svg/svgo | ||
path: .svgo | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
- run: yarn install --immutable | ||
- run: yarn run build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CI | ||
|
||
on: | ||
- 'pull_request' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: svg/svgo | ||
path: .svgo | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
- run: yarn install --immutable | ||
- run: yarn run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 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* | ||
|
||
# Docs should be pulled from the svg/svgo repository | ||
/docs/ | ||
/.svgo/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) SVGO and Contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SVGO Website | ||
|
||
A site powered by Docusaurus, mostly featuring documentation for SVGO. | ||
|
||
This repository contains source code for the landing page, custom components, and pretty much everything except the documentation itself. The documentation is pulled from [svg/svgo](https://github.com/svg/svgo) during deployment. | ||
|
||
In order to run or deploy the site, you'll first need to fetch the documentation. You can do this by cloning [svg/svgo](https://github.com/svg/svgo) to the `.svgo` directory in the workspace. | ||
|
||
```sh | ||
git clone https://github.com/svg/svgo.git .svgo --depth 1 | ||
``` | ||
|
||
Docusaurus is configured to read documents from the `.svgo/docs` directory instead of the root `docs/` directory. | ||
|
||
## Running Locally | ||
|
||
Once you have the project setup, you can run the development server: | ||
|
||
```sh | ||
yarn install | ||
yarn run start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
presets: [ | ||
require.resolve('@docusaurus/core/lib/babel/preset') | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
const lightCodeTheme = require("prism-react-renderer/themes/github"); | ||
const darkCodeTheme = require("prism-react-renderer/themes/dracula"); | ||
|
||
/** | ||
* @typedef {import("@docusaurus/types").Config} Config | ||
*/ | ||
|
||
/** | ||
* Config for Docusaurus. | ||
* | ||
* $.themeConfig.navbar.logo is underfined as this is configured with a custom component. | ||
* $.themeConfig.footer.style is ignored as this is overriden with custom CSS. | ||
* | ||
* @type {Config} | ||
*/ | ||
const config = { | ||
title: "SVGO", | ||
tagline: "A Node.js library and command-line application to optimize vectors.", | ||
favicon: "img/favicon.ico", | ||
url: "https://svgo.dev", | ||
baseUrl: "/", | ||
baseUrlIssueBanner: false, | ||
organizationName: "svg", | ||
projectName: "svgo.dev", | ||
trailingSlash: true, | ||
onBrokenLinks: "throw", | ||
onBrokenMarkdownLinks: "throw", | ||
i18n: { | ||
defaultLocale: "en", | ||
locales: [ | ||
"en" | ||
], | ||
}, | ||
plugins: [ | ||
[ | ||
"@docusaurus/theme-classic", | ||
{ | ||
customCss: require.resolve("./src/css/custom.css"), | ||
}, | ||
], | ||
[ | ||
"@docusaurus/plugin-content-pages", | ||
{ | ||
path: "src/pages", | ||
routeBasePath: "/" | ||
} | ||
], | ||
[ | ||
"@docusaurus/plugin-content-docs", | ||
{ | ||
path: ".svgo/docs", | ||
breadcrumbs: true, | ||
sidebarPath: require.resolve("./sidebars.js"), | ||
editUrl: ({ docPath }) => `https://github.com/svg/svgo/tree/main/docs/${docPath}`, | ||
} | ||
], | ||
[ | ||
"@docusaurus/plugin-sitemap", | ||
{ | ||
filename: "sitemap.xml", | ||
ignorePatterns: [ | ||
"/.well-known/**" | ||
] | ||
} | ||
] | ||
], | ||
themes: [ | ||
'@docusaurus/theme-live-codeblock', | ||
[ | ||
require.resolve("@easyops-cn/docusaurus-search-local"), | ||
{ | ||
indexDocs: true, | ||
indexBlog: false, | ||
language: "en", | ||
hashed: true, | ||
searchBarPosition: "right" | ||
} | ||
] | ||
], | ||
themeConfig: { | ||
colorMode: { | ||
disableSwitch: true, | ||
respectPrefersColorScheme: true, | ||
}, | ||
navbar: { | ||
items: [ | ||
{ | ||
type: "docSidebar", | ||
position: "left", | ||
sidebarId: "docsSidebar", | ||
label: "Documentation", | ||
}, | ||
{ | ||
href: "https://github.com/svg/svgo", | ||
position: "right", | ||
html: `<img src="https://img.shields.io/github/stars/svg/svgo?style=social" alt="" height="20" width="88"/>`, | ||
className: 'github-shield', | ||
'aria-label': 'GitHub repository' | ||
} | ||
], | ||
}, | ||
prism: { | ||
theme: lightCodeTheme, | ||
darkTheme: darkCodeTheme | ||
}, | ||
footer: { | ||
links: [ | ||
{ | ||
title: "Community", | ||
items: [ | ||
{ | ||
label: "Stack Overflow", | ||
href: "https://stackoverflow.com/questions/tagged/svgo", | ||
}, | ||
{ | ||
label: "Discord", | ||
href: "https://discord.com/invite/z8jX8NYxrE", | ||
} | ||
], | ||
}, | ||
{ | ||
title: "More", | ||
items: [ | ||
{ | ||
label: "GitHub", | ||
href: "https://github.com/svg/svgo", | ||
}, | ||
{ | ||
label: "Open Collective", | ||
href: "https://opencollective.com/svgo" | ||
} | ||
] | ||
} | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} <a href="https://github.com/svg/svgo/graphs/contributors">SVGO and Contributors</a><br>Source Code under MIT · Content and Assets under CC-BY-4.0` | ||
}, | ||
} | ||
}; | ||
|
||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "svgo-dev", | ||
"version": "0.0.0", | ||
"description": "Landing page and documentation for SVGO.", | ||
"license": "MIT", | ||
"homepage": "https://svgo.dev/", | ||
"private": true, | ||
"author": { | ||
"name": "Seth Falco", | ||
"email": "seth@falco.fun", | ||
"url": "https://falco.fun/" | ||
}, | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/svgo" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/svg/svgo.dev.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/svg/svgo.dev/issues" | ||
}, | ||
"keywords": [ | ||
"svgo", | ||
"docusaurus" | ||
], | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"scripts": { | ||
"docusaurus": "docusaurus", | ||
"start": "docusaurus start", | ||
"build": "docusaurus build", | ||
"swizzle": "docusaurus swizzle", | ||
"deploy": "docusaurus deploy", | ||
"clear": "docusaurus clear", | ||
"serve": "docusaurus serve", | ||
"write-translations": "docusaurus write-translations", | ||
"write-heading-ids": "docusaurus write-heading-ids" | ||
}, | ||
"dependencies": { | ||
"@docusaurus/core": "^2.4.3", | ||
"@docusaurus/plugin-content-docs": "^2.4.3", | ||
"@docusaurus/plugin-content-pages": "^2.4.3", | ||
"@docusaurus/plugin-sitemap": "^2.4.3", | ||
"@docusaurus/theme-classic": "^2.4.3", | ||
"@docusaurus/theme-live-codeblock": "^2.4.3", | ||
"@easyops-cn/docusaurus-search-local": "^0.36.0", | ||
"@mdx-js/react": "^1.6.22", | ||
"clsx": "^1.2.1", | ||
"prism-react-renderer": "^1.3.5", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"svgo": "^3.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @typedef {import('@docusaurus/plugin-content-docs').SidebarsConfig} SidebarsConfig | ||
*/ | ||
|
||
/** @type {SidebarsConfig} */ | ||
const sidebars = { | ||
docsSidebar: [{ type: 'autogenerated', dirName: '.' }], | ||
}; | ||
|
||
module.exports = sidebars; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
import styles from './index.module.css'; | ||
|
||
export default function DefaultBadge() { | ||
return ( | ||
<span className={clsx(styles.badge)} title="This plugin is enabled by default."> | ||
Default | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.badge { | ||
padding: .3em .6em; | ||
border-radius: 1em; | ||
color: var(--svgo-pill-fg-color); | ||
background-color: var(--svgo-pill-bg-color); | ||
} |
Oops, something went wrong.
6dd6683
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a little funny that issues tell you to go to the discord, but the one guy doing most of the maintenance seemingly isn't there