Git Product home page Git Product logo

Comments (6)

franzwilding avatar franzwilding commented on August 22, 2024 1

Ah cool! I tried this some days ago, back than it was only working with the node server running. I will check it out with the newest beta build. I also checked the release notes but did not found any hint that this will work.

from astro-imagetools.

bronze avatar bronze commented on August 22, 2024

could you generate it as an astro file and copy as manifest on your build command? a bit of a hack but...

from astro-imagetools.

RafidMuhymin avatar RafidMuhymin commented on August 22, 2024

@franzwilding there's actually a way to do this. Create a manifest.webmanifest.js file inside the src/pages directory and paste the following code:

import Icon48 from "../assets/logo.png?w=72&format=png";
import Icon72 from "../assets/logo.png?w=72&format=png";
import Icon96 from "../assets/logo.png?w=96&format=png";
import Icon144 from "../assets/logo.png?w=144&format=png";
import Icon168 from "../assets/logo.png?w=168&format=png";
import Icon192 from "../assets/logo.png?w=192&format=png";

const manifest = {
  icons: [
    {
      src: Icon48,
      sizes: "48x48",
      type: "image/png",
    },
    {
      src: Icon72,
      sizes: "72x72",
      type: "image/png",
    },
    {
      src: Icon96,
      sizes: "96x96",
      type: "image/png",
    },
    {
      src: Icon144,
      sizes: "144x144",
      type: "image/png",
    },
    {
      src: Icon168,
      sizes: "168x168",
      type: "image/png",
    },
    {
      src: Icon192,
      sizes: "192x192",
      type: "image/png",
    },
  ],
};

export async function get() {
  return {
    body: JSON.stringify(manifest),
  };
}

from astro-imagetools.

franzwilding avatar franzwilding commented on August 22, 2024

Thanks @RafidMuhymin, however I think this would render and return webmanifest live using the node server. I'm trying to find a similar solution, but during build time.

from astro-imagetools.

RafidMuhymin avatar RafidMuhymin commented on August 22, 2024

@franzwilding this works in build too. Astro supports this feature since v0.23. The problem is this feature is not documented very well. https://docs.astro.build/en/core-concepts/astro-pages/#non-html-pages

from astro-imagetools.

RafidMuhymin avatar RafidMuhymin commented on August 22, 2024

@franzwilding closing this issue now. Feel free to comment on this issue or ask in the Discord channel if you are facing any kind of problems related to Astro.

from astro-imagetools.

Related Issues (20)

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.