├── .gitignore ├── README.md ├── css ├── animations.css ├── poole.min.css └── poole.overrides.min.css ├── index.html ├── js ├── cms.js └── config.js ├── layouts ├── error.html ├── page-list.html ├── page.html ├── post-list.html └── post.html ├── pages ├── .htaccess ├── about.md └── links.md └── posts ├── .htaccess ├── 2015-05-10-new-feature.md ├── 2017-08-20-another-example-post.md └── 2018-03-01-sample-blog-post.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/* 3 | release/* 4 | *.swp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## CMS.js Starter 2 | 3 | **Quick Start** 4 | 5 | 1. Clone this repo: `git clone https://github.com/chrisdiana/cms.js-starter.git` 6 | 2. Configure `js/config.js` to your liking 7 | 3. Make sure to set your Github settings in `js/config.js` if using Github mode 8 | 4. If using Github mode, create a new branch from your master or working branch called `gh-pages` (Github's default branch for hosting) 9 | 5. Visit your site! (which should be located at `https://yourusername.github.io/cms.js-starter`) 10 | 11 | 12 | ![CMS.js Screenshot](https://raw.githubusercontent.com/chrisdiana/cms.js/gh-pages/img/screenshot.png) 13 | 14 | ## Learn more about CMS.js 15 | 16 | * Visit the [CMS.js repo](https://github.com/chrisdiana/cms.js) to learn more 17 | * Get more themes and templates [here](https://chrisdiana.github.io/cms.js-themes) 18 | -------------------------------------------------------------------------------- /css/animations.css: -------------------------------------------------------------------------------- 1 | /* Animations Styles */ 2 | 3 | .fade-in { 4 | -webkit-animation: fadein 1s; 5 | -moz-animation: fadein 1s; 6 | -ms-animation: fadein 1s; 7 | -o-animation: fadein 1s; 8 | animation: fadein 1s; 9 | } 10 | 11 | @keyframes fadein { 12 | from { opacity: 0; } 13 | to { opacity: 1; } 14 | } 15 | 16 | @-moz-keyframes fadein { 17 | from { opacity: 0; } 18 | to { opacity: 1; } 19 | } 20 | 21 | @-webkit-keyframes fadein { 22 | from { opacity: 0; } 23 | to { opacity: 1; } 24 | } 25 | 26 | @-ms-keyframes fadein { 27 | from { opacity: 0; } 28 | to { opacity: 1; } 29 | } 30 | -------------------------------------------------------------------------------- /css/poole.min.css: -------------------------------------------------------------------------------- 1 | /* Poole - Designed, built, and released under MIT license by @mdo. https://github.com/poole/poole. */ 2 | *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html,body{margin:0;padding:0}html{font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:16px;line-height:1.5}@media (min-width: 38em){html{font-size:20px}}body{color:#515151;background-color:#fff;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a{color:#268bd2;text-decoration:none}a strong{color:inherit}a:hover,a:focus{text-decoration:underline}h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:bold;line-height:1.25;color:#313131;text-rendering:optimizeLegibility}h1{font-size:2rem}h2{margin-top:1rem;font-size:1.5rem}h3{margin-top:1.5rem;font-size:1.25rem}h4,h5,h6{margin-top:1rem;font-size:1rem}p{margin-top:0;margin-bottom:1rem}strong{color:#303030}ul,ol,dl{margin-top:0;margin-bottom:1rem}dt{font-weight:bold}dd{margin-bottom:.5rem}hr{position:relative;margin:1.5rem 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr{font-size:85%;font-weight:bold;color:#555;text-transform:uppercase}abbr[title]{cursor:help;border-bottom:1px dotted #e5e5e5}code,pre{font-family:Menlo, Monaco, "Courier New", monospace}code{padding:.25em .5em;font-size:85%;color:#bf616a;background-color:#f9f9f9;border-radius:3px}pre{display:block;margin-top:0;margin-bottom:1rem;padding:1rem;font-size:.8rem;line-height:1.4;white-space:pre;white-space:pre-wrap;word-break:break-all;word-wrap:break-word;background-color:#f9f9f9}pre code{padding:0;font-size:100%;color:inherit;background-color:transparent}.highlight{margin-bottom:1rem;border-radius:4px}.highlight pre{margin-bottom:0}.gist .gist-file{font-family:Menlo, Monaco, "Courier New", monospace !important}.gist .markdown-body{padding:15px}.gist pre{padding:0;background-color:transparent}.gist .gist-file .gist-data{font-size:.8rem !important;line-height:1.4}.gist code{padding:0;color:inherit;background-color:transparent;border-radius:0}blockquote{padding:.5rem 1rem;margin:.8rem 0;color:#7a7a7a;border-left:.25rem solid #e5e5e5}blockquote p:last-child{margin-bottom:0}@media (min-width: 30em){blockquote{padding-right:5rem;padding-left:1.25rem}}img{display:block;max-width:100%;margin:0 0 1rem;border-radius:5px}table{margin-bottom:1rem;width:100%;border:1px solid #e5e5e5;border-collapse:collapse}td,th{padding:.25rem .5rem;border:1px solid #e5e5e5}tbody tr:nth-child(odd) td,tbody tr:nth-child(odd) th{background-color:#f9f9f9}.lead{font-size:1.25rem;font-weight:300}.message{margin-bottom:1rem;padding:1rem;color:#717171;background-color:#f9f9f9}.container{max-width:38rem;padding-left:1rem;padding-right:1rem;margin-left:auto;margin-right:auto}.masthead{padding-top:1rem;padding-bottom:1rem;margin-bottom:3rem}.masthead-title{margin-top:0;margin-bottom:0;color:#505050}.masthead-title a{color:#505050}.masthead-title small{font-size:75%;font-weight:400;color:#c0c0c0;letter-spacing:0}.page,.post{margin-bottom:4em}.page-title,.post-title,.post-title a{color:#303030}.page-title,.post-title{margin-top:0}.post-date{display:block;margin-top:-.5rem;margin-bottom:1rem;color:#9a9a9a}.related{padding-top:2rem;padding-bottom:2rem;border-top:1px solid #eee}.related-posts{padding-left:0;list-style:none}.related-posts h3{margin-top:0}.related-posts li small{font-size:75%;color:#999}.related-posts li a:hover{color:#268bd2;text-decoration:none}.related-posts li a:hover small{color:inherit}.pagination{overflow:hidden;margin-left:-1rem;margin-right:-1rem;font-family:"PT Sans", Helvetica, Arial, sans-serif;color:#ccc;text-align:center}.pagination-item{display:block;padding:1rem;border:1px solid #eee}.pagination-item:first-child{margin-bottom:-1px}a.pagination-item:hover{background-color:#f5f5f5}@media (min-width: 30em){.pagination{margin:3rem 0}.pagination-item{float:left;width:50%}.pagination-item:first-child{margin-bottom:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination-item:last-child{margin-left:-1px;border-top-right-radius:4px;border-bottom-right-radius:4px}} -------------------------------------------------------------------------------- /css/poole.overrides.min.css: -------------------------------------------------------------------------------- 1 | /* CMS.js overrides */ 2 | nav{display:block;float:right}nav ul{list-style:none;padding:0}nav ul li{display:inline;padding-left:10px}nav ul li a{font-size:18px}.footer{padding-bottom:15px}.sitename img{max-height:32px}.masthead-title{display:block;float:left}.masthead-title a{float:left}.masthead-title small{padding-left:8px}.post-tag,input{padding:5px 10px}.post-tags{margin-bottom:14px}.post-tag{background:#1b89d5;color:#fff;text-transform:uppercase;font-size:15px;margin-right:8px}.post-tag:hover{text-decoration:none;background:#0a74b9}input{font-size:18px}@media (max-width:480px){nav{float:right;width:100%;margin-top:.5rem}nav ul li{padding-left:.5rem}nav ul li:first-child{padding-left:0}nav ul li a{font-size:1rem}} 3 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CMS.js 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 |
21 | 22 |
23 |

24 | 25 | CMS.js 26 | 27 | 28 | The Javascript Site Generator 29 | 30 |

31 | 32 | 40 |
41 | 42 | 43 |
44 | 45 | 46 | 50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /js/cms.js: -------------------------------------------------------------------------------- 1 | /*! CMS.js v2.0.0 | MIT (c) 2018 Chris Diana | https://github.com/chrisdiana/cms.js */ 2 | var CMS=function(o){"use strict";var n,e;this.ready=!1,this.routes={},this.collections={};var i={elementId:null,layoutDirectory:null,defaultView:null,errorLayout:null,mode:"SERVER",github:null,types:[],plugins:[],frontMatterSeperator:"---",listAttributes:["tags"],dateParser:/\d{4}-\d{2}(?:-\d{2})?/,extension:".md",sort:void 0,markdownEngine:null,debug:!(this.filteredCollections={}),messageClassName:"cms-messages",onload:function(){},onroute:function(){}},r='ERROR: No element ID or ID incorrect. Check "elementId" parameter in config.',s="ERROR: Error getting files. Make sure there is a directory for each type in config with files in it.",l="ERROR: Error getting the file",a="ERROR: Error loading layout. Check the layout file to make sure it exists.",c="WARNING: Not ready to perform action";function u(){this.rules=[{regex:/(#+)(.*)/g,replacement:function(t,e,n){var i=e.length;return""+n.trim()+""}},{regex:/!\[([^[]+)\]\(([^)]+)\)/g,replacement:"$1"},{regex:/\[([^[]+)\]\(([^)]+)\)/g,replacement:"$1"},{regex:/(\*\*|__)(.*?)\1/g,replacement:"$2"},{regex:/(\*|_)(.*?)\1/g,replacement:"$2"},{regex:/~~(.*?)~~/g,replacement:"$1"},{regex:/:"(.*?)":/g,replacement:"$1"},{regex:/```[a-z]*\n[\s\S]*?\n```/g,replacement:function(t){return"
"+(t=t.replace(/```/gm,"")).trim()+"
"}},{regex:/&&&[a-z]*\n[\s\S]*?\n&&&/g,replacement:function(t){return'