astro-robots-txt
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -180,3 +180,3 @@ var __defProp = Object.defineProperty; | ||
import { z } from "zod"; | ||
var validateSitemapItem = () => z.string().refine((val) => !val || isValidUrl(val), { | ||
var validateSitemapItem = () => z.string().min(1).refine((val) => !val || isValidUrl(val), { | ||
message: "Not valid url" | ||
@@ -251,11 +251,7 @@ }).refine((val) => !val || isValidHttpUrl(val), { | ||
} | ||
let a = void 0; | ||
if (Array.isArray(sitemap)) { | ||
a = sitemap; | ||
} else if (typeof sitemap === "string") { | ||
a = [sitemap]; | ||
return sitemap; | ||
} | ||
if (a) { | ||
a = a.filter(Boolean); | ||
return a.length > 0 ? a : void 0; | ||
if (typeof sitemap === "string") { | ||
return [sitemap]; | ||
} | ||
@@ -262,0 +258,0 @@ } |
{ | ||
"name": "astro-robots-txt", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Generate a robots.txt for Astro", | ||
@@ -45,3 +45,3 @@ "keywords": [ | ||
"vite": "^2.9.9", | ||
"vitest": "^0.13.1" | ||
"vitest": "^0.14.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "publishConfig": { |
@@ -109,9 +109,7 @@ [](https://bank.gov.ua/en/about/support-the-armed-forces) | ||
| Name | Type | Default | Description | | ||
| :-------: | :-----------------------------: | :------------------------------: | :-------------------------------------------------------------------------------------------: | | ||
| `host` | `String` | `` | Host of your site | | ||
| `sitemap` | `Boolean / String` / `String[]` | `true` | Resulting output in a _robots.txt_ will be `Sitemap: your-site-url/sitemap.xml` | | ||
| | | | If `sitemap: false` - no `Sitemap` line in the output. | | ||
| | | | You could use for the `sitemap` a valid **http** url string or array of **http** url strings. | | ||
| `policy` | `Policy[]` | [{ allow: '/', userAgent: '*' }] | List of `Policy` rules | | ||
| Name | Type | Default | Description | | ||
| :-------: | :-----------------------------: | :------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | ||
| `host` | `String` | `` | Host of your site | | ||
| `sitemap` | `Boolean / String` / `String[]` | `true` | Resulting output in a _robots.txt_ will be `Sitemap: your-site-url/sitemap.xml`.<br/>If `sitemap: false` - no `Sitemap` line in the output.<br/>When the `sitemap` is `String` or `String[]` its values have to be a valid **http** url. Empty strings or other protocols are not allowed. | | ||
| `policy` | `Policy[]` | [{ allow: '/', userAgent: '*' }] | List of `Policy` rules | | ||
@@ -118,0 +116,0 @@ ### Policy |
22543
316
255