Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Build"

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

permissions:
Expand Down
1 change: 1 addition & 0 deletions result
24 changes: 24 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
48 changes: 48 additions & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Astro Starter Kit: Basics

```sh
npm create astro@latest -- --template basics
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```

To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).

## 🧞 Commands

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:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
8 changes: 8 additions & 0 deletions site/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-check
import { defineConfig } from "astro/config";

// https://astro.build/config
export default defineConfig({
site: "https://42willow.github.io",
base: "wallpapers",
});
Binary file added site/bun.lockb
Binary file not shown.
14 changes: 14 additions & 0 deletions site/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "site",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^5.6.1"
}
}
121 changes: 121 additions & 0 deletions site/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions site/src/assets/wallpapers
39 changes: 39 additions & 0 deletions site/src/components/Card.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
import type { ImageMetadata } from "astro";
import { Image } from "astro:assets";

interface Props {
images: Record<string, () => Promise<{ default: ImageMetadata }>>;
imagePath: string;
name: string;
flavour: string;
author?: string;
}

const { images, imagePath, name, flavour, author } = Astro.props;
if (!images[imagePath])
throw new Error(`"${imagePath}" does not exist in glob`);
---

<div class="card" class:list={flavour}>
<h2>{name}</h2>
{
author && (
<p>
<strong>author:</strong> {author}
</p>
)
}
<Image
src={images[imagePath]()}
alt={author ? `${name} by ${author}` : name}
width={400}
class="wallpaper"
/>
</div>

<style>
.wallpaper {
border-radius: var(--br);
}
</style>
48 changes: 48 additions & 0 deletions site/src/components/Gallery.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
import Card from "./Card.astro";
import type { ImageMetadata } from "astro";

const images = import.meta.glob<{ default: ImageMetadata }>(
"/src/assets/**/*.{jpeg,jpg,png,gif}",
);

let re =
/^\/src\/assets\/wallpapers\/(?<flavour>\w+)\/(?<type>\w+)\/(?:(?<category>\w+)\/)?(?:(?<author>\w+)\/)?(?<name>\w+)\..*$/;

const walls = Object.keys(images)
.map((item) => {
// console.log(`item: ${item}`);
const match = item.match(re);
// console.log(match);
if (!match) {
throw new Error(`failed to parse image path: ${item}`);
}
return {
path: item,
flavour: match.groups?.flavour,
type: match.groups?.type,
category: match.groups?.category,
author: match.groups?.author,
name: match.groups?.name,
};
})
.filter((item) => item !== null);
---

<div id="container">
<main>
<section id="gallery">
{
walls.map((item) => (
<Card
images={images}
imagePath={item.path}
name={item.name as string}
flavour={item.flavour as string}
author={item.author}
/>
))
}
</section>
</main>
</div>
16 changes: 16 additions & 0 deletions site/src/components/Greeting.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<p>hii, welcome to my wallpaper dump!</p>

<p>remember to credit original authors and enjoy your stay ^-^</p>

<p class="sub">
<strong>note:</strong> the reason the wallpapers are compressed is to speed up
your viewing experience, if you hover over the wallpaper you will find a download
button
</p>

<style>
.sub {
color: var(--ctp-macchiato-subtext0);
font-style: italic;
}
</style>
Loading