Skip to content

Commit e753c06

Browse files
authored
fix: broken images due to base URL changes (#817)
1 parent 83361ca commit e753c06

File tree

18 files changed

+94
-58
lines changed

18 files changed

+94
-58
lines changed

blog/2022-06-04-rebranding.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ image: https://feature-sliced.github.io/documentation/img/blog/rebranding-stable
1212
hide_table_of_contents: false
1313
---
1414

15+
import useBaseUrl from "@docusaurus/useBaseUrl";
16+
1517
<div class="container text--center margin-vert--md">
16-
<img src="/img/blog/rebranding-stable.png" alt="logo-primary" width="100%" />
18+
<img src={useBaseUrl("/img/blog/rebranding-stable.png")} alt="logo-primary" width="100%" />
1719
</div>
1820

1921
TLDR:

blog/2022-07-25-international-community.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ image: https://feature-sliced.github.io/documentation/img/blog/international-com
1212
hide_table_of_contents: false
1313
---
1414

15+
import useBaseUrl from "@docusaurus/useBaseUrl";
16+
1517
<div class="container text--center margin-vert--md">
16-
<img src="/img/blog/international-community.png" alt="post-cover" width="100%" />
18+
<img src={useBaseUrl("/img/blog/international-community.png")} alt="post-cover" width="100%" />
1719
</div>
1820

1921
TLDR:

i18n/en/docusaurus-plugin-content-docs/current/branding.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import useBaseUrl from '@docusaurus/useBaseUrl';
2+
13
# Branding Guidelines
24

35
FSD's visual identity is based on its core-concepts: `Layered`, `Sliced self-contained parts`, `Parts & Compose`, `Segmented`.
@@ -41,30 +43,30 @@ FSD has few variations of logo for different context, but it recommended to pref
4143
</tr>
4244
<tr>
4345
<td style={{ color: "#FFF", background: "linear-gradient(135deg, rgba(41,190,220,1) 0%, rgba(81,122,237,1) 100%)" }}>primary <br/> (#29BEDC, #517AED)</td>
44-
<td><a href="/img/brand/logo-primary.png" download><img src="/img/brand/logo-primary.png" height="130" alt="logo-primary" /></a></td>
46+
<td><a href={useBaseUrl("/img/brand/logo-primary.png")} download><img src={useBaseUrl("/img/brand/logo-primary.png")} height="130" alt="logo-primary" /></a></td>
4547
<td>Preferred in most cases</td>
4648
</tr>
4749
<tr>
4850
<td style={{ color: "#FFF", background: "#3193FF" }}>flat <br/> (#3193FF)</td>
49-
<td><a href="/img/brand/logo-flat.png" download><img src="/img/brand/logo-flat.png" height="130" alt="logo-flat" /></a></td>
51+
<td><a href={useBaseUrl("/img/brand/logo-flat.png")} download><img src={useBaseUrl("/img/brand/logo-flat.png")} height="130" alt="logo-flat" /></a></td>
5052
<td>For one-color context</td>
5153
</tr>
5254
<tr>
5355
<td style={{ color: "#000", background: "#FFF" }}>monochrome <br /> (#FFF)</td>
54-
<td style={{ color: "#000", background: "#242526" }}><a href="/img/brand/logo-monochrome.png" download><img src="/img/brand/logo-monochrome.png" height="130" alt="logo-monocrhome" /></a></td>
56+
<td style={{ color: "#000", background: "#242526" }}><a href={useBaseUrl("/img/brand/logo-monochrome.png")} download><img src={useBaseUrl("/img/brand/logo-monochrome.png")} height="130" alt="logo-monocrhome" /></a></td>
5557
<td>For grayscale context</td>
5658
</tr>
5759
<tr>
5860
<td style={{ color: "#FFF", background: "#3193FF" }}>square <br/> (#3193FF)</td>
59-
<td><a href="/img/brand/logo-square.png" download><img src="/img/brand/logo-square.png" height="130" alt="logo-square" /></a></td>
61+
<td><a href={useBaseUrl("/img/brand/logo-square.png")} download><img src={useBaseUrl("/img/brand/logo-square.png")} height="130" alt="logo-square" /></a></td>
6062
<td>For square boundaries</td>
6163
</tr>
6264
</table>
6365

6466
## Banners & Schemes
6567

66-
<a href="/img/brand/banner-primary.jpg" download><img src="/img/brand/banner-primary.jpg" height="256" alt="banner-primary" /></a>
67-
<a href="/img/brand/banner-monochrome.jpg" download><img src="/img/brand/banner-monochrome.jpg" height="256" alt="banner-monochrome" /></a>
68+
<a href={useBaseUrl("/img/brand/banner-primary.jpg")} download><img src={useBaseUrl("/img/brand/banner-primary.jpg")} height="256" alt="banner-primary" /></a>
69+
<a href={useBaseUrl("/img/brand/banner-monochrome.jpg")} download><img src={useBaseUrl("/img/brand/banner-monochrome.jpg")} height="256" alt="banner-monochrome" /></a>
6870

6971
## Social Preview
7072

i18n/en/docusaurus-plugin-content-docs/current/reference/layers.mdx

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ sidebar_position: 1
33
pagination_next: reference/slices-segments
44
---
55

6+
import useBaseUrl from '@docusaurus/useBaseUrl';
7+
68
# Layers
79

810
Layers are the first level of organisational hierarchy in Feature-Sliced Design. Their purpose is to separate code based on how much responsibility it needs and how many other modules in the app it depends on. Every layer carries special semantic meaning to help you determine how much responsibility you should allocate to your code.
911

1012
There are **7 layers** in total, arranged from most responsibility and&nbsp;dependency to least:
1113

12-
<img src="/img/layers/folders-graphic-light.svg#light-mode-only" width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
13-
<img src="/img/layers/folders-graphic-dark.svg#dark-mode-only" width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
14+
<img src={useBaseUrl("/img/layers/folders-graphic-light.svg#light-mode-only")} width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
15+
<img src={useBaseUrl("/img/layers/folders-graphic-dark.svg#dark-mode-only")} width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
1416

1517
1. App
1618
2. Processes (deprecated)
@@ -32,7 +34,7 @@ Layers are made up of _slices_ — highly cohesive groups of modules. Dependenci
3234
3335
For example, the folder `📁 ~/features/aaa` is a slice with the name "aaa". A file inside of it, `~/features/aaa/api/request.ts`, cannot import code from any file in `📁 ~/features/bbb`, but can import code from `📁 ~/entities` and `📁 ~/shared`, as well as any sibling code from `📁 ~/features/aaa`, for example, `~/features/aaa/lib/cache.ts`.
3436

35-
Layers App and Shared are **exceptions** to this rule — they are both a layer and a slice at the same time. Slices partition code by business domain, and these two layers are exceptions because Shared does not have business domains, and App combines all business domains.
37+
Layers App and Shared are **exceptions** to this rule — they are both a layer and a slice at the same time. Slices partition code by business domain, and these two layers are exceptions because Shared does not have business domains, and App combines all business domains.
3638

3739
In practice, this means that layers App and Shared are made up of segments, and segments can import each other freely.
3840

@@ -67,7 +69,7 @@ An entity slice might contain the data storage (`📁 model`), data validation s
6769

6870
#### Entity relationships
6971

70-
Entities in FSD are slices, and by default, slices cannot know about each other. In real life, however, entities often interact with each other, and sometimes one entity owns or contains other entities. Because of that, the business logic of these interactions is preferably kept in higher layers, like Features or Pages.
72+
Entities in FSD are slices, and by default, slices cannot know about each other. In real life, however, entities often interact with each other, and sometimes one entity owns or contains other entities. Because of that, the business logic of these interactions is preferably kept in higher layers, like Features or Pages.
7173

7274
When one entity's data object contains other data objects, usually it's a good idea to make the connection between the entities explicit and side-step the slice isolation by making a cross-reference API with the `@x` notation. The reason is that connected entities need to be refactored together, so it's best to make the connection impossible to miss.
7375

@@ -92,7 +94,7 @@ Learn more about the `@x` notation in the [Public API for cross-imports][public-
9294

9395
This layer is for the main interactions in your app, things that your users care to do. These interactions often involve business entities, because that's what the app is about.
9496

95-
A crucial principle for using the Features layer effectively is: **not everything needs to be a feature**. A good indicator that something needs to be a feature is the fact that it is reused on several pages.
97+
A crucial principle for using the Features layer effectively is: **not everything needs to be a feature**. A good indicator that something needs to be a feature is the fact that it is reused on several pages.
9698

9799
For example, if the app has several editors, and all of them have comments, then comments are a reused feature. Remember that slices are a mechanism for finding code quickly, and if there are too many features, the important ones are drowned out.
98100

@@ -102,13 +104,13 @@ A feature slice might contain the UI to perform the interaction like a form (`
102104

103105
### Widgets
104106

105-
The Widgets layer is intended for large self-sufficient blocks of UI. Widgets are most useful when they are reused across multiple pages, or when the page that they belong to has multiple large independent blocks, and this is one of them.
107+
The Widgets layer is intended for large self-sufficient blocks of UI. Widgets are most useful when they are reused across multiple pages, or when the page that they belong to has multiple large independent blocks, and this is one of them.
106108

107109
If a block of UI makes up most of the interesting content on a page, and is never reused, it **should not be a widget**, and instead it should be placed directly inside that page.
108110

109111
:::tip
110112

111-
If you're using a nested routing system (like the router of [Remix][ext-remix]), it may be helpful to use the Widgets layer in the same way as a flat routing system would use the Pages layer — to create full router blocks, complete with related data fetching, loading states, and error boundaries.
113+
If you're using a nested routing system (like the router of [Remix][ext-remix]), it may be helpful to use the Widgets layer in the same way as a flat routing system would use the Pages layer — to create full router blocks, complete with related data fetching, loading states, and error boundaries.
112114

113115
In the same way, you can store page layouts on this layer.
114116

i18n/en/docusaurus-plugin-content-docs/current/reference/public-api.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
sidebar_position: 3
33
---
44

5+
import useBaseUrl from '@docusaurus/useBaseUrl';
6+
57
# Public API
68

79
A public API is a _contract_ between a group of modules, like a slice, and the code that uses it. It also acts as a gate, only allowing access to certain objects, and only through that public API.
@@ -68,8 +70,8 @@ Circular import is when two or more files import each other in a circle.
6870
<!-- TODO: add backgrounds to the images below, check on mobile -->
6971

7072
<figure>
71-
<img src="/img/circular-import-light.svg#light-mode-only" width="60%" alt="Three files importing each other in a circle" />
72-
<img src="/img/circular-import-dark.svg#dark-mode-only" width="60%" alt="Three files importing each other in a circle" />
73+
<img src={useBaseUrl("/img/circular-import-light.svg#light-mode-only")} width="60%" alt="Three files importing each other in a circle" />
74+
<img src={useBaseUrl("/img/circular-import-dark.svg#dark-mode-only")} width="60%" alt="Three files importing each other in a circle" />
7375
<figcaption>
7476
Pictured above: three files, `fileA.js`, `fileB.js`, and `fileC.js`, importing each other in a circle.
7577
</figcaption>

i18n/en/docusaurus-plugin-content-docs/current/reference/slices-segments.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ sidebar_position: 2
44
pagination_next: reference/public-api
55
---
66

7+
import useBaseUrl from '@docusaurus/useBaseUrl';
8+
79
# Slices and segments
810

911
## Slices
@@ -19,8 +21,8 @@ The layers Shared and App don't contain slices. That is because Shared should co
1921
Slices are meant to be independent and highly cohesive groups of code files. The graphic below might help to visualize the tricky concepts of _cohesion_ and _coupling_:
2022

2123
<figure>
22-
<img src="/img/coupling-cohesion-light.svg#light-mode-only" alt="" />
23-
<img src="/img/coupling-cohesion-dark.svg#dark-mode-only" alt="" />
24+
<img src={useBaseUrl("/img/coupling-cohesion-light.svg#light-mode-only")} alt="" />
25+
<img src={useBaseUrl("/img/coupling-cohesion-dark.svg#dark-mode-only")} alt="" />
2426
<figcaption>
2527
Image inspired by https://enterprisecraftsmanship.com/posts/cohesion-coupling-difference/
2628
</figcaption>

i18n/ja/docusaurus-plugin-content-docs/current/branding.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import useBaseUrl from "@docusaurus/useBaseUrl";
2+
13
# ブランドガイドライン
24

35
FSDのビジュアルアイデンティティは、そのコアコンセプトである `Layered``Sliced self-contained parts``Parts & Compose``Segmented` に基づいています。しかし、私たちはFSDの哲学を反映し、簡単に認識できる美しいアイデンティティを目指しています。
@@ -40,30 +42,30 @@ FSDには異なるコンテキスト用のいくつかのロゴバリエーシ
4042
</tr>
4143
<tr>
4244
<td style={{ color: "#FFF", background: "linear-gradient(135deg, rgba(41,190,220,1) 0%, rgba(81,122,237,1) 100%)" }}>primary <br/> (#29BEDC, #517AED)</td>
43-
<td><a href="/img/brand/logo-primary.png" download><img src="/img/brand/logo-primary.png" height="130" alt="logo-primary" /></a></td>
45+
<td><a href={useBaseUrl("/img/brand/logo-primary.png")} download><img src={useBaseUrl("/img/brand/logo-primary.png")} height="130" alt="logo-primary" /></a></td>
4446
<td>ほとんどの場合に推奨されます</td>
4547
</tr>
4648
<tr>
4749
<td style={{ color: "#FFF", background: "#3193FF" }}>flat <br/> (#3193FF)</td>
48-
<td><a href="/img/brand/logo-flat.png" download><img src="/img/brand/logo-flat.png" height="130" alt="logo-flat" /></a></td>
50+
<td><a href={useBaseUrl("/img/brand/logo-flat.png")} download><img src={useBaseUrl("/img/brand/logo-flat.png")} height="130" alt="logo-flat" /></a></td>
4951
<td>単色コンテキスト用</td>
5052
</tr>
5153
<tr>
5254
<td style={{ color: "#000", background: "#FFF" }}>monochrome <br /> (#FFF)</td>
53-
<td style={{ color: "#000", background: "#242526" }}><a href="/img/brand/logo-monochrome.png" download><img src="/img/brand/logo-monochrome.png" height="130" alt="logo-monocrhome" /></a></td>
55+
<td style={{ color: "#000", background: "#242526" }}><a href={useBaseUrl("/img/brand/logo-monochrome.png")} download><img src={useBaseUrl("/img/brand/logo-monochrome.png")} height="130" alt="logo-monochrome" /></a></td>
5456
<td>白黒コンテキスト用</td>
5557
</tr>
5658
<tr>
5759
<td style={{ color: "#FFF", background: "#3193FF" }}>square <br/> (#3193FF)</td>
58-
<td><a href="/img/brand/logo-square.png" download><img src="/img/brand/logo-square.png" height="130" alt="logo-square" /></a></td>
60+
<td><a href={useBaseUrl("/img/brand/logo-square.png")} download><img src={useBaseUrl("/img/brand/logo-square.png")} height="130" alt="logo-square" /></a></td>
5961
<td>正方形サイズ用</td>
6062
</tr>
6163
</table>
6264

6365
## バナーとスキーム {#banners--schemes}
6466

65-
<a href="/img/brand/banner-primary.jpg" download><img src="/img/brand/banner-primary.jpg" height="256" alt="banner-primary" /></a>
66-
<a href="/img/brand/banner-monochrome.jpg" download><img src="/img/brand/banner-monochrome.jpg" height="256" alt="banner-monochrome" /></a>
67+
<a href={useBaseUrl("/img/brand/banner-primary.jpg")} download><img src={useBaseUrl("/img/brand/banner-primary.jpg")} height="256" alt="banner-primary" /></a>
68+
<a href={useBaseUrl("/img/brand/banner-monochrome.jpg")} download><img src={useBaseUrl("/img/brand/banner-monochrome.jpg")} height="256" alt="banner-monochrome" /></a>
6769

6870
## ソーシャルプレビュー
6971

i18n/ja/docusaurus-plugin-content-docs/current/reference/layers.mdx

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ sidebar_position: 1
33
pagination_next: reference/slices-segments
44
---
55

6+
import useBaseUrl from "@docusaurus/useBaseUrl";
7+
68
# レイヤー
79

810
レイヤーは、Feature-Sliced Designにおける組織階層の最初のレベルです。その目的は、コードを責任の程度やアプリ内の他のモジュールへの依存度に基づいて分離することです。各レイヤーは、コードにどれだけの責任を割り当てるべきかを判断するための特別な意味を持っています。
911

1012
合計で**7つのレイヤー**があり、責任と依存度が最も高いものから最も低いものへと配置されています。
1113

12-
<img src="/img/layers/folders-graphic-light.svg#light-mode-only" width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
13-
<img src="/img/layers/folders-graphic-dark.svg#dark-mode-only" width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
14+
<img src={useBaseUrl("/img/layers/folders-graphic-light.svg#light-mode-only")} width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
15+
<img src={useBaseUrl("/img/layers/folders-graphic-dark.svg#dark-mode-only")} width="180" style={{ float: "right", margin: "0 1em" }} alt="A file system tree, with a single root folder called src and then seven subfolders: app, processes, pages, widgets, features, entities, shared. The processes folder is slightly faded out." />
1416

1517

1618
1. App (アップ)
@@ -50,9 +52,9 @@ AppとSharedのレイヤーは、このルールの**例外**です。これら
5052
このレイヤーで通常見られるセグメントは次のとおりです。
5153

5254
- `📁 api` — APIクライアントおよび特定のバックエンドエンドポイントへのリクエストを行う関数
53-
- `📁 ui` — アプリケーションのUIキット
55+
- `📁 ui` — アプリケーションのUIキット
5456
このレイヤーのコンポーネントはビジネスロジックを含むべきではありませんが、ビジネスに関連することは許可されています。例えば、会社のロゴやページレイアウトをここに置くことができます。UIロジックを持つコンポーネントも許可されています(例えば、オートコンプリートや検索バー)
55-
- `📁 lib` — 内部ライブラリのコレクション
57+
- `📁 lib` — 内部ライブラリのコレクション
5658
このフォルダーはヘルパーやユーティリティとして扱うべきではありません([なぜこれらのフォルダーがしばしばダンプに変わるか][ext-sova-utility-dump])。このフォルダー内の各ライブラリは、日付、色、テキスト操作など、1つの焦点を持つべきです。その焦点はREADMEファイルに文書化されるべきです。チームの開発者は、これらのライブラリに何を追加でき、何を追加できないかを知っているべきです
5759
- `📁 config` — 環境変数、グローバルフィーチャーフラグ、アプリの他のグローバル設定
5860
- `📁 routes` — ルート定数、またはルートをマッチさせるためのパターン

0 commit comments

Comments
 (0)