Skip to content

Commit c98bd09

Browse files
committed
Customize base for repo
1 parent 0473eb6 commit c98bd09

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

.github/workflows/publish-docs.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
1-
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2-
#
1+
32
name: Deploy VitePress site to Pages
43

54
on:
6-
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7-
# using the `master` branch as the default branch.
85
push:
96
branches: [gh-pages]
107

118
# Allows you to run this workflow manually from the Actions tab
129
workflow_dispatch:
1310

14-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1511
permissions:
1612
contents: read
1713
pages: write
1814
id-token: write
1915

20-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2216
concurrency:
2317
group: pages
2418
cancel-in-progress: false
2519

2620
jobs:
27-
# Build job
2821
build:
2922
runs-on: ubuntu-latest
3023
steps:
3124
- name: Checkout
3225
uses: actions/checkout@v5
33-
with:
34-
fetch-depth: 0 # Not needed if lastUpdated is not enabled
3526

3627
- name: Setup PHP
3728
uses: shivammathur/setup-php@v2
@@ -64,13 +55,14 @@ jobs:
6455

6556
- name: Build with VitePress
6657
run: pnpm docs:build
58+
env:
59+
REPOSITORY: ${{ github.repository }}
6760

6861
- name: Upload artifact
6962
uses: actions/upload-pages-artifact@v3
7063
with:
7164
path: docs/.vitepress/dist
7265

73-
# Deployment job
7466
deploy:
7567
environment:
7668
name: github-pages

docs/.vitepress/config.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import { compileCode, addSandboxButton } from './plugins';
66
import { fileURLToPath } from 'node:url';
77
import tailwindcss from '@tailwindcss/vite';
88

9+
const env = (globals || window)?.process?.env?.REPOSITORY;
10+
911
// https://vitepress.dev/reference/site-config
1012
const vitePressOptions: UserConfig = {
1113
title: 'Carbon',
1214
description: 'A simple PHP API extension for DateTime.',
13-
base: '/',
15+
base: env === 'briannesbitt/Carbon' ? '/' : '/carbon/',
1416
head: [
1517
[
1618
'link', {

docs/develop/contribution/documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The documentation resides in the [gh-pages branch of Carbon](https://github.com/
1010
* `git clone`
1111
* `git checkout gh-pages`
1212
* `git checkout -b [speaking-new-branch-name]`
13-
* Modify `.src.html` source files
13+
* Modify `.md` source files
1414
* `git commit`
1515
* `git push`
1616
* Create a pull request against the **gh-pages** branch
@@ -72,4 +72,4 @@ Bootstrap icons are used in the documentation. You can find the list of availabl
7272
Replace `icon-name` with the desired icon's name from the Bootstrap Icons library. For example, to add a star icon, you would use:
7373
```html
7474
<i class="bi bi-star"></i>
75-
```
75+
```

0 commit comments

Comments
 (0)