Add files
This commit is contained in:
commit
c013a710f5
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
@ -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/
|
4
.vscode/extensions.json
vendored
Normal file
4
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["astro-build.astro-vscode"],
|
||||||
|
"unwantedRecommendations": []
|
||||||
|
}
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "./node_modules/.bin/astro dev",
|
||||||
|
"name": "Development server",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
39
README.md
Normal file
39
README.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# 网站备案网站
|
||||||
|
|
||||||
|
内容主要是关于个人旅游日志以及展示精彩画册,也可以按照实际情况修改和调整网站内容。
|
||||||
|
|
||||||
|
|
||||||
|
### 使用
|
||||||
|
|
||||||
|
#### 替换必要配置
|
||||||
|
|
||||||
|
在文件中找到 `src/const.ts` 并替换为最新的内容。
|
||||||
|
配置说明:
|
||||||
|
|
||||||
|
* `WEB_SITE_NAME` : 网站名称
|
||||||
|
* `ICP_NUM`: 网站备案号
|
||||||
|
|
||||||
|
#### 生成静态文件
|
||||||
|
|
||||||
|
> 需要提前安装 nodejs 运行环境。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
|
||||||
|
# 首次需要安装依赖
|
||||||
|
npm install
|
||||||
|
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
运行上述构建命令后 当前目录下应该可以看到 dist 文件夹,将这个文件夹部署到相关服务器即可。
|
||||||
|
|
||||||
|
#### 预览(可选)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
|
||||||
|
npm run preview
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
可以选择在本地运行并预览网站。
|
10
astro.config.mjs
Normal file
10
astro.config.mjs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// @ts-check
|
||||||
|
// @ts-check
|
||||||
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
|
import tailwind from '@astrojs/tailwind';
|
||||||
|
|
||||||
|
// https://astro.build/config
|
||||||
|
export default defineConfig({
|
||||||
|
integrations: [tailwind()]
|
||||||
|
});
|
7181
package-lock.json
generated
Normal file
7181
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
package.json
Normal file
22
package.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "personal-site",
|
||||||
|
"type": "module",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "astro dev",
|
||||||
|
"build": "astro check && astro build",
|
||||||
|
"preview": "astro preview",
|
||||||
|
"astro": "astro"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@astrojs/check": "^0.9.4",
|
||||||
|
"@astrojs/tailwind": "^5.1.2",
|
||||||
|
"astro": "^5.0.0-beta.7",
|
||||||
|
"tailwindcss": "^3.4.14",
|
||||||
|
"typescript": "^5.6.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
|
"daisyui": "^4.12.14"
|
||||||
|
}
|
||||||
|
}
|
2032
public/a_confused_person.svg
Normal file
2032
public/a_confused_person.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 63 KiB |
1
public/favicon.svg
Normal file
1
public/favicon.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 32 32"><path fill="#00b837" d="M27.38 5.49c-1.073-.604-2.786.37-3.828 2.182l-1.885 3.281a4.14 4.14 0 0 0 .281 4.24l.052.083c.87 1.255 2.047 2.411 2.432 2.823c1.099 1.177.563 3.099-.984 3.542c-1.474.411-2.896-.813-2.703-2.333c.063-.464-.089-1.234-.766-1.984c-.672-.75-2.052.667-2.495 2.146l-.021.083c-.448 1.458-.729 2.734-.646 2.859q.078.115.141.24c1.51 2.844-2.75 5.109-4.26 2.271a2.41 2.41 0 0 1 .995-3.266l.161-.078c.089-.042.349-.651.563-1.375l.401-1.318a1.2 1.2 0 0 0 .063-.224l1.198-4.255l-1.276 2.615c-.151-.484-.401-.505-.948-.12c-.323.245-.87.708-1.135.891c-.484.365-.911 1.052-1.13 1.479a1.75 1.75 0 0 1-.547.667c-.911.75-2.25.609-2.979-.302c-.99-1.234-.333-3.078 1.214-3.401c.547-.125 2.37-1.24 3.464-2.031c.203-.141.365-.26.505-.401l2.938-2.229l-2.552 1.375s-.26-.021-.568.026c-.932.099-1.906.24-2.083.464a1.3 1.3 0 0 1-.391.365a1.906 1.906 0 0 1-2.651-.422a1.92 1.92 0 0 1 .448-2.661a2.05 2.05 0 0 1 1.156-.365c.688.021 2.49.385 3.99.125l.385-.063c1.516-.26 3.297-1.578 4.031-2.917l1.578-2.755c.87-1.516.813-3.177-.141-3.724L17.621.007c-.87-.484-2.286-.484-3.135 0L2.673 6.627c-.891.469-1.599 1.682-1.599 2.677v12.99c0 .995.708 2.208 1.573 2.693l11.797 6.646c.87.484 2.292.484 3.141 0l11.766-6.646c.87-.49 1.578-1.698 1.578-2.693V9.284c0-.995-.708-2.208-1.557-2.698l-1.948-1.094z"/></svg>
|
After Width: | Height: | Size: 1.3 KiB |
81
src/const.ts
Normal file
81
src/const.ts
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
export const WEB_SITE_NAME = '个人站点';
|
||||||
|
export const ICP_NUM = '备案号';
|
||||||
|
|
||||||
|
|
||||||
|
type tour = {
|
||||||
|
face: string,
|
||||||
|
title: string,
|
||||||
|
year: string,
|
||||||
|
description: string
|
||||||
|
};
|
||||||
|
|
||||||
|
export const TOURS: Array<tour> = [
|
||||||
|
{
|
||||||
|
face: "https://images.unsplash.com/photo-1515700281303-5a0a73d9c584?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=elizeu-dias-ibBMmZjxKSo-unsplash.jpg&w=640",
|
||||||
|
year: "2023",
|
||||||
|
title: "南美洲风情之旅",
|
||||||
|
description: "我来到了热情似火的南美洲,在巴西里约热内卢,基督像张开双臂俯瞰着这座充满活力的城市。科帕卡巴纳海滩上,人们尽情享受阳光和沙滩,足球在人群中穿梭,桑巴音乐似乎在空气中流淌,处处彰显着巴西人的热情。而在秘鲁,马丘比丘这座古老的印加帝国遗址让我深深着迷。它坐落在群山之间,云雾缭绕下更显神秘。古老的石墙、狭窄的街道、宏伟的建筑,无不诉说着曾经辉煌的文明,我仿佛能看到古代印加人的生活场景,感受到他们的智慧和勤劳。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
face: "https://images.unsplash.com/photo-1517846875602-2371528547d4?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=sutirta-budiman-89IBtfoz3Vw-unsplash.jpg&w=640",
|
||||||
|
year: "2022",
|
||||||
|
title: "非洲探秘之旅",
|
||||||
|
description: "这一年,我怀着对原始神秘大陆的向往,开启了非洲之旅。在肯尼亚,我深入马赛马拉国家保护区,见证了举世闻名的动物大迁徙。那浩浩荡荡的角马群如奔腾的河流,它们跨越马拉河的场景惊心动魄,河中潜伏的鳄鱼虎视眈眈,生死瞬间在眼前上演,这是大自然最残酷也最壮丽的画卷。除了大迁徙,保护区内的狮子、猎豹、大象等各种珍稀动物也让我大开眼界。它们在广袤的草原上自由生活,每一个姿态都展现出生命的力量。在南非开普敦,我登上桌山,从山顶俯瞰,大西洋和印度洋在这里交汇,那湛蓝的海水、翻滚的海浪和远处的山峦构成了一幅气势磅礴的画面。开普敦的城市风光也别具一格,色彩斑斓的房屋点缀在海边,充满了活力。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
face: "https://images.unsplash.com/photo-1673627114526-b83c09d3a760?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=vaskar-sam-ZHh4z7-K4tI-unsplash.jpg&w=640",
|
||||||
|
year: "2021",
|
||||||
|
title: "东南亚海滨之旅",
|
||||||
|
description: "冬天,我来到了泰国普吉岛,享受阳光沙滩的悠闲时光。白色的沙滩细腻柔软,蓝色的大海一望无际。我躺在沙滩椅上,沐浴着阳光,听着海浪的声音,感受着大自然的美好。普吉岛的水上活动丰富多彩,我尝试了潜水和浮潜,看到了五彩斑斓的海底世界。在马来西亚兰卡威,美丽的海岛风光让我流连忘返。天空之桥的惊险刺激让我心跳加速,珍南海滩的日落美景让我陶醉其中。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
face: "https://images.unsplash.com/photo-1729284439331-0afedb2cb5ea?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=rubina-ajdary-eTTgAAVEJl4-unsplash.jpg&w=640",
|
||||||
|
year: "2020",
|
||||||
|
title: "国内山水之旅",
|
||||||
|
description: "由于特殊情况,我的旅行脚步留在了国内。我走进了桂林,领略了甲天下的山水风光。漓江的水清澈见底,两岸的山峰形态各异。我乘坐竹筏顺流而下,仿佛置身于一幅美丽的山水画卷之中。阳朔的西街充满了文艺气息,古老的建筑与现代的商业完美融合。在张家界,奇峰异石让人叹为观止。天子山的云海如仙境般美丽,袁家界的阿凡达取景地更是让我仿佛进入了一个奇幻的世界。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
face: "https://images.unsplash.com/photo-1502602898657-3e91760cbb34?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=chris-karidis-nnzkZNYWHaU-unsplash.jpg&w=640",
|
||||||
|
year: "2019",
|
||||||
|
title: "欧洲文化之旅",
|
||||||
|
description: "夏天,我飞往欧洲,感受古老而璀璨的文化魅力。在法国巴黎,埃菲尔铁塔高耸入云,塞纳河静静流淌。我登上埃菲尔铁塔,俯瞰整个巴黎的美景,感受这座浪漫之都的魅力。卢浮宫的艺术珍品让我惊叹不已,蒙娜丽莎的微笑更是让我沉醉其中。在意大利罗马,古老的斗兽场诉说着历史的沧桑。我漫步在古罗马广场,仿佛能听到千年前的呐喊声。万神殿的宏伟建筑让人感受到古罗马人的智慧和创造力。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
face: "https://images.unsplash.com/photo-1723569199338-34d3e73e2499?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=stephen-h-Ox5h3uz9t6o-unsplash.jpg&w=640",
|
||||||
|
year: "2018",
|
||||||
|
title: "日本赏樱之旅",
|
||||||
|
description: "春天,我踏上了日本的土地,开启了一场浪漫的赏樱之旅。在京都,古老的寺庙与绚烂的樱花相互映衬,仿佛穿越回了过去。清水寺的红色建筑在粉色樱花的簇拥下,显得格外庄重而美丽。漫步在哲学之道,两岸的樱花树如粉色的云朵般绽放,花瓣随风飘落,如同梦幻的仙境。在奈良,可爱的小鹿与樱花共同构成了一幅和谐的画面。小鹿们在樱花树下嬉戏玩耍,时而向游客讨要食物,时而安静地享受着春天的气息。"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
export const ALBUM_NAME_ANIMAL_WORLD = 'animal-world'
|
||||||
|
export const ALBUM_NAME_ENCHANTED_FOREST = 'enchanted-forest'
|
||||||
|
|
||||||
|
// type album = {
|
||||||
|
// title: string,
|
||||||
|
// face: string
|
||||||
|
// }
|
||||||
|
|
||||||
|
export const ALBUMS = {
|
||||||
|
'animal-world': {
|
||||||
|
title: "开启奇妙的动物王国之旅",
|
||||||
|
description: "汇聚了大自然神奇与美妙的视觉盛宴,它宛如一扇通往神秘动物王国的大门,引领读者走进一个充满生机与魅力的世界。",
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: "",
|
||||||
|
desc: ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'enchanted-forest': {
|
||||||
|
title: "踏入奇幻之境的神秘邀约",
|
||||||
|
description: "宛如一把神奇的钥匙,为你开启一扇通往充满神秘与魅力世界的大门。在这个世界里,每一页都弥漫着魔法的气息,而那巨大的树木无疑是这片魔法森林的灵魂所在",
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: "",
|
||||||
|
desc: ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
62
src/layouts/Layout.astro
Normal file
62
src/layouts/Layout.astro
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
import {
|
||||||
|
WEB_SITE_NAME,
|
||||||
|
ICP_NUM,
|
||||||
|
ALBUM_NAME_ENCHANTED_FOREST,
|
||||||
|
ALBUM_NAME_ANIMAL_WORLD,
|
||||||
|
} from "../const";
|
||||||
|
---
|
||||||
|
|
||||||
|
<html lang="zh-cn" data-theme="cupcake">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta name="generator" content={Astro.generator} />
|
||||||
|
<title>{WEB_SITE_NAME}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<div class="navbar bg-neutral text-neutral-content">
|
||||||
|
<div class="flex-1">
|
||||||
|
<a class="btn btn-ghost text-xl font-semibold" href="/"
|
||||||
|
>{WEB_SITE_NAME}</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="flex-none">
|
||||||
|
<ul class="menu menu-horizontal px-1">
|
||||||
|
<li><a href="/about" class="font-medium">关于我</a></li>
|
||||||
|
<li>
|
||||||
|
<details class="">
|
||||||
|
<summary class="font-medium">精美画册</summary>
|
||||||
|
<ul class="bg-neutral text-neutral-content">
|
||||||
|
<li>
|
||||||
|
<a href={'/album/' + ALBUM_NAME_ENCHANTED_FOREST}
|
||||||
|
>魔法森林</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href={'/album/' + ALBUM_NAME_ANIMAL_WORLD}
|
||||||
|
>动物世界</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<main class="">
|
||||||
|
<slot />
|
||||||
|
</main>
|
||||||
|
<footer
|
||||||
|
class="footer footer-center bg-base-300 text-base-content mt-12 p-8"
|
||||||
|
>
|
||||||
|
<aside>
|
||||||
|
<p>
|
||||||
|
Copyright © {new Date().getFullYear()} - All right reserved
|
||||||
|
by {WEB_SITE_NAME} | {ICP_NUM}
|
||||||
|
</p>
|
||||||
|
</aside>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
33
src/pages/404.astro
Normal file
33
src/pages/404.astro
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="zh-cn" data-theme="cupcake">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>404 Not Found</title>
|
||||||
|
</head>
|
||||||
|
<body class="bg-gray-50">
|
||||||
|
<div class="min-h-screen flex items-center justify-center">
|
||||||
|
<div class="card">
|
||||||
|
<figure>
|
||||||
|
<img class="h-81" src="/a_confused_person.svg" alt="404 not found">
|
||||||
|
</figure>
|
||||||
|
<div class="card-body">
|
||||||
|
<h2 class="card-title">
|
||||||
|
404 不存在
|
||||||
|
</h2>
|
||||||
|
<p class="font">
|
||||||
|
你输入的网址并不存在,请确认是否有拼写错误!
|
||||||
|
</p>
|
||||||
|
<div class="mt-4 card-actions justify-center">
|
||||||
|
<a href="/" class="btn btn-primary btn-wide rounded-md">返回首页</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
33
src/pages/about.astro
Normal file
33
src/pages/about.astro
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
import Layout from "../layouts/Layout.astro";
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<article class="prose m-auto mt-12">
|
||||||
|
<h1>探索世界,遇见自我 ——[你的名字] 的旅行故事</h1>
|
||||||
|
<p>
|
||||||
|
世界是一本浩瀚无垠的书,而旅行则是翻开每一页的钥匙。我,一个对世界充满无尽好奇的旅游爱好者,怀揣着对远方的憧憬,踏上了一场又一场奇妙的旅程,只为在不同的风景中,发现不一样的自己。
|
||||||
|
</p>
|
||||||
|
<h2>我的旅行故事</h2>
|
||||||
|
<p>
|
||||||
|
从踏上旅程的那一刻起,我便被这个世界的多样性所深深吸引。每一次的出发,都是一次对未知的挑战,也是一次与美好相遇的契机。
|
||||||
|
我曾漫步在古老的欧洲城市,感受着历史的沉淀与文化的魅力。巴黎的埃菲尔铁塔下,我见证了爱情的浪漫;罗马的斗兽场中,我仿佛听到了千年前的呐喊。在伦敦的大本钟旁,我聆听着时间的滴答声,思考着人生的意义。
|
||||||
|
亚洲的神秘国度也留下了我的足迹。在日本的京都,我沉醉于樱花的美丽与宁静;在泰国的普吉岛,我享受着阳光沙滩的悠闲与惬意。古老的寺庙、热闹的集市、美味的街头小吃,每一个瞬间都成为了我记忆中最珍贵的宝藏。
|
||||||
|
我还穿越广袤的非洲大地,领略了大自然的狂野与壮美。在肯尼亚的马赛马拉国家公园,我目睹了壮观的动物大迁徙,感受到了生命的奇迹与力量。在南非的开普敦,我登上桌山,俯瞰着大西洋与印度洋的交汇,被那壮丽的景色所震撼。
|
||||||
|
美洲的辽阔土地同样让我流连忘返。纽约的时代广场上,霓虹灯闪烁,人群熙熙攘攘;洛杉矶的好莱坞,星光璀璨,梦想在这里绽放。在墨西哥的玛雅遗址,我探寻着古老文明的奥秘,为人类的智慧所折服。
|
||||||
|
大洋洲的碧海蓝天也给我带来了无尽的惊喜。在澳大利亚的大堡礁,我潜入海底,与五彩斑斓的鱼儿共舞;在新西兰的皇后镇,我挑战极限运动,释放着内心的激情。
|
||||||
|
</p>
|
||||||
|
<h2>旅行的意义</h2>
|
||||||
|
<p>
|
||||||
|
对我来说,旅行不仅仅是为了欣赏美丽的风景,更是一种心灵的洗礼。在旅途中,我学会了尊重不同的文化和价值观,学会了包容和理解。我结识了来自世界各地的朋友,分享着彼此的故事和梦想。每一次的旅行,都让我更加珍惜生活,更加热爱这个世界。
|
||||||
|
</p>
|
||||||
|
<h2>未来的旅行计划</h2>
|
||||||
|
<p>
|
||||||
|
我的旅行之路还在继续。未来,我希望能够踏上南极洲的土地,感受那片纯净的冰雪世界;我还想深入南美洲的亚马逊雨林,探索大自然的神秘之处。我相信,只要心中有梦想,脚步就不会停止。
|
||||||
|
</p>
|
||||||
|
<h2>结语</h2>
|
||||||
|
<p>
|
||||||
|
旅行,是一场永无止境的冒险。我将继续背着行囊,行走在这个美丽的世界上,用我的脚步丈量大地,用我的眼睛记录风景,用我的心灵感受生活。让我们一起在旅途中,遇见更好的自己。
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</Layout>
|
50
src/pages/album/[id].astro
Normal file
50
src/pages/album/[id].astro
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
import type { GetStaticPaths } from "astro";
|
||||||
|
import Layout from "../../layouts/Layout.astro";
|
||||||
|
import {
|
||||||
|
ALBUM_NAME_ANIMAL_WORLD,
|
||||||
|
ALBUM_NAME_ENCHANTED_FOREST,
|
||||||
|
ALBUMS,
|
||||||
|
} from "../../const";
|
||||||
|
|
||||||
|
export const getStaticPaths = () => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
params: {
|
||||||
|
id: ALBUM_NAME_ANIMAL_WORLD,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
params: {
|
||||||
|
id: ALBUM_NAME_ENCHANTED_FOREST,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
const { id } = Astro.params;
|
||||||
|
let album = {
|
||||||
|
title: "",
|
||||||
|
description: "",
|
||||||
|
images: [{}],
|
||||||
|
};
|
||||||
|
|
||||||
|
if (id == ALBUM_NAME_ANIMAL_WORLD) {
|
||||||
|
album = ALBUMS[id];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id == ALBUM_NAME_ENCHANTED_FOREST) {
|
||||||
|
album = ALBUMS[id];
|
||||||
|
}
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<article class="m-auto mt-12 prose">
|
||||||
|
<h1>{album.title}</h1>
|
||||||
|
<p>{album.description}</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<section class="m-auto grid-cols-1 md:grid-cols-4">
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</Layout>
|
45
src/pages/index.astro
Normal file
45
src/pages/index.astro
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
import Layout from "../layouts/Layout.astro";
|
||||||
|
import { TOURS } from "../const";
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<section
|
||||||
|
class="hero min-h-screen"
|
||||||
|
style="background-image: url(https://images.unsplash.com/photo-1425342605259-25d80e320565?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=amanda-sandlin-jIdKrtJF8Uk-unsplash.jpg&w=1920);"
|
||||||
|
>
|
||||||
|
<div class="hero-overlay bg-opacity-10"></div>
|
||||||
|
<div class="hero-content text-secondary-content text-center">
|
||||||
|
<div class="max-w-md">
|
||||||
|
<h1 class="mb-5 text-5xl font-bold">世界,你好</h1>
|
||||||
|
<p class="mb-5">追随世界的光影,书写旅行的诗篇。</p>
|
||||||
|
<a class="btn btn-primary" href="#tours">马上出发</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section class="max-w-5xl 2xl:max-w-7xl m-auto pt-10">
|
||||||
|
<div class="tours" id="tours">
|
||||||
|
<h1 class="text-3xl font-bold">人生之旅</h1>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-2">
|
||||||
|
{
|
||||||
|
TOURS.map((tour) => (
|
||||||
|
<div class="card border rounded-xl shadow-xl md:mt-8">
|
||||||
|
<figure>
|
||||||
|
<img
|
||||||
|
class="object-cover md:h-72 2xl:h-108"
|
||||||
|
src={tour.face}
|
||||||
|
alt={tour.title}
|
||||||
|
/>
|
||||||
|
</figure>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="card-title">{tour.title}</div>
|
||||||
|
<time datetime={tour.year}>{tour.year}</time>
|
||||||
|
<p>{tour.description}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</Layout>
|
11
tailwind.config.mjs
Normal file
11
tailwind.config.mjs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
export default {
|
||||||
|
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
daisyui: {
|
||||||
|
thems: ["light", "dark", "cupcake"]
|
||||||
|
},
|
||||||
|
plugins: [require("@tailwindcss/typography"), require("daisyui")],
|
||||||
|
}
|
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "astro/tsconfigs/strict",
|
||||||
|
"include": [
|
||||||
|
".astro/types.d.ts",
|
||||||
|
"**/*"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"dist"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user