You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -5,19 +5,19 @@ The purpose is to help avoding repetition of code that is shared between several
5
5
6
6
# How to use
7
7
8
-
1. Add `generator.js` to your project root directory.
8
+
1. Add `generator.js`in the `dist` directory to your project root directory.
9
9
10
10
2. Create a directory `layouts` and create an html-file (e.g. master.html) that will work as the template for all pages. Since the content of this file is part of the assignment, I will not show a complete example here, but all you need is a complete standard HTML-file, and where content differs on different pages, use a yield-directive with `@yield(name)`.
11
11
For instance `@yield(title)` in the title-tag, and `@yield(content)` after navigation.
12
12
13
-
3. Create a directory `pages` where you place each page html-file. The first line in these files will specify what layout to use using the extends-directive, e.g. `@extends(master)`.
13
+
3. Create a directory `pages` where you place each page html-file. The first line in these files will specify what layout to use using the extends-directive, e.g. `@extends(master)`.
14
14
Page-specific content is then added in the corresponding sections, using `@section(content)` and `@endsection`.
15
15
An about.html-file could look like this:
16
16
17
17

18
18
19
-
4. Relative urls are generated correctly using the @link(name), @css(name) and @js(name) directives. This is necessary since index.html will be placed in the root directory whereas the other pages are placed in the html-directory (according to the course requirements).
20
-
For example:
19
+
4. Relative urls are generated correctly using the @link(name), @css(name) and @js(name) directives. This is necessary since index.html will be placed in the root directory whereas the other pages are placed in the html-directory (according to the course requirements).
20
+
For example:
21
21
22
22
`<link rel="stylesheet" href="@css(style)">`
23
23
@@ -44,5 +44,6 @@ That's it. Just make sure you update the layout- and pages-files, and not the ge
44
44
45
45
* This a very early version and the API is likely to change.
46
46
47
+
47
48
# Contributions
48
49
This is mostly a toy-project to help me with this specific course-assignment, but it's now also a great way to play around with GitHub. Please feel free to use this repo in the same way, i.e. you're welcome to create PRs, Issues etc. even if you're unsure if you've done it "correctly".
0 commit comments