You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3bbfd93
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: frontend/purestack.studio/guides/links.mdx
+28-7Lines changed: 28 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Links
3
-
description: Link to pages, sections, and other sites. Write links relative to your file, and every build checks that they still work.
3
+
description: Link to pages, sections, images, files, and other sites. Write links relative to your file, and every build checks that they still work.
4
4
template: doc
5
5
layout:
6
6
showNav: true
@@ -13,7 +13,7 @@ nav:
13
13
14
14
# Links
15
15
16
-
Write a link the way you see your files. PureStack turns it into the right page address and checks it every time the site builds, so a renamed or deleted page never leaves a broken link behind.
16
+
Write a link the way you see your files. PureStack turns it into the right address and checks it every time the site builds, so a renamed or deleted page or image never leaves a broken link behind.
17
17
18
18
## Link to another page
19
19
@@ -71,6 +71,26 @@ The same rule works for `href` on any tag, including components and links they b
71
71
72
72
Links in a shared header or footer start from that header or footer file, so they work on every page that shows them.
73
73
74
+
## Images and files
75
+
76
+
Images, videos, downloads, and other files in your content folder follow the same rule:
Write a file's full name, with its extension and the same capitals, so it works on any host.
91
+
92
+
Files that a build step writes straight into the output aren't in your content folder, so PureStack can't check them. Link them from the site root, such as `/previews/demo.html`.
93
+
74
94
## Link outside your content
75
95
76
96
Anything that starts with `/` or a protocol is used as written:
@@ -92,13 +112,13 @@ If the site lives under a base path, such as `/docs`, PureStack adds it to every
92
112
The build stops and names the file and the link:
93
113
94
114
```text
95
-
Content link "./themse" in "guides/semantic-tones.mdx" does not match any page.
115
+
Content link "./themse" in "guides/semantic-tones.mdx" does not match any page or file.
96
116
```
97
117
98
118
While `purestack serve` runs, only that page shows the error, and it updates as soon as you fix the link. Most fixes are one of these:
99
119
100
-
-**A typo or different capitals.**`./Themes` doesn't find `themes.mdx`.
101
-
-**The page moved.** Write the path again, starting from your file.
120
+
-**A typo or different capitals.**`./Themes` doesn't find `themes.mdx`, and `./Logo.png` doesn't find `logo.png`.
121
+
-**The page or file moved.** Write the path again, starting from your file.
102
122
-**The page is built elsewhere.** Start the path at the site root, such as `/blog/`.
103
123
104
124
## Translated sites
@@ -115,10 +135,11 @@ Link pages inside your language folder as usual. If a page isn't translated yet,
115
135
| The page one folder up |`../`|
116
136
| A section of another page |`./themes#create-a-skin`|
117
137
| A section of this page |`#quick-reference`|
138
+
| An image in a subfolder |`./images/palette.svg`|
118
139
| A page built separately |`/blog/`|
119
140
| Another website |`https://example.com`|
120
141
121
142
<AlertBoxtone="accent"icon="tabler:bolt"title="Rule of thumb">
122
-
Link your own pages relative to your file. Use a full path or address for
123
-
everything else.
143
+
Link your own pages and files relative to your file. Use a full path or
Copy file name to clipboardExpand all lines: frontend/purestack.studio/guides/site-config.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,8 @@ The `--content` CLI option chooses the content directory. A custom runner can se
95
95
96
96
The logo can use `imageSrc` and `imageSrcDark` instead of an icon, or a `monogram` mark. `imageSrc` takes priority over `icon`. `subtitle`, `appearance`, `wordmarkStyle`, `shape`, `tone`, colors, and size fields let you tune the mark and wordmark. Set `logo.href` to `null` or `""` for a noninteractive logo. For the full set of presentation fields, use the [schema](https://github.com/PureStackStudio/PureStack/blob/main/packages/ts-ssg/schema/siteConfig.schema.json) alongside the [SiteLogo component](/components/site/site-logo/).
97
97
98
+
Relative paths in `siteConfig.json`, such as `imageSrc`, `style.href`, or `privacyPolicyUrl`, start at the content directory, where the file lives. `assets/logo.svg` becomes `/assets/logo.svg` on every page.
99
+
98
100
## Styles and themes
99
101
100
102
PureStack generates a stylesheet for each configured theme. `light` and `dark` are required, and are the defaults. With the default filename, the generated files are `assets/site.css` and `assets/site.dark.css`.
0 commit comments