From a3a98fbf421380b61718a1ea47cad43afcb12bbc Mon Sep 17 00:00:00 2001 From: Caspian Zhao Date: Sat, 12 Oct 2024 04:05:25 -0700 Subject: [PATCH] docs: add sitemap.xml and robots.txt --- example/website/next-sitemap.config.js | 6 +++ example/website/package.json | 3 +- .../custom-animations/quick-swipe.mdx | 13 ++---- example/website/public/robots.txt | 9 ++++ example/website/public/sitemap-0.xml | 32 +++++++++++++++ example/website/public/sitemap.xml | 4 ++ example/website/yarn.lock | 41 ++++++++++++++++++- 7 files changed, 96 insertions(+), 12 deletions(-) create mode 100644 example/website/next-sitemap.config.js create mode 100644 example/website/public/robots.txt create mode 100644 example/website/public/sitemap-0.xml create mode 100644 example/website/public/sitemap.xml diff --git a/example/website/next-sitemap.config.js b/example/website/next-sitemap.config.js new file mode 100644 index 00000000..bf7e5461 --- /dev/null +++ b/example/website/next-sitemap.config.js @@ -0,0 +1,6 @@ +/** @type {import('next-sitemap').IConfig} */ +module.exports = { + siteUrl: process.env.SITE_URL || "https://rn-carousel.dev", + generateRobotsTxt: true, + exclude: ["*/_meta"], +}; diff --git a/example/website/package.json b/example/website/package.json index cdcbc49b..e9837e03 100644 --- a/example/website/package.json +++ b/example/website/package.json @@ -13,12 +13,13 @@ "scripts": { "dev": "next dev", "gen-pages": "node scripts/gen-pages.mjs", - "build": "npm run gen-pages && next build", + "build": "npm run gen-pages && next build && next-sitemap", "start": "next start" }, "dependencies": { "@vercel/analytics": "^1.1.1", "next": "^13.0.6", + "next-sitemap": "^4.2.3", "nextra": "2.13.2", "nextra-theme-docs": "2.13.2", "react": "^18.2.0", diff --git a/example/website/pages/Examples/custom-animations/quick-swipe.mdx b/example/website/pages/Examples/custom-animations/quick-swipe.mdx index 5bdc2342..388c5f0b 100644 --- a/example/website/pages/Examples/custom-animations/quick-swipe.mdx +++ b/example/website/pages/Examples/custom-animations/quick-swipe.mdx @@ -51,13 +51,7 @@ import Carousel from "react-native-reanimated-carousel"; import { SBItem } from "@/components/SBItem"; import { window } from "@/constants/sizes"; -import { - Image, - ImageSourcePropType, - View, - ViewStyle, - useWindowDimensions, -} from "react-native"; +import { Image, ImageSourcePropType, View, ViewStyle } from "react-native"; import Animated, { Easing, Extrapolation, @@ -73,7 +67,6 @@ import * as Haptics from "expo-haptics"; import { getImages } from "./images"; import { IS_WEB } from "@/constants/platform"; -const PAGE_WIDTH = window.width; const data = getImages().slice(0, 68); function Index() { @@ -82,8 +75,8 @@ function Index() { const baseOptions = { vertical: false, - width: 480, - height: PAGE_WIDTH / 2, + width: window.width, + height: window.width / 2, } as const; return ( diff --git a/example/website/public/robots.txt b/example/website/public/robots.txt new file mode 100644 index 00000000..1559da83 --- /dev/null +++ b/example/website/public/robots.txt @@ -0,0 +1,9 @@ +# * +User-agent: * +Allow: / + +# Host +Host: https://rn-carousel.dev + +# Sitemaps +Sitemap: https://rn-carousel.dev/sitemap.xml diff --git a/example/website/public/sitemap-0.xml b/example/website/public/sitemap-0.xml new file mode 100644 index 00000000..4148972a --- /dev/null +++ b/example/website/public/sitemap-0.xml @@ -0,0 +1,32 @@ + + +https://rn-carousel.dev2024-10-12T11:03:23.720Zdaily0.7 +https://rn-carousel.dev/Examples/basic-layouts/left-align2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/basic-layouts/normal2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/basic-layouts/parallax2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/basic-layouts/stack2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/advanced-parallax2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/anim-tab-bar2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/blur-parallax2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/blur-rotate2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/circular2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/cube-3d2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/curve2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/flow2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/fold2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/multiple2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/press-swipe2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/quick-swipe2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/rotate-fade-in-out2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/rotate-in-out2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/scale-fade-in-out2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/custom-animations/tinder2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/summary2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/Examples/utils/pagination2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/compare2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/concepts2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/custom-animations2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/faq2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/props2024-10-12T11:03:23.721Zdaily0.7 +https://rn-carousel.dev/usage2024-10-12T11:03:23.721Zdaily0.7 + \ No newline at end of file diff --git a/example/website/public/sitemap.xml b/example/website/public/sitemap.xml new file mode 100644 index 00000000..20ad7f70 --- /dev/null +++ b/example/website/public/sitemap.xml @@ -0,0 +1,4 @@ + + +https://rn-carousel.dev/sitemap-0.xml + \ No newline at end of file diff --git a/example/website/yarn.lock b/example/website/yarn.lock index c8e9bf0a..98b8a25a 100644 --- a/example/website/yarn.lock +++ b/example/website/yarn.lock @@ -28,6 +28,13 @@ __metadata: languageName: node linkType: hard +"@corex/deepmerge@npm:^4.0.43": + version: 4.0.43 + resolution: "@corex/deepmerge@npm:4.0.43" + checksum: c9ac6163e982e81e3216a9fc7c68cd60b9788ad3b23d7387c9e9741b0274b42dfc332ae74b993e550c95e4256be5ce68045fc55d363aa083344392dc95b50d8b + languageName: node + linkType: hard + "@headlessui/react@npm:^1.7.10": version: 1.7.17 resolution: "@headlessui/react@npm:1.7.17" @@ -259,6 +266,13 @@ __metadata: languageName: node linkType: hard +"@next/env@npm:^13.4.3": + version: 13.5.7 + resolution: "@next/env@npm:13.5.7" + checksum: d6465a2a85fa2f829d9c888b8a22be5649ad0f4bdd260e0a0061d7e88c7add33b702a6afead2d6cc6fde746b6132eb591e3baac7ece13e460c168517bb06205f + languageName: node + linkType: hard + "@next/swc-darwin-arm64@npm:13.5.6": version: 13.5.6 resolution: "@next/swc-darwin-arm64@npm:13.5.6" @@ -2054,7 +2068,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.3.0": +"fast-glob@npm:^3.2.12, fast-glob@npm:^3.3.0": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" dependencies: @@ -4026,6 +4040,13 @@ __metadata: languageName: node linkType: hard +"minimist@npm:^1.2.8": + version: 1.2.8 + resolution: "minimist@npm:1.2.8" + checksum: 908491b6cc15a6c440ba5b22780a0ba89b9810e1aea684e253e43c4e3b8d56ec1dcdd7ea96dde119c29df59c936cde16062159eae4225c691e19c70b432b6e6f + languageName: node + linkType: hard + "minipass-collect@npm:^2.0.1": version: 2.0.1 resolution: "minipass-collect@npm:2.0.1" @@ -4200,6 +4221,23 @@ __metadata: languageName: node linkType: hard +"next-sitemap@npm:^4.2.3": + version: 4.2.3 + resolution: "next-sitemap@npm:4.2.3" + dependencies: + "@corex/deepmerge": "npm:^4.0.43" + "@next/env": "npm:^13.4.3" + fast-glob: "npm:^3.2.12" + minimist: "npm:^1.2.8" + peerDependencies: + next: "*" + bin: + next-sitemap: bin/next-sitemap.mjs + next-sitemap-cjs: bin/next-sitemap.cjs + checksum: 8e88c941b5e487584abaa21a31a94d888c8d37e95892cd6b5bdbc121f49435f75c279e97508a7a99d3de0010e833f3769d0c2d0888d9228be4dbd48e031b831c + languageName: node + linkType: hard + "next-themes@npm:^0.2.1": version: 0.2.1 resolution: "next-themes@npm:0.2.1" @@ -4925,6 +4963,7 @@ __metadata: autoprefixer: "npm:^10.4.16" dotenv: "npm:^16.4.5" next: "npm:^13.0.6" + next-sitemap: "npm:^4.2.3" nextra: "npm:2.13.2" nextra-theme-docs: "npm:2.13.2" postcss: "npm:^8.4.32"