Giter Site home page Giter Site logo

onwidget / astrowind Goto Github PK

View Code? Open in Web Editor NEW
2.4K 31.0 714.0 12.5 MB

⭕️ AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.

Home Page: https://astrowind.vercel.app

License: MIT License

JavaScript 4.00% Astro 76.06% CSS 0.88% TypeScript 10.48% MDX 8.39% HTML 0.19%
astro javascript tailwind tailwindcss template theme astro-template static-site static-site-generator blog

astrowind's People

Contributors

alaev avatar amadeustwi avatar angra974 avatar awaddell avatar badrbouslikhin avatar bennycode avatar berkaycubuk avatar bmartinez287 avatar circus-real avatar davidawad avatar dawaltconley avatar denartha10 avatar diomed avatar fountainpen avatar frascu avatar hmser avatar ikukarkin avatar ishtarstar avatar ivopauly avatar jovica-me avatar juliusbairaktaris avatar ladunjexa avatar lirantal avatar mrgkanev avatar nikolarhristov avatar prototypa avatar rickbsgu avatar thkruz avatar w3bdesign avatar widgeter 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  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

astrowind's Issues

after adding sst to the project, cannot run build

after running

npx create-sst

per https://docs.astro.build/en/guides/deploy/sst/
I accepted all default answers and then attempted to run

npm run build

I get the following error:

officium:EvonyTips_v2 luke$ npm run build

> @onwidget/[email protected] build
> astro build

02:04:28 PM [content] Unsupported file types found. Prefix with an underscore (`_`) to ignore:
- markdown-elements-demo-post.mdx
02:04:28 PM [content] Types generated 358ms
02:04:28 PM [build] output target: server
02:04:28 PM [build] deploy adapter: astro-sst/lambda
02:04:28 PM [build] Collecting build info...
02:04:28 PM [build] Completed in 380ms.
02:04:28 PM [build] Building server entrypoints...
[vite:import-glob] Invalid glob: "~/assets/images/**" (resolved: "~/assets/images/**"). It must start with '/' or './'
file: /Users/luke/src/astro/EvonyTips_v2/src/utils/images.ts
 error   Invalid glob: "~/assets/images/**" (resolved: "~/assets/images/**"). It must start with '/' or './'
  File:
    /Users/luke/src/astro/EvonyTips_v2/src/utils/images.ts
  Stacktrace:
Error: Invalid glob: "~/assets/images/**" (resolved: "~/assets/images/**"). It must start with '/' or './'
    at toAbsoluteGlob (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39733:11)
    at async Promise.all (index 0)
    at async file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39529:31
    at async Promise.all (index 0)
    at async parseImportGlob (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39543:13)
    at async transformGlobImport (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39563:21)
    at async Object.transform (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39370:28)
    at async transform (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/rollup/dist/es/shared/node-entry.js:23363:16)
    at async ModuleLoader.addModuleSource (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/rollup/dist/es/shared/node-entry.js:23569:30)

officium:EvonyTips_v2 luke$ 

I freshly cloned the repository yesterday and have only just started exploring Astro. I tried to keep things fairly minimal to make sure I wasn't introducing the error by conflicting integrations.

officium:EvonyTips_v2 luke$ cat astro.config.mjs 
import { defineConfig } from "astro/config";
import aws from "astro-sst/lambda";

export default defineConfig({
  output: "server",
  adapter: aws(),
});

note, updated the stack trace because I had forgotten I had edited src/utils/images.ts in an attempt to fix this myself. The current stack trace reflects the error with the default content in src/utils/images.ts

Got an error after performing npm run dev

Hi everyone, I'm still new to Astro in general and came to the following issue. I downloaded the code in Zip file, extracted them and ran the following as instructed in the README.

  • npm install
  • npm run dev

And got the following error:

> @onwidget/[email protected] dev
> astro dev

dyld: lazy symbol binding failed: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: /Volumes/DATA/Astro/astrowind/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _pthread_jit_write_protect_supported_np
  Referenced from: /Volumes/DATA/Astro/astrowind/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
  Expected in: /usr/lib/libSystem.B.dylib

/var/folders/p1/k78b7zpd401fqcvhv6jx8w2r0000gn/T/dev-f33a7221.sh: line 1: 10857 Abort trap: 6           astro dev

Though it went smoothly on the previous release, wondering if anyone could point me on how to fix them.

Thanks,

Vite error when build

i get an error like this, whenever i try to build.

Error: Rollup failed to resolve import "web-streams-polyfill" from `"node_modules/@astrojs/image/dist/utils/workerPool.js"`.

HTTP ERROR 500 when deploying astrowind project

Hi All!

I've been using your template and I'm really enjoying it so far. I've ran into a small issue and I hope that anyone can help me out :)

I've cloned your repository and deployed it through Vercel. When I enter the production URL, everything seems to work fine on the / endpoint. If I try to enter the /blog endpoint, I'll receive a 500 HTTP error.

Here are the steps that I took from cloning the project to deployment.

Git clone [[email protected]:codewithdary/cdw-astro-test.git](mailto:[email protected]:codewithdary/cdw-astro-test.git)
cd cdw-astro-test

NPM installation

npm install
npm run build
npm run dev

Accessed website through localhost where everything seem to work fine, even the /blog endpoint.

http://localhost:3000/

Deployment through Vercel

npm install @astrojs/vercel

Added the following in my astro.config.mjs file

import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';

export default defineConfig({
  output: 'server',
  adapter: vercel(),
});

Added new files to Git

git add astro.config.mjs
git commit -m “Added Vercel”
git push

Installed Vercel CLI

npm i -g vercel
vercel

Configuration through Vercel CLI

? Set up and deploy “~/Desktop/workspace/cdw-astro-test”? [Y/n] y
? Which scope do you want to deploy to? codewithdary
? Link to existing project? [y/N] n
? What’s your project’s name? cdw-astro-test
? In which directory is your code located? ./
? Want to modify these settings? [y/N] N

Deployment was successful. If I try to access the page through my production URL, the homepage works fine, but once I click on the /blog endpoint in the navigation, I’ll receive the following URL error:

cdw-astro-test-kgybbvmqs-codewithdary.vercel.app is currently unable to handle this request.
HTTP ERROR 500

Can someone please guide me through this issue? The link to my GitHub repository can be found right here.

Internationalization

Hey guys,
I'm creating a blog with this template and I would like to know how to add the same posts in different languages.

Package Warnings

When installing Astrowind I got a couple of warnings from NPM. Something to look into or is this ok?

npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

Missing navigation

when i use this template and run it on my local machine, this happens some navigation text not showing

image

Error: Unknown builtin plugin "cleanupIDs" specified. "astro-icon": "^0.8.0"

Discussed in #78

Originally posted by gangajamuna January 6, 2023
Hello, I'm trying to use the Astro wind theme. When I run dev everything works as expected however when I try to run the build this error is thrown:
throw new Error(`[astro-icon] Unable to load icon "${name}"!
Error: [astro-icon] Unable to load icon "tabler:info-square"!
Error: Unknown builtin plugin "cleanupIDs" specified.

I'm unable to preview the build and running localhost:3000 results in 404 not found.
When I remove "astro-icon": "^0.8.0" from project it is working.
Can someone explain to me what is happening here and how I might resolve this?
Thank you!

Problem with Cumulative Layout Shift (CLS) and Astro Version 2.0.6

Hello, there seems to be a problem with the cumulative layout shift when using the theme with the latest Astro version 2.0.6. I tested it with Astro version 2.0.2, there is no problem. The following picture shows the problems, I haven't changed anything (just cloned and then uploaded the created files from the /dist directory).

Screenshot 2023-02-04 at 12-15-02 PageSpeed Insights

how can i create a new route ?

hi, i just discover and fork this repo. i think "astrowind" is the best solution for landing and blog post static website.

i want to create a new routes "/organisations"

│ ├── pages/
│ | ├── [...blog]/
| | ├── [...page].astro
| | └── [slug].astro
│ | ├── [...organisations]/
| | ├── [...page].astro
| | └── [slug].astro

when i created these files and trying to check the route . i have a error .
" getstaticPaths route pattern matched but no matching static path found (/organisations)

thank for your anwser .

script tag is giving could not import error

Just adding a simple script tag which logs Hello to a page gives this error:

 error   Could not import `/src/pages/contact-us.astro?astro&type=script&index=0&lang.ts`.
  Hint:
    This is often caused by a typo in the import path. Please make sure the file exists.
  Stacktrace:
Error: failed to load module for ssr: /src/pages/contact-us.astro?astro&type=script&index=0&lang.ts
    at instantiateModule (file:///D:/DCS%20Projects/Local/astrowind/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:53281:15)

This is the .astro file for the page:

---
import { SITE } from '~/config.mjs';
import { getCanonical, getHomePermalink } from '~/utils/permalinks';
import Layout from '~/layouts/PageLayout.astro';
import Breadcrumbs from '~/components/widgets/Breadcrumbs.astro';
import Title from '~/components/widgets/Title.astro';

const {title = 'Contact Us'} = Astro.props;

const meta = {
	title: title + ' - ' + SITE.title,
	description: SITE.description,
	canonical: getCanonical(getHomePermalink()),
};
---
<Layout {meta}>
	<Breadcrumbs />
	<Title title={title}/>
	<p class="font-light text-center text-gray-500 dark:text-gray-400 sm:text-xl">We’re here to help! Tell us what you’re looking for and we’ll get back to you as soon as possible.</p>
</Layout>
<script>
	console.log("Test");
</script>

If I remove the script tag at the end the same page loads fine without any errors

Scroll to anchor on page is broken on Firefox mobile

Hi,
First, thank you for this great template, awesome work!
I recently noticed that on Firefox mobile (v89.1.1), if I tap the "Learn more" button on the homepage, the scroll does not work well.
It scrolls the page in a way that the anchor is at the bottom of the page instead at the top.
This might be a Firefox bug, I don't know, just wanted to ask if you guys know a fix or workaround for this.

Can‘t be deployed to cloudflare?

I deploye it to cloudflare,through it display sucss , I can’t open the site. I tried 3 times and don't know why...

Success: Finished cloning repository files
No build command specified. Skipping build step.
Note: No functions dir at /functions found. Skipping.
Validating asset output directory
Deploying your site to Cloudflare's global network...
 Uploading... (99/99)

✨ Success! Uploaded 0 files (99 already uploaded) (0.42 sec)

✨ Upload complete!
Success: Assets published!
Success: Your site was deployed!
Deploying your site to Cloudflare's global network...
 Uploading... (99/99)

✨ Success! Uploaded 0 files (99 already uploaded) (0.42 sec)

✨ Upload complete!

Funky NavBar

Funky NavBar

Back in December, I used this template to setup a simple site. Back then, the navbar elements were all nicely lined up on the right hand side of the top navbar. Now, they seems to be kinda in the center and it just doesn't look as clean.

Here is an example of what it looks like now with the navbar just not looking quite right:

Screenshot 2023-03-12 at 6 59 34 PM

Generate blog content inside of blog folder

First of all thank for the cool repo!

Idea:

Looking at the build folder how the blog post were generated,
Screenshot from 2023-01-05 14-07-14

I have read multiple time that google is also using the folder structure to index the content.
image

is there a more general solution to generate the blog content inside of blog folder?

Update generated repos

Hi, I generated a repo from this template last week and saw that there have been a lot of nice updates since then. Is there any way to keep my "fork" up to date with the development?

I tried adding this repo as a second remote and then fetching and merging it but it does not seem to work.

fatal: refusing to merge unrelated histories

Does this theme work on GitHub Pages?

Hi! I am curious if this template can be deployed on GitHub pages? I know that GitHub Pages only supports static and not SSR (server) rendering. I also see that this template has the static option set so I would assume it would work but wanted to confirm here.

SITE.splitbeeAnalytics not found!

In MetaTags.asto use SITE.splitbeeAnalytics

{SITE.splitbeeAnalytics?.enabled && <SplitbeeAnalytics {...SITE.splitbeeAnalytics} />}

but in config.mjs is not declared

Regular expression error occurs when "tags" into md file in CJK language is specified

Hello, thank you so much for developing this wonderful theme.
I will tell you that I detected one problem in touching this theme.

The following error occurs when CJK language keywords are entered for "tags" in markdown files.
※CJK: Chinese、Japanese、Korean

Target file path

/
├── src/
│   ├── data/
|   |   └── posts/
|   |       ├── post-slug-1.md

Error log text

 error   Expected "tag" to match "[^\/#\?]+?", but got ""
TypeError: Expected "tag" to match "[^\/#\?]+?", but got ""
    at Object.generate (.\astrowind-main\node_modules\path-to-regexp\dist\index.js:229:27)    
    at file://astrowind-main/node_modules/astro/dist/core/render/paginate.js:41:35
    at Array.map (<anonymous>)
    at paginateUtility (file://astrowind-main/node_modules/astro/dist/core/render/paginate.js:20:48)
    at ./astrowind-main/src/pages/[...tags]/[tag]/[...page].astro:1:3
    at Array.map (<anonymous>)
    at Module.getStaticPaths (./astrowind-main/src/pages/[...tags]/[tag]/[...page].astro:1:3) 
    at async callGetStaticPaths (file://astrowind-main/node_modules/astro/dist/core/render/route-cache.js:20:18)
    at async getParamsAndProps (file://astrowind-main/node_modules/astro/dist/core/render/core.js:22:25)
    at async matchRoute (file://astrowind-main/node_modules/astro/dist/vite-plugin-astro-server/index.js:171:33)

Theme Version

0.2.0

Are you adding other plugins, integrations etc.?

No

video section

image
how can I have a video section like this
title:Find out more with
our [videos]

each video got a title and short description there

No loader is configured for ".node" files


`X [ERROR] No loader is configured for ".node" files: node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin-win32-x64-msvc/pinyin.win32-x64-msvc.node

    node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin/index.js:63:36:
      63 │             nativeBinding = require('@napi-rs/pinyin-win32-x64-msvc')
         ╵                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

03:41:42 PM [astro] update D:/websites/astrowind/.astro/types.d.ts
03:41:42 PM [content] Types generated
D:\websites\astrowind\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1636
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin/index.js:63:36: ERROR: No loader is configured for ".node" files: node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin-win32-x64-msvc/pinyin.win32-x64-msvc.node`


Load images from public/

I'm having a heck of a time integrating netlify-cms.

I've got it working now but I cannot get it to display uploaded images from the public folder. Is there something else I need to do? I tried making some changes to the glob in images.ts but nothing seemed to work. Any direction appreciated.

Example - if I change the image path in one of the placeholder blog posts from
image: ~/assets/images/stickers.jpg
to
image: public/box.jpg

No image displays. The image div never appears and there are no build or console errors. Thanks.

Thank you and a question about usage and attribution ❤️

Hi folks,

Thank you so much for creating this theme for Astro.
I've adopted it for my personal website and it's exactly what I wanted from a minimal blog template.

As a follow-up question - what would be the right way to attribute credit back to your work?
Is it ok if I keep the footer entry of Made by onWidget · All rights reserved. minus the icon to keep things clean and simple?

How to use MDX files

Hi,
In the description it is stated that MDX files are supported in data/blog folder as well. However when putting MDX files into that folder no blog posts are generated out of those files, only the MD files are considered. Could you please help? Thanks

Can I add a / to the end of post url for cloudflare pages

Hi

I have deployed a site to Cloudflare pages. When I visit a URL, https://mysite.com/post-name Cloudflare redirects it to https://mysite.com/post-name/ (with the trailing /) as a 308 redirect. This doesn't happen in the Dev environment and appears to be a known "feature" in Cloudflare pages. This is not ideal as it adds an extra request, so some load time.

Is there any way I could add the trailing / to generated links via the theme (e.g., in my blog post list, have the URLs be https//mysite.com/my-post/ instead of https//mysite.com/my-post)?

Thanks

Rob

Navigation bar was blinked in mobile device

There's a lil bug whenever the site was opened in mobile device after removing collapse in header section f580fe7. i know its confusing, in other hand we want the navigation work smoothly by removing collapse but in other hand too there is a blinked navigation menu when it is opened on a mobile device

image

[Feature Request] Full body content for RSS

Feature

Add an option to enable full body content into the RSS feed. Meaning that the blog post becomes embedded into the feed on its own.

Reasoning

This feature would enable readers to not have to visit my site directly every time in order to get the info they want (my blog posts in this case)

Links:

Addendum

First and foremost, I would like to thank you for creating this wonderful template! I've just recently started to use it, and it has been a real joy to work with.

Named export 'remarkReadingTime' not found in astro.config.mjs

Using npm v9.1.2 and node v14.18.1. I had a look on the Astro Discord and couldn't see any similar issues popping up for anyone.

Steps to reproduce, on the latest main
npm install
npm run start

Error message

file:///Users/irrelevant/astrowind/astro.config.mjs:12
import { remarkReadingTime } from './src/utils/frontmatter.js';
         ^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'remarkReadingTime' not found. The requested module './src/utils/frontmatter.js' is a CommonJS module, which may not support all module.exports as named exports.

a9d5667 is the latest commit that works for me. The next commit is upgrading Astro to 1.6.8
Steps to get running
git checkout a9d56673b47d9c4c7d41977eec13f2fb1b88fe54
npm install
npm run start

Blog tags are case sensitive

In your blog post in the array of tags if you ad a "Tag" with capital "T" and press on that tag on the website you will only see posts with "tag".
I expected for tags to ignore character cases.

Mobile Menu issue when using anchor links in Nav

I build out some sections on the homepage of the template, I added anchor links to the navbar so a site user can jump between sections of the page.

When using the site on mobile, I noticed that the links work (they take you to the correct section of the page as I can see the url change) But the mobile menu does not disappear.

The BasicScripts.Astro file has an attach event and an onpageshow event that look to be handling the display property for the mobile menu.

attachEvent('[data-aw-toggle-menu]', 'click', function (_, elem) {
elem.classList.toggle('expanded');
document.body.classList.toggle('overflow-hidden');
document.getElementById('header')?.classList.toggle('h-screen');
document.querySelector('#header nav')?.classList.toggle('hidden');
});

window.onpageshow = function () {
document.documentElement.classList.add('motion-safe:scroll-smooth');
const elem = document.querySelector('[data-aw-toggle-menu]');
if (elem) {
  elem.classList.remove('expanded');
}
document.body.classList.remove('overflow-hidden');
document.getElementById('header')?.classList.remove('h-screen');
document.querySelector('#header nav')?.classList.add('hidden');

};

1

1

Error clicking on blog link

In order to execute the project in my local environment, I executed the following commands:

npm install
npm run dev

The page http://localhost:3000 works, but when I click on blog link (http://localhost:3000/blog) I get this error:

 error   Missing or empty required params property on getStaticPaths route
  Hint:
    See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.
  File:
    /home/francesco/MyApp/website/src/pages/[...tags]/[tag]/[...page].astro
  Stacktrace:
GetStaticPathsExpectedParams: Missing or empty required params property on getStaticPaths route
    at file:///home/francesco/MyApp/website/node_modules/astro/dist/core/routing/validation.js:42:13
    at Array.forEach (<anonymous>)
    at validateGetStaticPathsResult (file:///home/francesco/MyApp/website/node_modules/astro/dist/core/routing/validation.js:40:10)
    at callGetStaticPaths (file:///home/francesco/MyApp/website/node_modules/astro/dist/core/render/route-cache.js:28:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getParamsAndProps (file:///home/francesco/MyApp/website/node_modules/astro/dist/core/render/core.js:24:25)
    at async matchRoute (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/route.js:27:31)
    at async run (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/request.js:38:28)
    at async runWithErrorHandling (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/controller.js:65:5)
    at async handleRequest (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/request.js:34:3)

Issue with peer dependencies : unmet peer sharp@^0.31.3: found 0.32.0

Dev script fails to start.
After git clone from https://github.com/onwidget/astrowind/tree/8db176fe924f50fa84bfc31c09e6150a5dde71de
pnpm install, pnpm run dev

Windows 10.0.22621
node 18.15.0
pnpm 8.0.0

Setting sharp to 0.31.3 instead of 0.32.0 fixes the issue.

See log below.

PS C:\PROG\_bug-repros> git clone https://github.com/onwidget/astrowind repro-astrowind
Cloning into 'repro-astrowind'...
remote: Enumerating objects: 4408, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4408 (delta 0), reused 1 (delta 0), pack-reused 4405
Receiving objects: 100% (4408/4408), 11.05 MiB | 4.92 MiB/s, done.
Resolving deltas: 100% (2558/2558), done.

PS C:\PROG\_bug-repros> cd .\repro-astrowind\

PS C:\PROG\_bug-repros\repro-astrowind> pnpm install
 WARN  deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
Packages: +784
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: C:\Users\Lionel\AppData\Local\pnpm\store\v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 806, reused 784, downloaded 0, added 784, done
node_modules/.pnpm/[email protected]/node_modules/nodejieba: Running install script, failed in 5.3s (skipped as optional)
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 506ms

devDependencies:
+ @astrojs/image 0.16.2 (0.16.3 is available)
+ @astrojs/mdx 0.18.2
+ @astrojs/partytown 1.1.1 (1.2.0 is available)
+ @astrojs/rss 2.3.1
+ @astrojs/sitemap 1.2.1
+ @astrojs/tailwind 3.1.1
+ @astrolib/analytics 0.3.0
+ @astrolib/seo 0.3.0
+ @fontsource/inter 4.5.15
+ @tailwindcss/typography 0.5.9
+ @typescript-eslint/eslint-plugin 5.57.0
+ @typescript-eslint/parser 5.57.0
+ astro 2.1.7 (2.1.8 is available)
+ astro-compress 1.1.35
+ astro-icon 0.8.0
+ eslint 8.36.0 (8.37.0 is available)
+ eslint-plugin-astro 0.26.1
+ eslint-plugin-jsx-a11y 6.7.1
+ limax 2.1.0 (4.0.0 is available)
+ mdast-util-to-string 3.1.1
+ prettier 2.8.7
+ prettier-plugin-astro 0.8.0
+ reading-time 1.5.0
+ sharp 0.32.0
+ svgo 2.8.0 (3.0.2 is available)
+ tailwindcss 3.2.7 (3.3.0 is available)
+ typescript 5.0.2

 WARN  Issues with peer dependencies found
.
└─┬ astro 2.1.7
  └── ✕ unmet peer sharp@^0.31.3: found 0.32.0

The integrity of 5901 files was checked. This might have caused installation to take longer.
Done in 37.6s


PS C:\PROG\_bug-repros\repro-astrowind> pnpm run dev

> @onwidget/[email protected] dev C:\PROG\_bug-repros\repro-astrowind
> astro dev

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error:
Something went wrong installing the "sharp" module

The specified procedure could not be found.
\\?\C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\s[email protected]\node_modules\sharp\build\Release\sharp-win32-x64.node

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
- Ensure the version of sharp aligns with the .pnpm package: "npm ls sharp"
    at Object.<anonymous> (C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\s[email protected]\node_modules\sharp\lib\sharp.js:37:9)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\s[email protected]\node_modules\sharp\lib\constructor.js:11:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) {
  plugin: undefined,
  hint: 'Browser APIs are not available on the server.\n' +
    '\n' +
    'If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a `client:only` directive to make the component exclusively run on the client.\n' +
    '\n' +
    'See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.\n' +
    '\t\t'
}```

Node.js v18.15.0
 ELIFECYCLE  Command failed with exit code 1.

About prettier configuration to format .astro files

So I had this situation on VSCode when saving .astro files, wonder if anyone is having the same issue (if its a issue to begin with):

["INFO" - 15:40:30] Formatting file:///%path%\project/src/components/widgets/Footer.astro
["INFO" - 15:40:30] Using config file at '%path%\project\.prettierrc'
["INFO" - 15:40:30] Using ignore file (if present) at '%path%\project\.prettierignore
["INFO" - 15:40:30] File Info:
{
  "ignored": false,
  "inferredParser": null
}
["WARN" - 15:40:30] Parser not inferred, trying VS Code language.
["ERROR" - 15:40:30] Failed to resolve a parser, skipping file. If you registered a custom file extension, be sure to configure the parser.

My expectation is that VSCode format the current file on save, which wasn't happening.

The solution I found: Switch to .prettierrc.js and add the override for parser .astro and require the prettier-plugin-astro (line 2) as below:

Note: I tried the override in original .prettierrc file but I couldn't make it work.

module.exports = {
  plugins: [require.resolve('prettier-plugin-astro')],
  printWidth: 120,
  semi: true,
  singleQuote: true,
  tabWidth: 2,
  trailingComma: 'es5',
  useTabs: true,
  overrides: [
    {
      files: '*.astro',
      options: {
        parser: 'astro',
      },
    },
    {
      files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
      options: {
        useTabs: false,
      },
    },
  ],
};

With .prettierrc.js I can save and it will format .astro files.

But I was looking at the commits, and at a time there was this config .prettierrc.js but it was removed. Commit was named: "Remove prettier until prettier-plugin-astro v1.x"

Then prettier was added back with .prettierrc file on this commit

am I missing any context or something else?

Feature request: supporting MDX for Components within blog markdown files

New to Astro here, and have tried to follow along some of the guides but weren't able to get this going. It seems that post.js is also a specific helper outside of the Astro files.

Would be glad to see an update to the theme with both .md and .mdx supported if that's something you ever get around to :-)

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.