Skip to content

Commit 07c8039

Browse files
committed
Add build process to prepare for refactor. Readme updated to tell users to fetch the code from the dist-directory
1 parent 9472b8f commit 07c8039

7 files changed

+14138
-9
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ The purpose is to help avoding repetition of code that is shared between several
55

66
# How to use
77

8-
1. Add `generator.js` to your project root directory.
8+
1. Add `generator.js` in the `dist` directory to your project root directory.
99

1010
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)`.
1111
For instance `@yield(title)` in the title-tag, and `@yield(content)` after navigation.
1212

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)`.
1414
Page-specific content is then added in the corresponding sections, using `@section(content)` and `@endsection`.
1515
An about.html-file could look like this:
1616

1717
![](docs/about.png)
1818

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:
2121

2222
`<link rel="stylesheet" href="@css(style)">`
2323

@@ -44,5 +44,6 @@ That's it. Just make sure you update the layout- and pages-files, and not the ge
4444

4545
* This a very early version and the API is likely to change.
4646

47+
4748
# Contributions
4849
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".

dist/generator.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mix-manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"/dist/generator.js": "/dist/generator.js"
3+
}

0 commit comments

Comments
 (0)