Git Product home page Git Product logo

astro-lib's Introduction

astro-lib's People

Contributors

alextim avatar dependabot[bot] avatar github-actions[bot] avatar yamanidev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

astro-lib's Issues

robots-txt: extend host to support boolean value (automatic resolving)

Context

Following the pattern of how sitemap option is done, the host could also be resolved automatically from the Astro config site value, so it could be both boolean or string(s):

sitemap

Type Required Default value
Boolean / String / String[] No true

As I have checked both inspiration packages accepts sitemap as string (gatsby-plugin-robots#options and generate-robotstxt) and leaves consumer responsible for the values they pass, but astro-robots-txt package targets Astro framework, so it does automatic sitemap resolving which is smart. Why couldn't it do the same for host value?

Proposed change

host

Type Required Default value
Boolean / String No undefined

Having that in mind, available host types would be Boolean or String and reflect the following flows:

  • host: undefined -> default (same as is now, host is omitted)
  • host: true -> would resolve host automatically via Astro site prop and will include it into sitemap
  • host: 'any-string-value.com' -> would print out the custom value (as it works now)

TODO

  • Make host prop be available as Boolean / String

ERR_MODULE_NOT_FOUND'

pnpm run build --experimental-integrations
Debugger listening on ws://127.0.0.1:32835/cd9a281a-2926-4ceb-9980-5b7319f7b707
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

@example/[email protected] build /home/j/DEV/2706/pure/pure
astro build "--experimental-integrations"

Debugger listening on ws://127.0.0.1:38863/d96c94cd-8a6e-46c2-bce9-71c05dee7600
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
node:internal/errors:465
ErrorCaptureStackTrace(err);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@astrojs/sitemap' imported from /home/j/DEV/2706/pure/pure/astro.config.mjs
at new NodeError (node:internal/errors:372:5)
at packageResolve (node:internal/modules/esm/resolve:954:9)
at moduleResolve (node:internal/modules/esm/resolve:1003:20)
at defaultResolve (node:internal/modules/esm/resolve:1218:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
at ModuleWrap. (node:internal/modules/esm/module_job:80:40)
at link (node:internal/modules/esm/module_job:78:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
 ELIFECYCLE  Command failed with exit code 1.

insertAppleTouchLinks does not work in webmanifest

When I use insertAppleTouchLinks flag, the apple-touch-icon does not get generated, neither icon, nor head tag.

Without it Apple devices do not see the favicons in PWA mode.

I use @astro/vercel adapter, but it should not cause any problems.

"createLinkInHead: false" still adding sitemap link to head of all html pages.

I'm generating a sitemap with advanced config. I made createLinkInHead: false still it is adding sitemap-index.xml to head of every page. What would be the fix?

11:04:32 [build] Waiting for the astro-sitemap integration... astro-sitemap: Sitemap links are inserted into <head> section of generated pages (17768 of 17768).

Thanks

Auto install not working

If I run npm add astro-robots-txt it will install the package. But the auto-installer is not working. Its not prompting to try and update the Astro config.

"icons" folder is a system folder name in Linux and not usable

Hello,

unfortunately the (generated) folder name "icons" is a system folder name in Linux and therefore cannot be used. How can the name of the folder be changed in the settings in order to be able to use the Astro package?

Thank you in advance!

Best regards

Astro robots not generating a robots file or a meta tag

Here's my astro config:

import { defineConfig } from "astro/config"
import node from "@astrojs/node"
import vue from "@astrojs/vue"
import svgLoader from "@gkatsanos/vite-svg-loader"
import tailwind from "@astrojs/tailwind"
import robotsTxt from "astro-robots-txt"

// https://astro.build/config
export default defineConfig({
  server: {
    port: 3000,
    host: "0.0.0.0",
  },
  output: "server",
  adapter: node({
    mode: "standalone",
  }),
  build: {
    assets: "requests-frontend/_astro",
  },
  vite: {
    server: {
      proxy: {
        "^/octopus/api/.*": {
          target: "https://www.wlw-staging.de",
          changeOrigin: true,
        },
      },
    },
    plugins: [
      svgLoader({
        defaultImport: "url", // or 'raw'
      }),
    ],

    ssr: {
      noExternal: ["path-to-regexp"],
    },
    optimizeDeps: {
      // Why? dd-trace attempts to patch graphql, but it's not a dependency of this project.
      exclude: ["graphql"],
    },
  },
  integrations: [
    vue(),
    tailwind(),
    robotsTxt({
      policy: [
        {
          userAgent: "*",
          // The next line enables or disables the crawling on the `robots.txt` level
          disallow: "/",
        },
      ],
    }),
  ],
})

Looking at the HTML and the network tab, dont see a robots file or a meta tag.. whats up?
btw my Astro app is served from a sub-directory ( www.example.com/myastroapp/ ) with an nginx webserver on top of it.

link metadata for manifest has invalid crossorigin attribute value

using version 0.3.1 of astro-webmanifest

with astro.config.mjs integration settings:
webmanifest({
icon: ,
name: ,
short_name: ,
description: ,
start_url: '/',
theme_color: '#101726',
background_color: '#101726',
display: 'standalone'
})

upon npm run build

astro generated pages contain <link rel="manifest" href="/manifest.webmanifest" crossorigin="anonymus">

issue: "anonymus" should be "anonymous".

feature request: is this possible to add as a setting change like
`{ crossorigin: 'anonymous' || 'use-credentials' } ?

inject webmanifest also at dev mode

Is it possible to inject the webmanifest not only at build, but at astro dev? Looked briefly into the integration API and it seems that there is no hook present that we "just can use" to replicate the behavior for dev, too.

Maybe the injection via script at astro:config:setup is possible - if injected webmanifest elements after page load will be applied?

Missing types

For import robotsTxt from "astro-robots-txt";

Current solution

// @ts-ignore
import robotsTxt from "astro-robots-txt";

astro-webmanifest compatability with Astro 3

Currently astro-webmanifest is incompatable with Astro 3 because of dependency from sharp@^0.31.3
On build it gives error:

MissingSharp: Could not find Sharp. Please install Sharp (`sharp`) manually into your project.

Updating dependency to sharp@^0.32.5 will fix the problem

error with npm run build

I added the site property and added the function call to integrations but I got the following error:

robotsTxt is not defined
ReferenceError: robotsTxt is not defined

Here is my config file:

import { defineConfig } from 'astro/config';

// https://astro.build/config
import sitemap from "@astrojs/sitemap";

// https://astro.build/config
export default defineConfig({
  vite: {
    ssr: {
      external: ['svgo']
    }
  },
  site: 'https://kernixwebdesign.com',
  integrations: [sitemap(), robotsTxt()]
});

Any idea what the issue is?

"Named export 'LinkItem' not found" when running "astro build"

I run into this error when I try building my site :

> astro build

file:///Users/cody/workspace/pokedex/node_modules/astro-sitemap/dist/index.js:340
import { SitemapItemLoose as SitemapItemLoose2, LinkItem, EnumChangefreq } from "sitemap";
                                                ^^^^^^^^
SyntaxError: Named export 'LinkItem' not found. The requested module 'sitemap' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'sitemap';
const { SitemapItemLoose: SitemapItemLoose2, LinkItem, EnumChangefreq } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:127:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:193:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:337:24)

Astro 4

Hi,

I had the webmanifest working prefectly in Astro 3. I upgraded to Astro 4 and found the webmanifest does not work any more. There is always a residual .mjs file after a build. Besides astro-webmanifest, I am using @astro/sitemap and astro-robots-txt in my config. I was also generating an RSS feed using @astrojs/rss, which seems to have stopped working now. I am mentioning it to cover the off chance that it might be interacting with astro-webmanifest.

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.