Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
eth-landing-page
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Erick Hitter
eth-landing-page
Commits
95c76ee2
Verified
Commit
95c76ee2
authored
Dec 25, 2016
by
Erick Hitter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic templating
parent
fc783208
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
9 deletions
+23
-9
index.js
index.js
+6
-6
render/index.handlebars
render/index.handlebars
+3
-1
render/partials/sites.handlebars
render/partials/sites.handlebars
+6
-0
render/templates/main.handlebars
render/templates/main.handlebars
+8
-2
No files found.
index.js
View file @
95c76ee2
...
...
@@ -14,15 +14,15 @@ app.engine( 'handlebars', handlebars( {
}
)
);
app
.
set
(
'
views
'
,
__dirname
+
'
/render
'
);
var
domains
=
[
'
https://ethitter.com
'
,
'
https://erick.blog
'
,
'
https://i.ethitter.com
'
]
;
var
domains
=
{
'
ethitter.com
'
:
'
https://ethitter.com/
'
,
'
erick.blog
'
:
'
https://erick.blog/
'
,
'
i.ethitter.com
'
:
'
https://i.ethitter.com/
'
}
;
// Rendering
app
.
get
(
'
/
'
,
function
(
req
,
res
)
{
res
.
render
(
'
index
'
,
domains
);
res
.
render
(
'
index
'
,
{
data
:
{
domains
:
domains
}
}
);
}
);
// Get some data
...
...
render/index.handlebars
View file @
95c76ee2
{{!< main}}
\ No newline at end of file
{{!< main}}
<h1>
Welcome!
</h1>
render/partials/sites.handlebars
0 → 100644
View file @
95c76ee2
{{#
each
data
.
domains
}}
<div
class=
"site-container"
id=
"site-
{{
@key
}}
"
>
<h2><a
href=
"
{{
this
}}
"
>
{{
this
}}
</a></h2>
<span
class=
"latest-post"
></span>
</div>
{{/
each
}}
render/templates/main.handlebars
View file @
95c76ee2
<
!
DOCTYPE
>
<html>
<head>
<title></title>
<title>
erick t. hitter's latest posts
</title>
</head>
<body></body>
<body>
{{{
body
}}}
<div
id=
"sites"
>
{{>
sites
}}
</div>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment