diff --git a/README.md b/README.md index 3cdaefbd4a..27142cb465 100644 --- a/README.md +++ b/README.md @@ -140,15 +140,15 @@ Any static assets, like images, can be placed in the `public/` directory if they All commands are run from the root of the project, from a terminal: -| Command | Action | -| :-------------------- | :------------------------------------------------- | -| `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | -| `npm run build` | Build your production site to `./dist/` | -| `npm run preview` | Preview your build locally, before deploying | -| `npm run format` | Format codes with Prettier | -| `npm run lint:eslint` | Run Eslint | -| `npm run astro ...` | Run CLI commands like `astro add`, `astro preview` | +| Command | Action | +| :------------------ | :------------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run build` | Build your production site to `./dist/` | +| `npm run preview` | Preview your build locally, before deploying | +| `npm run check` | Check your project for errors | +| `npm run fix` | Run Eslint and format codes with Prettier | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro preview` |
diff --git a/src/utils/images-optimization.ts b/src/utils/images-optimization.ts index e6424ef5a4..3f563b2237 100644 --- a/src/utils/images-optimization.ts +++ b/src/utils/images-optimization.ts @@ -21,6 +21,7 @@ export interface ImageProps extends Omit, 'src'> { layout?: Layout; widths?: number[] | null; aspectRatio?: string | number | null; + objectPosition?: string; } export type ImagesOptimizer = ( @@ -259,7 +260,18 @@ export const unpicOptimizer: ImagesOptimizer = async (image, breakpoints, width, /* ** */ export async function getImagesOptimized( image: ImageMetadata | string, - { src: _, width, height, sizes, aspectRatio, widths, layout = 'constrained', style = '', ...rest }: ImageProps, + { + src: _, + width, + height, + sizes, + aspectRatio, + objectPosition, + widths, + layout = 'constrained', + style = '', + ...rest + }: ImageProps, transform: ImagesOptimizer = () => Promise.resolve([]) ): Promise<{ src: string; attributes: HTMLAttributes<'img'> }> { if (typeof image !== 'string') { @@ -315,6 +327,7 @@ export async function getImagesOptimized( width: width, height: height, aspectRatio: aspectRatio, + objectPosition: objectPosition, layout: layout, })}${style ?? ''}`, ...rest, diff --git a/vendor/integration/index.ts b/vendor/integration/index.ts index b24420f0f2..9b7b726a5d 100644 --- a/vendor/integration/index.ts +++ b/vendor/integration/index.ts @@ -95,7 +95,7 @@ export default ({ config: _themeConfig = 'src/config.yaml' } = {}): AstroIntegra const pattern = /^Sitemap:(.*)$/m; if (!pattern.test(robotsTxt)) { - fs.appendFileSync(robotsTxtFileInOut, `${os.EOL}${os.EOL}Sitemap: ${sitemapUrl}`, { + fs.writeFileSync(robotsTxtFileInOut, `${robotsTxt}${os.EOL}${os.EOL}Sitemap: ${sitemapUrl}`, { encoding: 'utf8', flag: 'w', });