static-cms/example/index.html

90 lines
4.2 KiB
HTML
Raw Normal View History

2016-02-25 00:45:56 -08:00
<!doctype html>
<html>
<head>
2016-05-30 16:55:32 -07:00
<meta charset="utf-8" />
2016-02-25 00:45:56 -08:00
<title>This is an example</title>
2016-07-19 17:10:07 -03:00
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500' rel='stylesheet' type='text/css'>
2016-07-18 15:07:45 -03:00
<link rel="stylesheet" href="/cms.css"/>
<script>
window.repoFiles = {
_posts: {
"2015-02-14-this-is-a-post.md": {
content: "---\ntitle: This is a post\nimage: /nf-logo.png\ndate: 2015-02-14T00:00:00.000Z\n---\n\n# I Am a Title in Markdown\n\nHello, world\n"
}
},
_faqs: {
"what-is-netlify-cms.md": {
content: "---\ntitle: What is netlify CMS?\ndate: 2015-11-02T00:00.000Z\n---\n\n# Netlify CMS is Content Manager for Static Site Generators\n\nStatic sites are many times faster, cheaper and safer and traditional dynamic websites.\n\nModern static site generators like Jekyll, Middleman, Roots or Hugo are powerful publishing and development systems, but when we build sites for non-technical users, we need a layer on top of them.\n\nNetlify CMS is there to let your marketing team push new content to your public site, or to let technical writers work on your documentation.\n\nNetlify CMS integrates with Git and turns normal content editors into git comitters.\n\n"
},
"what-is-jam-stack.md": {
content: "---\ntitle: What is the “JAM Stack”?\ndate: 2015-11-02T00:00.000Z\n---\n\n# The JAM stack is a new way of building websites and apps that are fast, secure and simple to work with.\n\nJAM stands for JavaScript, APIs and Markup. It's the fastest growing new stack for building websites and apps: no more servers, host all your front-end on a CDN and use APIs for any moving parts.\n\n"
},
2016-07-13 11:37:00 -03:00
"cache-invalidation.md": {
content: "---\ntitle: What about Cache Invalidation?\ndate: 2015-11-02T00:00.000Z\n---\n\n# Netlify handles cache invalidation automatically\n\nWhen your changes go live, they go live.\n\nNo waiting for cache purges, no cumbersome varnish setup, no API calls to clean your distribution. Netlify handles cache purges within an average of 250ms from your deploy!\n\n"
},
"continuous-deployment.md": {
content: "---\ntitle: Does Netlify support Continuous Deployment?\ndate: 2015-11-02T00:00.000Z\n---\n\n# Yes, Netlify let you Integrate your site or web-app to GitHub, GitLab or BitBucket and run your build tool on our servers.\n\nAutomatically rebuild your site every time your content changes: trigger builds by pushing to git or via webhooks.\n\n"
}
},
_data: {
"settings.json": {
content: '{"site_title": "CMS Demo", "posts": {"front_limit": 5, "author": "Matt Biilmann"}}'
},
"authors.yml": {
content: 'authors:\n - name: Mathias\n description: Co-founder @ Netlify\n'
}
}
}
var ONE_DAY = 60 * 60 * 24 * 1000;
for (var i=1; i<=10; i++) {
var date = new Date();
date.setTime(date.getTime() + ONE_DAY);
var dateString = '' + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
var slug = dateString + "-post-number-" + i + ".md";
window.repoFiles._posts[slug] = {
2016-07-12 18:10:26 -03:00
content: "---\ntitle: \"This is post # " + i + "\"\ndate: " + dateString + "T00:99:99.999Z\n---\n\n# The post is number " + i + "\n\nAnd this is yet another identical post body"
}
}
for (var i=1; i<=5; i++) {
var date = new Date();
date.setTime(date.getTime() + ONE_DAY);
var dateString = '' + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
var slug = dateString + "-faq-number-" + i + ".md";
window.repoFiles._faqs[slug] = {
2016-07-12 18:10:26 -03:00
content: "---\ntitle: \"This FAQ item # " + i + "\"\ndate: " + dateString + "T00:99:99.999Z\n---\n\n# Loren ipsum dolor sit amet"
}
}
</script>
2016-02-25 00:45:56 -08:00
</head>
<body>
2016-07-18 15:07:45 -03:00
2016-02-25 00:45:56 -08:00
<script src='/cms.js'></script>
2016-08-18 15:13:22 -03:00
<script>
CMS.registerEditorComponent({
id: "youtube",
label: "Youtube",
icon: 'video',
fields: [{name: 'id', label: 'Youtube Video ID'}],
2016-08-18 15:13:22 -03:00
pattern: /^{{<\s?youtube (\S+)\s?>}}/,
fromBlock: function(match) {
return {
id: match[1]
2016-08-18 15:13:22 -03:00
};
},
toBlock: function(obj) {
return '{{< youtube ' + obj.id + ' >}}';
2016-08-18 15:13:22 -03:00
}
})
</script>
2016-02-25 00:45:56 -08:00
</body>
</html>