Skip to content

Commit 35d212c

Browse files
committed
feat: Show edit page link on tutorial pages
1 parent 5c473e4 commit 35d212c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/components/controllers/page/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export default function Page({ route, prev, next }, ctx) {
158158
// "current" is the currently *displayed* page ID.
159159

160160
const showTitle = current != 'index' && meta.show_title !== false;
161-
const canEdit = showTitle && current != '404' && current !== '/blog';
161+
const canEdit = showTitle && current != '404';
162162
const hasSidebar = meta.toc !== false && isDocPage(url);
163163

164164
return (

src/components/controllers/tutorial/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { useStore, storeCtx } from '../../store-adapter';
2727
import { InjectPrerenderData } from '../../../lib/prerender-data';
2828
import { getContent } from '../../../lib/content';
2929
import { Splitter } from '../../splitter';
30+
import EditThisPage from '../../edit-button';
3031

3132
const IS_PRERENDERING = typeof window === 'undefined';
3233

@@ -284,7 +285,8 @@ function TutorialView({
284285
}
285286
>
286287
<div class={style.tutorialWindow} ref={content}>
287-
<h1 class={style.title}>{title}</h1>
288+
<EditThisPage show={title != 'Error'} isFallback={page.isFallback} />
289+
<h1>{title}</h1>
288290

289291
<ContentRegion
290292
name={page.current}

src/components/controllers/tutorial/style.module.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
}
8686

8787
& > h1 {
88-
margin: 0;
88+
margin: 2.5rem 0 0;
8989
padding: 0.25em 0;
9090
font-size: 2.5rem;
9191
font-weight: 200;
@@ -214,7 +214,7 @@
214214
.tutorialWindow {
215215
flex-basis: 100%;
216216

217-
& > * {
217+
& > :not(:first-child) {
218218
max-width: 700px;
219219
margin-left: auto;
220220
margin-right: auto;

0 commit comments

Comments
 (0)