Skip to content

Commit a02e69a

Browse files
committed
added docpad version of placeholder
html5boilerplate + less little heavy on the coffeescript but whatever
1 parent a3e1b62 commit a02e69a

18 files changed

+10225
-0
lines changed

docpad.coffee

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# The DocPad Configuration File
2+
# It is simply a CoffeeScript Object which is parsed by CSON
3+
docpadConfig = {
4+
5+
# =================================
6+
# Template Data
7+
8+
templateData:
9+
10+
site:
11+
url: "http://definitelytyped.github.io"
12+
13+
oldUrls: [
14+
]
15+
16+
title: "DefinitelyTyped"
17+
18+
description: """
19+
The repository for high quality TypeScript type definitions.
20+
"""
21+
22+
keywords: """
23+
typescript, type, definition, declaration, repository, typing
24+
"""
25+
26+
styles: [
27+
'/vendor/normalize.css'
28+
'/vendor/h5bp.css'
29+
'/styles/style.css'
30+
]
31+
32+
scripts: [
33+
"""
34+
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
35+
<script>window.jQuery || document.write('<script src="/vendor/jquery.js"><\\/script>')</script>
36+
"""
37+
38+
'/vendor/log.js'
39+
'/vendor/modernizr.js'
40+
'/scripts/script.js'
41+
]
42+
43+
44+
# -----------------------------
45+
# Helper Functions
46+
47+
getPreparedTitle: ->
48+
# if we have a document title, then we should use that and suffix the site's title onto it
49+
if @document.title
50+
"#{@document.title} | #{@site.title}"
51+
# if our document does not have it's own title, then we should just use the site's title
52+
else
53+
@site.title
54+
55+
# Get the prepared site/document description
56+
getPreparedDescription: ->
57+
# if we have a document description, then we should use that, otherwise use the site's description
58+
@document.description or @site.description
59+
60+
# Get the prepared site/document keywords
61+
getPreparedKeywords: ->
62+
# Merge the document keywords with the site keywords
63+
@site.keywords.concat(@document.keywords or []).join(', ')
64+
65+
66+
# =================================
67+
# Collections
68+
69+
collections:
70+
71+
# Create a collection called posts
72+
# That contains all the documents that will be going to the out path posts
73+
posts: ->
74+
@getCollection('documents').findAllLive({relativeOutDirPath: 'posts'})
75+
76+
77+
# =================================
78+
# Environments
79+
80+
environments:
81+
development:
82+
templateData:
83+
site:
84+
url: false
85+
86+
plugins:
87+
handlebars:
88+
helpers:
89+
getBlock: (type, additional...) ->
90+
additional.pop() # remove the hash object
91+
@getBlock(type).add(additional).toHTML()
92+
partials:
93+
title: '<h1>{{document.title}}</h1>'
94+
goUp: '<a href="#">Scroll up</a>'
95+
96+
# =================================
97+
# DocPad Events
98+
99+
events:
100+
101+
# Server Extend
102+
# Used to add our own custom routes to the server before the docpad routes are added
103+
serverExtend: (opts) ->
104+
# Extract the server from the options
105+
{server} = opts
106+
docpad = @docpad
107+
108+
# As we are now running in an event,
109+
# ensure we are using the latest copy of the docpad configuraiton
110+
# and fetch our urls from it
111+
latestConfig = docpad.getConfig()
112+
oldUrls = latestConfig.templateData.site.oldUrls or []
113+
newUrl = latestConfig.templateData.site.url
114+
115+
# Redirect any requests accessing one of our sites oldUrls to the new site url
116+
server.use (req,res,next) ->
117+
if req.headers.host in oldUrls
118+
res.redirect(newUrl+req.url, 301)
119+
else
120+
next()
121+
}
122+
123+
# Export our DocPad Configuration
124+
module.exports = docpadConfig

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"private": true,
3+
"name": "definitelytyped.github.io",
4+
"version": "0.1.0",
5+
"description": "DefinitelyTyped website",
6+
"homepage": "http://definitelytyped.github.io",
7+
"keywords": [
8+
"DefinitelyTyped",
9+
"website"
10+
],
11+
"author": "Bart van der Schoor @ DefinitelyTyped",
12+
"maintainers": [],
13+
"contributors": [],
14+
"bugs": {
15+
"url": "https://github.com/DefinitelyTyped/definitelytyped.github.io/issues"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/DefinitelyTyped/definitelytyped.github.io.git"
20+
},
21+
"engines": {
22+
"node": "0.10",
23+
"npm": "1.3"
24+
},
25+
"dependencies": {
26+
"docpad": "~6.64.0",
27+
"docpad-plugin-eco": "~2.0.3",
28+
"docpad-plugin-marked": "~2.2.0",
29+
"docpad-plugin-partials": "~2.9.0",
30+
"docpad-plugin-less": "~2.4.1"
31+
},
32+
"devDependencies": {
33+
"docpad-plugin-livereload": "~2.6.0"
34+
},
35+
"main": "node_modules/docpad/bin/docpad-server"
36+
}

src/documents/index.html.eco

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: 'default'
3+
---
4+
5+
<div class="col">
6+
<p><a href="https://github.com/borisyankov/DefinitelyTyped"><img src="/img/dt-logo-smallish.png" title="<%- @site.title %>"/></a></p>
7+
<p>DefinitelyTyped</p>
8+
<p><small>The <a href="https://github.com/borisyankov/DefinitelyTyped">repository</a> for high quality <a href="http://typescriptlang.org/">TypeScript</a> type definitions.</small></p>
9+
</div>

src/documents/scripts/script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('sup?');

src/documents/styles/style.css.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@background: #fff;
2+
@main: #0785e2;
3+
4+
html, body {
5+
background-color:white;
6+
color: #888;
7+
}
8+
.col {
9+
font-family: sans-serif;
10+
margin-top: 10em;
11+
text-align: center;
12+
}
13+
a, a:visited {
14+
color: @main;
15+
}
16+
a, a:active {
17+
color: saturate(@main, 10%);
18+
}
8.43 KB
Loading

src/files/crossdomain.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
3+
<cross-domain-policy>
4+
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
5+
6+
<!-- Most restrictive policy: -->
7+
<site-control permitted-cross-domain-policies="none"/>
8+
9+
<!-- Least restrictive policy: -->
10+
<!--
11+
<site-control permitted-cross-domain-policies="all"/>
12+
<allow-access-from domain="*" to-ports="*" secure="false"/>
13+
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
14+
-->
15+
</cross-domain-policy>

src/files/favicon.ico

434 Bytes
Binary file not shown.

src/files/humans.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# humanstxt.org/
2+
# The humans responsible & technology colophon
3+
4+
# TEAM
5+
6+
Owners -- owning
7+
Collaborator -- collaborating
8+
9+
# THANKS
10+
11+
Contributors -- contributing
12+
Users -- using
13+
14+
# TECHNOLOGY COLOPHON
15+
16+
TypeScript

src/files/img/dt-logo-smallish.png

8.43 KB
Loading

0 commit comments

Comments
 (0)