Skip to content

Commit 8cdc8c8

Browse files
joshistoastjoshistoast
andauthored
fix(docs): urls respect baseurl + better deployment scheduling (#9069)
* fix(docs): avoid relative link urls, fix homepage title * fix(docs): better deployment run scheduling * fix(docs): remove crowdin --------- Co-authored-by: joshistoast <me@joshcorbett.com>
1 parent 63a1fe5 commit 8cdc8c8

25 files changed

Lines changed: 105 additions & 144 deletions

.github/workflows/deploy-docs.yml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,51 @@ on:
2121

2222
permissions:
2323
contents: read
24-
pages: write
25-
id-token: write
24+
pull-requests: read
2625

2726
concurrency:
28-
group: 'pages'
27+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
2928
cancel-in-progress: true
3029

3130
jobs:
31+
changes:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
docs: ${{ steps.manual.outputs.docs || steps.filter.outputs.docs }}
35+
steps:
36+
- name: checkout
37+
uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
41+
- name: mark manual run
42+
if: github.event_name == 'workflow_dispatch'
43+
id: manual
44+
run: echo "docs=true" >> "$GITHUB_OUTPUT"
45+
46+
- name: detect docs-related changes
47+
if: github.event_name != 'workflow_dispatch'
48+
id: filter
49+
uses: dorny/paths-filter@v3
50+
with:
51+
filters: |
52+
docs:
53+
- '.github/workflows/deploy-docs.yml'
54+
- 'docs/**'
55+
- 'scripts/generate_docs_json.py'
56+
- 'invokeai/app/**'
57+
- 'invokeai/backend/**'
58+
- 'pyproject.toml'
59+
- 'uv.lock'
60+
3261
check-and-build:
62+
needs: changes
63+
if: |
64+
github.event_name == 'workflow_dispatch' ||
65+
(github.event_name == 'pull_request' &&
66+
github.event.pull_request.draft == false &&
67+
needs.changes.outputs.docs == 'true') ||
68+
(github.event_name == 'push' && needs.changes.outputs.docs == 'true')
3369
runs-on: ubuntu-22.04
3470
timeout-minutes: 20
3571
steps:
@@ -49,8 +85,10 @@ jobs:
4985
with:
5086
python-version: '3.11'
5187

88+
# generate_docs_json.py only needs the invokeai package importable
89+
# (pydantic + invokeai.app/backend). Skip the [test] extra to keep CI fast.
5290
- name: install python dependencies
53-
run: uv pip install --editable .[test]
91+
run: uv pip install --editable .
5492

5593
# Node (needed for docs build)
5694
- name: setup node
@@ -90,6 +128,10 @@ jobs:
90128
if: github.ref == 'refs/heads/main'
91129
needs: check-and-build
92130
runs-on: ubuntu-latest
131+
permissions:
132+
contents: read
133+
pages: write
134+
id-token: write
93135
environment:
94136
name: github-pages
95137
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/mkdocs-material.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

crowdin.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/astro.config.mjs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default defineConfig({
2929
alt: 'InvokeAI Logo',
3030
replacesTitle: true,
3131
},
32-
favicon: '/favicon.svg',
32+
favicon: 'favicon.svg',
3333
editLink: {
3434
baseUrl: 'https://github.com/invoke-ai/InvokeAI/edit/main/docs',
3535
},
@@ -122,17 +122,10 @@ export default defineConfig({
122122
PageFrame: './src/layouts/PageFrameExtended.astro',
123123
},
124124
plugins: [
125-
// The links validator is skipped for the ghpages target because content uses
126-
// root-absolute links (e.g. /concepts/...) that don't include the /InvokeAI base.
127-
// Production (custom domain) still enforces link validation.
128-
...(isGhPages
129-
? []
130-
: [
131-
starlightLinksValidator({
132-
errorOnRelativeLinks: false,
133-
errorOnLocalLinks: false,
134-
}),
135-
]),
125+
starlightLinksValidator({
126+
errorOnRelativeLinks: false,
127+
errorOnLocalLinks: false,
128+
}),
136129
starlightLlmsText(),
137130
starlightChangelogs(),
138131
// starlightContextualMenu({

docs/src/content/docs/concepts/dynamic-prompting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ In the current UI, the `Seed Behaviour` setting controls how seeds are reused ac
130130
- Be careful with multiple groups, because the number of combinations grows quickly.
131131
- Review the expanded prompt list before launching a large batch.
132132
- Use dynamic prompting for variation, not to avoid thinking through the base prompt.
133-
- When one specific term needs more emphasis, use [Prompting Syntax](/concepts/prompt-syntax) instead of adding more dynamic groups.
133+
- When one specific term needs more emphasis, use [Prompting Syntax](../prompt-syntax) instead of adding more dynamic groups.

docs/src/content/docs/concepts/image-generation.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ There are two prompt boxes: **Positive Prompt** & **Negative Prompt**.
4343
<LinkCard
4444
title="Prompting Guide"
4545
description="Learn how to structure prompts, use positive and negative prompts well, and iterate toward better results."
46-
href="/concepts/prompting-guide"
46+
href="../prompting-guide"
4747
/>
4848
<LinkCard
4949
title="Prompting Syntax"
5050
description="Learn InvokeAI's advanced prompt weighting and composition syntax, including `+`, `-`, `.blend()`, and `.and()`."
51-
href="/concepts/prompt-syntax"
51+
href="../prompt-syntax"
5252
/>
5353
<LinkCard
5454
title="Dynamic Prompting"
5555
description="Expand one prompt into many prompt variations with curly-brace syntax."
56-
href="/concepts/dynamic-prompting"
56+
href="../dynamic-prompting"
5757
/>
5858
</CardGrid>
5959

@@ -78,7 +78,7 @@ Invoke offers a number of different workflows for interacting with models to pro
7878
<Steps>
7979
1. **Fine-tuning your prompt:**
8080

81-
The more specific you are, the closer the image will turn out to what is in your head. Adding more details in the Positive or Negative Prompt can help add or remove parts of the image. You can also use advanced techniques like upweighting and downweighting to control the influence of specific words. Learn more in the [Prompting Guide](/concepts/prompting-guide) and [Prompting Syntax](/concepts/prompt-syntax).
81+
The more specific you are, the closer the image will turn out to what is in your head. Adding more details in the Positive or Negative Prompt can help add or remove parts of the image. You can also use advanced techniques like upweighting and downweighting to control the influence of specific words. Learn more in the [Prompting Guide](../prompting-guide) and [Prompting Syntax](../prompt-syntax).
8282

8383
:::tip
8484
If you're seeing poor results, try adding the things you don't like about the image to your negative prompt. E.g. *distorted, low quality, unrealistic, etc.*
@@ -99,7 +99,7 @@ Invoke offers a number of different workflows for interacting with models to pro
9999

100100
5. **Explore Advanced Settings:**
101101

102-
InvokeAI has a full suite of tools available to allow you complete control over your image creation process. Check out our [docs if you want to learn more](https://invoke-ai.github.io/InvokeAI/features/).
102+
InvokeAI has a full suite of tools available to allow you complete control over your image creation process. Check out our [features docs](../../features/gallery) if you want to learn more.
103103
</Steps>
104104

105105
## Terms & Concepts

docs/src/content/docs/concepts/models.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ In this situation, you may need to provide some additional information to identi
5353
Add `:v2` to the repo ID and use that when installing the model: `monster-labs/control_v1p_sd15_qrcode_monster:v2`
5454
:::
5555

56-
[set up in the config file]: /configuration/invokeai-yaml
56+
[set up in the config file]: ../../configuration/invokeai-yaml

docs/src/content/docs/concepts/prompt-syntax.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ import { Card, LinkCard, CardGrid } from '@astrojs/starlight/components';
1010
<CardGrid>
1111
<LinkCard
1212
title="Prompting Guide"
13-
href="/concepts/prompting-guide"
13+
href="../prompting-guide"
1414
description="Learn how to write effective prompts for InvokeAI."
1515
/>
1616

1717
<LinkCard
1818
title="Dynamic Prompting"
19-
href="/concepts/dynamic-prompting"
19+
href="../dynamic-prompting"
2020
description="Learn how to create many prompt variations from a single template."
2121
/>
2222
</CardGrid>
2323

24-
InvokeAI supports Compel-style prompt weighting and prompt functions for `SD 1.5` and `SDXL` text conditioning workflows. Recent model families, including `FLUX`, `Z-Image`, `CogView4`, and `Qwen Image`, bypass Compel and do not use the syntax documented on this page. This page documents syntax for those Compel-based workflows only. If you want general advice on writing better prompts, start with [Prompting Guide](/concepts/prompting-guide).
24+
InvokeAI supports Compel-style prompt weighting and prompt functions for `SD 1.5` and `SDXL` text conditioning workflows. Recent model families, including `FLUX`, `Z-Image`, `CogView4`, and `Qwen Image`, bypass Compel and do not use the syntax documented on this page. This page documents syntax for those Compel-based workflows only. If you want general advice on writing better prompts, start with [Prompting Guide](../prompting-guide).
2525

2626
:::note[Compatibility note]
2727
If a weighted prompt seems to be ignored, check whether you are using an `SD 1.5` or `SDXL` workflow. Compel syntax on this page does not apply to newer model families such as `FLUX`, `Z-Image`, `CogView4`, and `Qwen Image`.
@@ -134,5 +134,5 @@ Use unescaped parentheses only when you mean grouping or weighting.
134134

135135
## Related pages
136136

137-
- For practical prompt-writing advice, read [Prompting Guide](/concepts/prompting-guide).
138-
- For prompt expansion and permutations, read [Dynamic Prompting](/concepts/dynamic-prompting).
137+
- For practical prompt-writing advice, read [Prompting Guide](../prompting-guide).
138+
- For prompt expansion and permutations, read [Dynamic Prompting](../dynamic-prompting).

docs/src/content/docs/concepts/prompting-guide.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import { Card, CardGrid, Steps, LinkCard } from '@astrojs/starlight/components';
1010
<CardGrid>
1111
<LinkCard
1212
title="Prompting Syntax"
13-
href="/concepts/prompt-syntax"
13+
href="../prompt-syntax"
1414
description="Learn how to weight prompt terms, blend concepts, and use prompt conjunctions for more control."
1515
/>
1616

1717
<LinkCard
1818
title="Dynamic Prompting"
19-
href="/concepts/dynamic-prompting"
19+
href="../dynamic-prompting"
2020
description="Learn how to create many prompt variations from a single template."
2121
/>
2222
</CardGrid>
@@ -82,7 +82,7 @@ Good negative prompts usually name specific failure modes: `blurry`, `distorted
8282

8383
5. Escalate only when needed
8484

85-
If the result is close but one element is too weak or too strong, move to [Prompting Syntax](/concepts/prompt-syntax) for weighting. If you want lots of variations, use [Dynamic Prompting](/concepts/dynamic-prompting).
85+
If the result is close but one element is too weak or too strong, move to [Prompting Syntax](../prompt-syntax) for weighting. If you want lots of variations, use [Dynamic Prompting](../dynamic-prompting).
8686
</Steps>
8787

8888
Here is the same idea refined in stages:
@@ -108,10 +108,10 @@ The same prompt can behave very differently across models.
108108

109109
Reach for advanced syntax when a normal comma-separated prompt is almost right, but you need more control.
110110

111-
- Use [Prompting Syntax](/concepts/prompt-syntax) when one term needs more or less influence.
111+
- Use [Prompting Syntax](../prompt-syntax) when one term needs more or less influence.
112112
- Use `.blend()` when you want to mix concepts or styles deliberately.
113113
- Use `.and()` when you want separate prompt clauses encoded individually.
114-
- Use [Dynamic Prompting](/concepts/dynamic-prompting) when you want many prompt variations from one template.
114+
- Use [Dynamic Prompting](../dynamic-prompting) when you want many prompt variations from one template.
115115

116116
## Common mistakes
117117

docs/src/content/docs/configuration/docker.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import SystemRequirementsLink from '@components/SystemRequirmentsLink.astro'
1414
Docker Desktop on Windows [includes GPU support](https://www.docker.com/blog/wsl-2-gpu-support-for-docker-desktop-on-nvidia-gpus/).
1515
</TabItem>
1616
<TabItem label="MacOS" icon="apple">
17-
Docker can not access the GPU on macOS, so your generation speeds will be slow. Use the [launcher](/start-here/installation) instead.
17+
Docker can not access the GPU on macOS, so your generation speeds will be slow. Use the [launcher](../../start-here/installation) instead.
1818
</TabItem>
1919
<TabItem label="Linux" icon="linux">
2020
Configure Docker to access your machine's GPU.

0 commit comments

Comments
 (0)