Skip to content

Commit 87907ff

Browse files
[Docs] - Switch from <base> tag to explicit base path for absolute URLs.
1 parent fa3588d commit 87907ff

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

doc/website/bin/main.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,16 @@ Future<void> main(List<String> arguments) async {
1515
..plugin(const PrettyUrlsPlugin())
1616
..plugin(const RedirectsPlugin())
1717
..plugin(const SassPlugin())
18-
1918
..plugin(const PubPackagePlugin({
2019
"lucid",
2120
}))
22-
23-
2421
..plugin(
2522
GitHubContributorsPlugin(
2623
// To load the contributors for a given GitHub package using credentials,
2724
// place your GitHub API token in an environment variable with the following name.
2825
authToken: Platform.environment["github_doc_website_token"],
2926
),
3027
)
31-
3228
..plugin(DraftingPlugin(
3329
showDrafts: arguments.contains("preview"),
3430
));

doc/website/source/_data.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ github:
2020

2121
- { organization: Flutter-Bounty-Hunters, name: lucid }
2222

23+
# The path to use as the base for all absolute URLs. When writing an absolute URL
24+
# in HTML, you should write them as "{{ base_path }}the/file/path"
25+
base_path: /lucid/
2326

2427
# The default layout applied to all pages in this website.
2528
layout: layouts/docs_page.jinja
2629

2730
# The global navigation manu for all documentation pages in this website.
2831
navigation:
29-
3032
show_contributors: true
31-
3233

3334
items:
3435
- title: Welcome

doc/website/source/_includes/layouts/docs_page.jinja

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
<title>{{ title }}</title>
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88

9-
<base href="https://flutter-bounty-hunters.github.io/lucid/">
10-
11-
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-touch-icon.png">
12-
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32x32.png">
13-
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16x16.png">
14-
<link rel="manifest" href="/images/favicon/site.webmanifest">
15-
<link rel="mask-icon" href="/images/favicon/safari-pinned-tab.svg" color="#5bbad5">
16-
<link rel="shortcut icon" href="/images/favicon/favicon.ico">
9+
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_path }}images/favicon/apple-touch-icon.png">
10+
<link rel="icon" type="image/png" sizes="32x32" href="{{ base_path }}images/favicon/favicon-32x32.png">
11+
<link rel="icon" type="image/png" sizes="16x16" href="{{ base_path }}images/favicon/favicon-16x16.png">
12+
<link rel="manifest" href="{{ base_path }}images/favicon/site.webmanifest">
13+
<link rel="mask-icon" href="{{ base_path }}images/favicon/safari-pinned-tab.svg" color="#5bbad5">
14+
<link rel="shortcut icon" href="{{ base_path }}images/favicon/favicon.ico">
1715
<meta name="msapplication-TileColor" content="#da532c">
18-
<meta name="msapplication-config" content="/images/favicon/browserconfig.xml">
16+
<meta name="msapplication-config" content="{{ base_path }}images/favicon/browserconfig.xml">
1917
<meta name="theme-color" content="#ffffff">
2018

2119
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
@@ -30,15 +28,15 @@
3028

3129
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
3230

33-
<link rel="stylesheet" href="/styles/docs_page_layout.css">
34-
<link rel="stylesheet" href="/styles/docs_page_layout_light.css">
35-
<link rel="stylesheet" href="/styles/docs_page_layout_dark.css">
31+
<link rel="stylesheet" href="{{ base_path }}styles/docs_page_layout.css">
32+
<link rel="stylesheet" href="{{ base_path }}styles/docs_page_layout_light.css">
33+
<link rel="stylesheet" href="{{ base_path }}styles/docs_page_layout_dark.css">
3634
</head>
3735

3836
<body>
3937
<nav class="navbar navbar-expand-lg">
4038
<div class="container">
41-
<a class="navbar-brand" href="/"><img src="/images/branding/logo.png" height="32"><span class="name">{{ package.title }}</span></a>
39+
<a class="navbar-brand" href="{{ base_path }}"><img src="{{ base_path }}images/branding/logo.png" height="32"><span class="name">{{ package.title }}</span></a>
4240

4341
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#drawerNav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
4442
<span class="navbar-toggler-icon"></span>

0 commit comments

Comments
 (0)