File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export function get_section(slug) {
106
106
slug : section . slug ,
107
107
prev : section . prev ,
108
108
next : section . next ,
109
+ dir : section . dir ,
109
110
html : transform ( section . markdown ) , // TODO syntax highlighting
110
111
a,
111
112
b
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export interface Section {
37
37
prev : string | null ;
38
38
next : string | null ;
39
39
html : string ;
40
+ dir : string ;
40
41
a : Record < string , Stub > ;
41
42
b : Record < string , Stub > ;
42
43
}
Original file line number Diff line number Diff line change 19
19
import Editor from ' ./_/Editor.svelte' ;
20
20
import Folder from ' ./_/Folder.svelte' ;
21
21
import { monaco } from ' $lib/client/monaco/monaco.js' ;
22
+ import { Icon } from ' @sveltejs/site-kit' ;
22
23
23
24
/** @type {import('$lib/types').SectionIndex} */
24
25
export let index;
169
170
170
171
<div class ="text" >{@html section .html }</div >
171
172
172
- {#if Object .keys (section .b ).length > 0 }
173
- <div class =" controls" />
174
- {/if }
173
+ <footer >
174
+ <a class ="edit" href ="https://github.com/sveltejs/learn.svelte.dev/tree/main/ {section .dir }" >
175
+ <Icon size ={16 } name =" edit" /> Edit this page
176
+ </a >
177
+ </footer >
175
178
</section >
176
179
177
180
<section slot =" b" >
337
340
list-style-position : inside ;
338
341
}
339
342
340
- .controls {
341
- padding : 1rem 3 rem ;
343
+ .content footer {
344
+ padding : 1rem 4 rem ;
342
345
display : flex ;
343
346
justify-content : space-between ;
344
347
border-top : 1px solid rgba (255 , 255 , 255 , 0.1 );
345
348
}
346
349
350
+ .content footer a {
351
+ color : var (--sidebar-text );
352
+ font-size : 1.4rem ;
353
+ display : flex ;
354
+ gap : 0.5rem ;
355
+ }
356
+
347
357
.navigator {
348
358
background : #f9f9f9 ;
349
359
display : flex ;
You can’t perform that action at this time.
0 commit comments