AstroLaravel企业官网

laravel-astro-landing — Astro 企业官网模板

作者 lauroguedes

把 Astro 静态落地页放进 Laravel 仓库的开发依赖包,用 artisan 命令创建、运行并单独部署落地页。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

1 个预览视图
作者提供的预览
作者提供的预览

来自项目 README 的原始预览。

目前有 1 张原始预览,可打开完整图片查看设计细节。

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-13查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

通过 landing:install 一条命令在 landing/ 目录创建 Astro 项目,支持空模板、官方示例、任意仓库和 astro.build 免费主题

02

安装器自动发布 config/landing.php、更新 .gitignore、在 Tailwind v4 的 app.css 中排除落地页目录,并写入 LANDING_URL

03

composer run dev 可将 Astro 开发服务器作为额外进程启动,也可用 landing:dev 与 landing:build 单独运行和构建

04

landing:workflow 生成只监听 landing/** 变更的 GitHub Actions 工作流,支持 Cloudflare Pages、Netlify、Vercel、GitHub Pages 和 SSH 部署

05

可选将 Laravel 根路由重定向到 LANDING_URL,未设置该变量时保持原有首页行为

06

为 Laravel Boost 提供指南和 astro-landing-development 技能,便于 AI 代理理解落地页的构建与部署方式

模板详细介绍

这是一个 Laravel 开发依赖包,用于在 Laravel 应用所在的仓库中维护一个独立的 Astro 落地页。它的思路是把营销页面与应用分开:落地页是静态站点,适合放在 CDN 上,由写文案的人维护;应用需要 PHP、数据库和迁移,两者通过同一仓库保持同步,但不互相耦合。

安装后通过 landing:install 命令在 landing/ 目录创建 Astro 项目,来源可以是空模板、官方示例、任意 Git 仓库或 astro.build/themes 中的免费主题。安装器会发布 config/landing.php、补充 .gitignore、在 Tailwind v4 的 app.css 中加入 @source not 排除落地页目录、写入 GitHub Actions 工作流、向 .env 添加 LANDING_URL,并可选地把应用根路由重定向到落地页。已有文件不会被覆盖,除非显式使用 --force。

运行方面,Laravel 13.16 及以上版本可用 composer run dev 把落地页作为额外进程启动在 4321 端口;也可单独执行 landing:dev 与 landing:build。部署由 landing:workflow 生成 GitHub Actions 工作流,支持 Cloudflare Pages、Netlify、Vercel、GitHub Pages 和自有 SSH 服务器,工作流只监听 landing/** 的变更。

限制与前提:包本身是开发依赖,不参与服务器端运行;需要 PHP 8.3+、Laravel 12 或 13,以及 Node.js 22.12+ 或 Bun。付费主题没有公开仓库,需要自行购买后用 --template=owner/repo 安装。

AstroLaravel企业官网

适合你的项目吗?

适用场景

  • Laravel 应用需要一个独立维护、静态托管的营销落地页,同时希望与应用代码在同一仓库中保持同步
  • 希望用 Astro 官方示例或 astro.build 免费主题快速搭建落地页,而不从零配置构建流程
  • 需要把落地页部署到 Cloudflare Pages、Netlify、Vercel、GitHub Pages 或自有服务器,并让部署只在落地页变更时触发
  • 希望应用根路径自动跳转到落地页,或把落地页挂在应用域名的某个子路径下(如 /lp)

适合人群

  • 使用 Laravel 12 或 13、PHP 8.3+ 的项目,且团队愿意在仓库中同时维护应用与静态落地页
  • 需要将落地页与应用分开部署、分开托管,但保持同一套 pull request 和 issue 流程的团队
  • 希望落地页由非 PHP 开发者(如文案或设计人员)通过 Astro 模板维护的项目

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    以开发依赖方式安装:composer require lauroguedes/laravel-astro-landing --dev,然后运行 php artisan landing:install

  2. 2

    环境要求 PHP 8.3+、Laravel 12 或 13,以及 Node.js 22.12+ 或 Bun

  3. 3

    所有交互问题都有对应命令行参数,可用 --no-interaction 配合 --path、--template、--pm、--add、--deploy、--branch、--redirect-root 等参数无人值守安装

  4. 4

    部署工作流需要设置仓库变量 LANDING_URL,并按目标平台配置相应 secrets(如 Cloudflare、Netlify、Vercel 或 SSH 凭据)

  5. 5

    付费主题无公开仓库,需先购买再用 --template=owner/repo 安装;演示图片、字体等第三方素材需单独核对许可

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 该包仅为开发依赖,不会在服务应用的服务器上运行;落地页由 GitHub Actions 部署,而非 PHP。
  • 付费主题没有公开仓库,需先自行购买,再用 --template=owner/repo 安装。
  • 每个部署工作流都需要设置仓库变量 LANDING_URL(落地页公开地址)。
  • 部署到 Cloudflare Pages 需要配置 CLOUDFLARE_API_TOKEN 与 CLOUDFLARE_ACCOUNT_ID 密钥。
  • 部署到 Netlify 需要配置 NETLIFY_AUTH_TOKEN 与 NETLIFY_SITE_ID 密钥。
  • 部署到 Vercel 需要配置 VERCEL_TOKEN、VERCEL_ORG_ID 与 VERCEL_PROJECT_ID 密钥。
  • 部署到自有 SSH 服务器需要配置 LANDING_SSH_HOST、LANDING_SSH_USER、LANDING_SSH_KEY、LANDING_SSH_PATH 等密钥。
  • 运行需要 PHP 8.3+、Laravel 12 或 13,以及 Node.js 22.12+ 或 Bun。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

It is a development dependency: nothing in it runs on the server that serves your application.

README 原文

Paid themes have no public repository; the installer says so and links to where to buy one, which you then install with `--template=owner/repo`.

README 原文

Every workflow needs the repository variable `LANDING_URL`, the landing's public URL.

README 原文

| `cloudflare-pages` | `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` |

README 原文

| `netlify` | `NETLIFY_AUTH_TOKEN`, `NETLIFY_SITE_ID` |

README 原文

| `vercel` | `VERCEL_TOKEN`, `VERCEL_ORG_ID`, `VERCEL_PROJECT_ID` |

README 原文

| `ssh` | `LANDING_SSH_HOST`, `LANDING_SSH_USER`, `LANDING_SSH_KEY`, `LANDING_SSH_PATH`; optional `LANDING_SSH_PORT`, `LANDING_SSH_KNOWN_HOSTS` |

README 原文

- PHP 8.3+, Laravel 12 or 13 - Node.js 22.12+ (or Bun) for Astro

README 原文
https://github.com/lauroguedes/laravel-astro-landing/blob/main/LICENSE.mdhttps://github.com/lauroguedes/laravel-astro-landing/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-13。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料一般 · 73 / 100
技术栈
Astro · Laravel
网站类型
企业官网
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-10-13
截图检查日期
2026-10-13

目前没有记录演示链接。请依据仓库说明在本地评估;仅凭截图无法确认交互行为。

目录记录的主要技术栈是 Astro。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: [email protected] · 2026-10-13

查看当时使用的来源资料

SHA-256: 9dbc2077ce3e5deafebb595b817f3390c7e35cb899bb1102a8ffee9467413d07

2026-10-13T07:38:33.639Z

来源文件 / 仓库
# Laravel Astro Landing

[![Tests](https://github.com/lauroguedes/laravel-astro-landing/actions/workflows/tests.yml/badge.svg)](https://github.com/lauroguedes/laravel-astro-landing/actions/workflows/tests.yml)
[![Latest Version](https://img.shields.io/github/v/release/lauroguedes/laravel-astro-landing?style=flat&label=packagist&cacheSeconds=3600)](https://packagist.org/packages/lauroguedes/laravel-astro-landing)
[![Downloads](https://img.shields.io/packagist/dt/lauroguedes/laravel-astro-landing?style=flat&cacheSeconds=3600)](https://packagist.org/packages/lauroguedes/laravel-astro-landing/stats)
[![License](https://img.shields.io/badge/License-MIT-green?style=flat)](LICENSE.md)

Keep an [Astro](https://astro.build) landing page in the same repository as your
Laravel application, and deploy it somewhere else.

<img width="2172" height="724" alt="Laravel + Astro Glassmorphism Banner" src="https://github.com/user-attachments/assets/649cff0c-bf64-4e5a-95cc-baf7d1583cc4" />

A product's marketing site and the product itself change for different reasons
and belong on different servers: the landing is static, cheap to host on a CDN
and edited by whoever writes the copy; the application needs PHP, a database and
a deploy that runs migrations. Keeping them in one repository keeps them in sync
(same pull requests, same issues, and a landing that links to the routes that
actually exist), as long as nothing couples them.

This package is the decoupling, set up in one command:

- **`landing:install`** creates the Astro project in `landing/` from an empty
  template, an official example, any template repository, or a free theme from
  the [Astro themes catalog](https://astro.build/themes/).
- **`composer run dev`** starts the landing next to the application (Laravel 13.16+).
- **`landing:workflow`** writes a GitHub Actions workflow that builds and deploys
  the landing to Cloudflare Pages, Netlify, Vercel, GitHub Pages or your own
  server, and runs only when the landing changed.

## Installation

```bash
composer require lauroguedes/laravel-astro-landing --dev
php artisan landing:install
```

It is a development dependency: nothing in it runs on the server that serves
your application. The landing is deployed by GitHub Actions, not by PHP.

`landing:install` asks where the landing lives, what it starts from, which
package manager to use, where it deploys, where visitors will reach it, and
whether the application's home page should send them there (plus, for an empty
project, which integrations to add). Then it runs `create-astro`, installs the
dependencies and wires the rest:

```
 ┌ What should the landing start from? ─────────────────────────┐
 │ › ● An empty project: Astro's minimal template               │
 │   ○ An official Astro example                                │
 │   ○ A template repository on GitHub, GitLab or Bitbucket     │
 │   ○ A free theme from astro.build/themes                     │
 └──────────────────────────────────────────────────────────────┘
```

| What it does | Why |
|---|---|
| Creates `landing/` with `create-astro` | Its own `package.json`, lockfile and build |
| Publishes `config/landing.php` | Where the landing is, for every other command |
| Adds `landing/node_modules`, `dist`, `.astro` to `.gitignore` | Not every template ignores them |
| Adds `@source not '../../landing';` to `resources/css/app.css` | Tailwind v4 scans the whole project and would put the landing's classes in the application's CSS |
| Writes `.github/workflows/deploy-landing.yml` | If you chose a deploy target |
| Adds `LANDING_URL` to `.env` and `.env.example` | So the application knows where the landing is |
| Points `/` in `routes/web.php` at `LANDING_URL` | If you asked; see [Domains and routes](#domains-and-routes) |
| Sets `base` in the landing's `astro.config` | If the landing is served under a path |

Nothing that exists is overwritten without `--force`, and `.gitignore` and
`app.css` are only ever appended to.

### Starting from a template

```bash
php artisan landing:install --template=empty                 # Astro's minimal template
php artisan landing:install --template=blog                  # an official example
php artisan landing:install --template=onwidget/astrowind    # any repository
php artisan landing:install --template=https://github.com/owner/repo/tree/main/apps/site
php artisan landing:install --template=gitlab:owner/repo
php artisan landing:install --template=theme:landpack        # a theme from astro.build/themes
```

`theme:<slug>` (or the theme's `astro.build/themes/details/…` URL) is looked up
in the catalog and installed from the repository the theme links to. Paid themes
have no public repository; the installer says so and links to where to buy one,
which you then install with `--template=owner/repo`.

### Unattended

Every question has a flag. With `--no-interaction` the defaults are `landing/`,
the empty template, the application's package manager and no workflow.

```bash
php artisan landing:install --no-interaction \
  --path=landing --template=basics --pm=bun \
  --add=tailwind --add=sitemap \
  --deploy=cloudflare-pages --branch=main \
  --redirect-root
```

## Domains and routes

The landing and the application are two sites, and the recommended setup gives
each its own address:

| | Production | Local |
|---|---|---|
| Landing | `https://example.com` | `http://localhost:4321` |
| Application | `https://app.example.com` | `php artisan serve`, Herd, Valet |

The application learns where the landing is from `LANDING_URL`
(`config('landing.url')`). With `--redirect-root` (or *yes* to the question),
the installer rewrites the application's home route to redirect there:

```php
Route::get('/', function () {
    return config('landing.url')
        ? redirect()->away(config('landing.url'))
        : view('welcome');
})->name('home');
```

It is plain Laravel reading the application's own config, so it keeps working in
production, where this package is not installed, and wherever `LANDING_URL` is
not set it serves the page it served before.

To serve the landing under a path of the application's domain instead, such as
`example.com/lp`, install with `--base=/lp`: Astro then builds every link and
asset under `/lp/`, and one proxy rule on the application's domain sends `/lp/`
to the landing. [docs/domains.md](docs/domains.md) has the Nginx and Cloudflare
recipes for that, for serving the build from the application's own `public/`,
and for putting the application under paths of the landing's domain.

## Running it

On Laravel 13.16 and later, `composer run dev` (which runs `php artisan dev`) starts the
landing as one more process, at http://localhost:4321:

```
 landing php artisan landing:dev
 server  php artisan serve
 queue   php artisan queue:listen --tries=1 --timeout=0
 vite    npm run dev
```

On its own, or on earlier Laravel versions:

```bash
php artisan landing:dev     # astro dev
php artisan landing:build   # astro build, into landing/dist
```

Both install the landing's dependencies first when `node_modules` is missing, so
a fresh clone needs nothing beyond the application's own setup. Set
`LANDING_DEV=false` to keep the landing out of `composer run dev`.

## Deploying it

```bash
php artisan landing:workflow cloudflare-pages
```

Every workflow needs the repository variable `LANDING_URL`, the landing's
public URL. The build passes it to Astro as `--site`, so canonical links, Open
Graph URLs, the sitemap and `robots.txt` point at your domain whatever the
template's config says, and a build that still points at a placeholder such as
`https://example.com` is not deployed. See [docs/seo.md](docs/seo.md).

| Target | Repository secrets |
|---|---|
| `cloudflare-pages` | `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` |
| `netlify` | `NETLIFY_AUTH_TOKEN`, `NETLIFY_SITE_ID` |
| `vercel` | `VERCEL_TOKEN`, `VERCEL_ORG_ID`, `VERCEL_PROJECT_ID` |
| `github-pages` | none |
| `ssh` | `LANDING_SSH_HOST`, `LANDING_SSH_USER`, `LANDING_SSH_KEY`, `LANDING_SSH_PATH`; optional `LANDING_SSH_PORT`, `LANDING_SSH_KNOWN_HOSTS` |

The workflow is filtered to `landing/**`, so a change to the application never
redeploys the landing. Do the reverse in your application's workflows:

```yaml
on:
  push:
    branches: [main]
    paths-ignore: ['landing/**']
```

Deploying to two places is two files:

```bash
php artisan landing:workflow cloudflare-pages
php artisan landing:workflow ssh --file=deploy-landing-mirror
```

To change every workflow this package writes, publish the stubs. They are read
from `stubs/landing/workflows` before the package's own:

```bash
php artisan vendor:publish --tag=landing-stubs
```

See [docs/deployment.md](docs/deployment.md) for each target in detail.

## Configuration

```php
// config/landing.php
'path' => env('LANDING_PATH', 'landing'),
'url' => env('LANDING_URL'),                            // where visitors reach the landing
'package_manager' => env('LANDING_PACKAGE_MANAGER'),   // null: the landing's lockfile decides
'dev' => [
    'enabled' => (bool) env('LANDING_DEV', true),      // part of composer run dev
    'name' => 'landing',
],
```

## Commands

| Command | What it does |
|---|---|
| `landing:install` | Create the Astro landing and wire it into the application |
| `landing:dev` | Run the Astro dev server |
| `landing:build` | Build the landing into its `dist/` |
| `landing:workflow` | Write a GitHub Actions workflow that deploys it |

## Working with an AI agent

If the application uses [Laravel Boost](https://laravel.com/docs/boost), this
package ships guidelines and an `astro-landing-development` skill. Run
`php artisan boost:install` and tick `lauroguedes/laravel-astro-landing` when it asks
which third-party guidelines and skills to install; the choice is saved to
`boost.json`, so later unattended runs keep it. They tell an agent that the
landing is a separate static site, which commands build and run it, how it
reaches the application, and how it deploys.

## Requirements

- PHP 8.3+, Laravel 12 or 13
- Node.js 22.12+ (or Bun) for Astro

## Documentation

[docs/](docs/README.md) covers templates, domains and routes, SEO, linking the
landing to the application, and each deploy target.

## License

MIT. See [LICENSE.md](LICENSE.md).
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。