Skip to content

Commit 07aaabf

Browse files
committed
Add edit this page links
1 parent 4c8bfb5 commit 07aaabf

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

_generate.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ function writeOut() {
7979
fs.readFile(path.join(__dirname, "_template._html"), "utf-8", function(err, template) {
8080
if(err) throw err;
8181
files.forEach(function(file) {
82-
fs.writeFile(file.htmlFile, template.replace("######", file.html), "utf-8", function(err) {
82+
var content = template;
83+
Object.keys(file).forEach(function(key) {
84+
content = content.replace('{{' + key + '}}', file[key]);
85+
});
86+
fs.writeFile(file.htmlFile, content, "utf-8", function(err) {
8387
if(err) throw err;
8488
});
8589
});

_template._html

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
</ul>
7474
</div>
7575
<div class="content">
76-
######
76+
{{html}}
77+
<br/><br/><a href="https://github.com/jmpressjs/docs/edit/master/{{name}}.md" class="editpage" target="_blank">Edit This Page</a><br/>
7778
</div>
7879
</div>
7980
</body>

contribute.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Please work and pull against the `dev` branch to make sure you are using the lat
4646
## Docs
4747

4848
If you find an error or something missing please edit and submit a pull request.
49-
There is an **Edit This Page** button in the top right corner.
49+
There is an **Edit This Page** button on the bottom of each page or fork then clone the docs with git. Thank you for contributing!

style.css

+6
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,9 @@ li {
6161
margin: 0px;
6262
}
6363
}
64+
65+
.editpage {
66+
float: right;
67+
font-style: italic;
68+
font-size: 0.8em;
69+
}

0 commit comments

Comments
 (0)