Skip to content

Commit d098e53

Browse files
committed
fix: 根路徑改用 index.html 及修正其他元件硬編碼連結
1 parent e132949 commit d098e53

11 files changed

Lines changed: 47 additions & 47 deletions

File tree

content/accessibility/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ content=`<fieldset class="fieldset">
3030
3131
{{< code-example
3232
content=`<script>
33-
window.onload = function() {
33+
document.addEventListener('DOMContentLoaded', function() {
3434
document.querySelectorAll('[data-required="true"]').forEach(function(input) {
3535
input.setAttribute('aria-required', 'true');
3636
});
37-
};
37+
});
3838
</script>`
3939
>}}
4040
4141
### 說明頁面
4242

43-
[開發網站無障礙模板](/accessibility/demo-page/)
43+
[開發網站無障礙模板]({{< ref "accessibility/demo-page/_index.md" >}})
4444

45-
[檢測工具導入文件](/accessibility/a11y_tools/)
45+
[檢測工具導入文件]({{< ref "accessibility/a11y_tools/_index.md" >}})
4646

4747
#### 延伸參考資料
4848

content/accessibility/demo-page/_index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ maturity: "new"
1515

1616
### 首頁範本
1717

18-
[首頁範本](/accessibility/demo-page/landing-page.html)原始碼。
18+
[首頁範本]({{< ref "accessibility/demo-page/landing-page.html" >}})原始碼。
1919

2020
{{< code-example path="accessibility/demo-page/landing-page.html" class="maxh" >}}
2121

2222
### 意見回饋頁範本
2323

2424
此頁面範本為常見的表單填寫、業務申辦等類型的數位服務情境,在操作目的較單純的情境應可簡化為單一頁面或單一操作元件。為確保範本足以因應複雜情境,並展示多項共用元件應用,且避免 [SC 3.3.4 Error Prevention (Legal, Financial, Data)](https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html) 使用障礙,故範本設計中融入了填寫資料前的同意宣告,以及填寫資料後、送出資料前的最終確認。
2525

26-
[意見回饋頁範本](/accessibility/demo-page/form-page-s1.html)原始碼。
26+
[意見回饋頁範本]({{< ref "accessibility/demo-page/form-page-s1.html" >}})原始碼。
2727

2828
{{< code-example path="accessibility/demo-page/form-page-s1.html" class="maxh" >}}
2929

@@ -83,11 +83,12 @@ content=`<!-- Go template syntax in Hugo -->
8383
content=`<!-- Go template syntax in Hugo -->
8484
{{ range $index, $p := $pages }}
8585
{{ $i := add $index 1 }}
86+
{{ $href := printf "accessibility/demo-page/form-page-s%d.html" $i | absURL }}
8687
{{ if le $i $.current }}
8788
{{ if eq $i $.current }}
88-
<a href="/accessibility/demo-page/form-page-s{{ $i }}.html" aria-current="page"><mark>{{ $p }}</mark></a>
89+
<a href="{{ $href }}" aria-current="page"><mark>{{ $p }}</mark></a>
8990
{{ else }}
90-
<a href="/accessibility/demo-page/form-page-s{{ $i }}.html">{{ $p }}</a>
91+
<a href="{{ $href }}">{{ $p }}</a>
9192
{{ end }}
9293
{{ else }}
9394
<span>{{ $p }}</span>

content/accessibility/demo-page/form-page-s1.html

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="#navigation" class="skip-to">跳至主要連結表</a>
1111
<a href="#footer" class="skip-to">跳至頁尾</a>
1212
</skip-to>
13-
<a href="/" class="flex items-center">
13+
<a href="{{< relURL "index.html" >}}" class="flex items-center">
1414
<div class="bg-layer1 w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
1515
<h1>意見回饋頁範本</h1>
1616
</a>
@@ -22,7 +22,7 @@ <h1>意見回饋頁範本</h1>
2222
{{< breadcrumb-step path="Step 1.同意聲明;Step 2.填寫資料;Step 3.最終確認;Step 4.送出結果" current="1" >}}
2323
<main class="site-main" id="main">
2424
<h2>Step 1. 同意聲明</h2>
25-
<form action="/accessibility/demo-page/form-page-s2.html" method="get">
25+
<form action="{{< relURL "accessibility/demo-page/form-page-s2.html" >}}" method="get">
2626
<div class="fields">
2727
<div class="warning-text">
2828
<strong>個人資料蒐集、處理、利用同意書</strong>
@@ -31,15 +31,12 @@ <h2>Step 1. 同意聲明</h2>
3131
</p>
3232
<p>
3333
1. 機關名稱:XXXX機關(○○分局)
34-
3534
</p>
3635
<p>
3736
2. 蒐集之特定目的:(例:代號一○一 XXXX業務)
38-
3937
</p>
4038
<p>
4139
3. 個人資料之類別:(例:姓名、身分證編號、出生年月日、住址…等)
42-
4340
</p>
4441
<p>
4542
4. 個人資料利用之期間、地區、對象及方式:
@@ -64,11 +61,9 @@ <h2>Step 1. 同意聲明</h2>
6461
</p>
6562
<p>
6663
6. 若未提供正確個人資料,本單位將無法提供您特定目的範圍內之相關服務。
67-
6864
</p>
6965
<p>
7066
本人已充分知悉貴單位上述告知事項,並同意貴單位蒐集、處理、利用本人之個人資料。
71-
7267
</p>
7368
</div>
7469

@@ -87,7 +82,7 @@ <h2>Step 1. 同意聲明</h2>
8782
<footer id="footer" class="site-footer f6 flex items-center gap4">
8883
<div class="plain w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
8984
<div class="mw5">
90-
<a href="/accessibility-statement">親和力宣告</a>
85+
<a href="{{< relURL "accessibility-statement" >}}">親和力宣告</a>
9186
</div>
9287
</footer>
9388
</div>

content/accessibility/demo-page/form-page-s2.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="#navigation" class="skip-to">跳至主要連結表</a>
1111
<a href="#footer" class="skip-to">跳至頁尾</a>
1212
</skip-to>
13-
<a href="/" class="flex items-center">
13+
<a href="{{< relURL "index.html" >}}" class="flex items-center">
1414
<div class="bg-layer1 w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
1515
<h1>意見回饋頁範本</h1>
1616
</a>
@@ -23,7 +23,7 @@ <h1>意見回饋頁範本</h1>
2323

2424
<main class="site-main" id="main">
2525
<h2>Step 2. 意見回饋</h2>
26-
<form action="/accessibility/demo-page/form-page-s3.html" method="get">
26+
<form action="{{< relURL "accessibility/demo-page/form-page-s3.html" >}}" method="get">
2727
<div class="fields ba br3 pa4">
2828
<fieldset class="fieldset">
2929
<legend class="field-label f3 center">聯絡資訊</legend>
@@ -38,18 +38,18 @@ <h2>Step 2. 意見回饋</h2>
3838
<option>陳情</option>
3939
<option>無障礙</option>
4040
</select>
41-
<label for="comment" data-limit-phrase="尚餘 {remaining} 字,|內容上限 {total} 字。" class="field-label">說明意見</label>
41+
<label for="comment" class="field-label">說明意見</label>
4242
<ul class="field-description" id="textarea-description">
4343
<li data-character-notice aria-live="polite" aria-atomic="true">內容上限 200 字。</li>
4444
</ul>
45-
<textarea id="comment" rows="4" required data-character-limit="200" aria-describedby="textarea-description"></textarea>
45+
<textarea id="comment" name="comment" rows="4" required data-character-limit="200" aria-describedby="textarea-description"></textarea>
4646
</fieldset>
4747
<div class="sr-only" id="notes_save_status" role="alert"></div>
4848

4949
<div class="gap2 flex flex-wrap">
5050
<button type="submit" class="button button-primary">下一步</button>
5151
<button type="reset" class="button button-danger">清除重填</button>
52-
<button type="submit" formaction="/accessibility/demo-page/form-page-s1.html" formmethod="get" class="button">上一步</button>
52+
<button type="submit" formaction="{{< relURL "accessibility/demo-page/form-page-s1.html" >}}" formmethod="get" class="button">上一步</button>
5353
</div>
5454
</div>
5555

@@ -60,7 +60,7 @@ <h2>Step 2. 意見回饋</h2>
6060
<footer id="footer" class="site-footer f6 flex items-center gap4">
6161
<div class="plain w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
6262
<div class="mw5">
63-
<a href="/accessibility-statement">親和力宣告</a>
63+
<a href="{{< relURL "accessibility-statement" >}}">親和力宣告</a>
6464
</div>
6565
</footer>
6666
</div>

content/accessibility/demo-page/form-page-s3.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="#navigation" class="skip-to">跳至主要連結表</a>
1111
<a href="#footer" class="skip-to">跳至頁尾</a>
1212
</skip-to>
13-
<a href="/" class="flex items-center">
13+
<a href="{{< relURL "index.html" >}}" class="flex items-center">
1414
<div class="bg-layer1 w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
1515
<h1>意見回饋頁範本</h1>
1616
</a>
@@ -23,7 +23,7 @@ <h1>意見回饋頁範本</h1>
2323

2424
<main class="site-main" id="main">
2525
<h2>Step 3. 最終確認</h2>
26-
<form action="/accessibility/demo-page/form-page-s4.html" method="get">
26+
<form action="{{< relURL "accessibility/demo-page/form-page-s4.html" >}}" method="get">
2727
<div class="fields">
2828
<table class="table">
2929
<caption class="table-caption">送出結果</caption>
@@ -55,15 +55,15 @@ <h2>Step 3. 最終確認</h2>
5555
<legend>真人驗證</legend>
5656
<!-- Security Code Check -->
5757
<input type="hidden" id="code" name="code" value="242">
58-
<img style="border:0" src="/assets/mt-scode.png" alt="CAPTCHA 檢核考驗圖片(請注意驗證填寫說明)"><br>
58+
<img class="bn db mb2" src="{{< relURL "assets/mt-scode.png" >}}" alt="CAPTCHA 檢核考驗圖片(請注意驗證填寫說明)">
5959
<label for="scode">請無視上圖內容,直接輸入阿拉伯數字肆拾貳以驗證:</label>
6060
<input id="scode" name="scode" autocomplete="off">
6161
<!-- end of Security Code Check -->
6262
</fieldset>
6363

6464
<div class="gap2 flex flex-wrap">
6565
<button type="submit" class="button button-primary">確認送出</button>
66-
<button type="submit" formaction="/accessibility/demo-page/form-page-s2.html" formmethod="get" class="button">修正意見</button>
66+
<button type="submit" formaction="{{< relURL "accessibility/demo-page/form-page-s2.html" >}}" formmethod="get" class="button">修正意見</button>
6767
</div>
6868
</div>
6969

@@ -74,7 +74,7 @@ <h2>Step 3. 最終確認</h2>
7474
<footer id="footer" class="site-footer f6 flex items-center gap4">
7575
<div class="plain w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
7676
<div class="mw5">
77-
<a href="/accessibility-statement">親和力宣告</a>
77+
<a href="{{< relURL "accessibility-statement" >}}">親和力宣告</a>
7878
</div>
7979
</footer>
8080
</div>

content/accessibility/demo-page/form-page-s4.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="#navigation" class="skip-to">跳至主要連結表</a>
1111
<a href="#footer" class="skip-to">跳至頁尾</a>
1212
</skip-to>
13-
<a href="/" class="flex items-center">
13+
<a href="{{< relURL "index.html" >}}" class="flex items-center">
1414
<div class="bg-layer1 w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
1515
<h1>意見回饋頁範本</h1>
1616
</a>
@@ -34,7 +34,7 @@ <h2>Step 4.送出結果</h2>
3434
<footer id="footer" class="site-footer f6 flex items-center gap4">
3535
<div class="plain w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
3636
<div class="mw5">
37-
<a href="/accessibility-statement">親和力宣告</a>
37+
<a href="{{< relURL "accessibility-statement" >}}">親和力宣告</a>
3838
</div>
3939
</footer>
4040
</div>

content/accessibility/demo-page/landing-page.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
layout: raw
44
---
55
{{< demo-page-head >}}
6-
<!-- TODO: 增加 noscript -->
76
<noscript><span>您的瀏覽器不支援或未開啟JavaScript功能,將無法正常使用本系統,請開啟瀏覽器JavaScript功能,以利系統順利執行。</span></noscript>
87
<div class="one-col">
98
<header class="site-header">
@@ -15,11 +14,11 @@
1514
<a href="#footer" class="skip-to">跳至頁尾</a>
1615
</skip-to>
1716

18-
<a href="/" class="flex items-center">
17+
<a href="{{< relURL "index.html" >}}" class="flex items-center">
1918
<div class="bg-layer1 w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
2019
<h1>首頁範本</h1>
2120
</a>
22-
<nav aria-label="主要" class="flex gap4 mt4">
21+
<nav aria-label="主要" id="navigation" class="flex gap4 mt4">
2322
<a href="#">首頁</a>
2423
<a href="#">關於我們</a>
2524
</nav>
@@ -28,7 +27,7 @@ <h1>首頁範本</h1>
2827
<nav aria-label="麵包屑" class="breadcrumb arrow-separator">
2928
<ol>
3029
<li>
31-
<a href="/">首頁</a>
30+
<a href="{{< relURL "index.html" >}}">首頁</a>
3231
</li>
3332
</ol>
3433
</nav>
@@ -70,7 +69,7 @@ <h1>首頁範本</h1>
7069
<footer id="footer" class="site-footer f6 flex items-center gap4">
7170
<div class="plain w2 mr3" style="aspect-ratio: 1 / 1;"><!-- logo --></div>
7271
<div class="mw5">
73-
<a href="/accessibility-statement">親和力宣告</a>
72+
<a href="{{< relURL "accessibility-statement" >}}">親和力宣告</a>
7473
</div>
7574
</footer>
7675
</div>

content/components/landmark/one-column.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<skip-to><a href="#main" class="skip-to">跳至主要內容區</a></skip-to>
1717
<main id="main"><div class="one-col">
1818
<header class="site-header">
19-
<a href="{{< relURL "/" >}}" class="flex items-center">
19+
<a href="{{< relURL "index.html" >}}" class="flex items-center">
2020
<div class="bg-layer1 w2 mr3" style="aspect-ratio: 1;"><!-- logo --></div>
2121
<h1>{{< pageTitle >}}</h1>
2222
</a>
@@ -64,7 +64,7 @@ <h1>{{< pageTitle >}}</h1>
6464
<footer class="site-footer f6 flex items-center gap4">
6565
<div class="plain w2 mr3" style="aspect-ratio: 1;"><!-- logo --></div>
6666
<div class="mw5">
67-
<a href="/accessibility-statement">親和力宣告</a>
67+
<a href="{{< relURL "accessibility-statement" >}}">親和力宣告</a>
6868
</div>
6969
</footer>
7070
</div>

content/components/skip-to/skip-to-multiple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<div class="one-col">
3131
<header class="site-header">
32-
<a href="{{< relURL "/" >}}" class="logo flex items-center">
32+
<a href="{{< relURL "index.html" >}}" class="logo flex items-center">
3333
<div class="bg-layer1 w2 mr3" style="aspect-ratio: 1">
3434
<!-- logo -->
3535
</div>

layouts/_partials/demo-page/breadcrumb-step.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
<ol>
55
{{- range $index, $p := $pages -}}
66
{{- $i := add $index 1 -}}
7+
{{- $href := printf "accessibility/demo-page/form-page-s%d.html" $i | relURL -}}
78
<li>
8-
{{- if le $i $.current }}
9-
{{- if eq $i $.current }}
10-
<a href="/accessibility/demo-page/form-page-s{{ $i }}.html" aria-current="page"><mark>{{ $p }}</mark></a>
11-
{{- else }}
12-
<a href="/accessibility/demo-page/form-page-s{{ $i }}.html">{{ $p }}</a>
13-
{{- end }}
14-
{{- else }}
15-
<span>{{ $p }}</span>
16-
{{- end }}
9+
{{- if le $i $.current -}}
10+
{{- if eq $i $.current -}}
11+
<a href="{{ $href }}" aria-current="page"><mark>{{ $p }}</mark></a>
12+
{{- else -}}
13+
<a href="{{ $href }}">{{ $p }}</a>
14+
{{- end -}}
15+
{{- else -}}
16+
<span>{{ $p }}</span>
17+
{{- end -}}
1718
</li>
1819
{{- end }}
1920
</ol>

0 commit comments

Comments
 (0)