diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/db.json | 12 | ||||
| -rw-r--r-- | examples/index.js | 12 | ||||
| -rw-r--r-- | examples/templates/index.liquid | 4 |
3 files changed, 25 insertions, 3 deletions
diff --git a/examples/db.json b/examples/db.json index 34304c9..11204e7 100644 --- a/examples/db.json +++ b/examples/db.json @@ -328,5 +328,17 @@ "dateCreated": "Sat, 31 Dec 2016 05:07:09 GMT", "images": [] } + ], + "filez": [ + { + "id": "pdf-upload", + "title": "PDF upload", + "file": { + "uri": "/uploads/1e/Typhon firmware v3.pdf", + "caption": "/uploads/1e/Typhon firmware v3.pdf" + }, + "__index": 0, + "dateCreated": "Tue, 23 Feb 2021 19:30:32 GMT" + } ] }
\ No newline at end of file diff --git a/examples/index.js b/examples/index.js index f08c752..729c574 100644 --- a/examples/index.js +++ b/examples/index.js @@ -69,6 +69,11 @@ var app = okcms image: { type: "image" }, images: { type: "triple-captioned-image-list" }, }, + filez: { + id: { type: "string", hidden: true }, + title: { type: "string" }, + file: { type: "file" }, + }, }, resources: [ @@ -77,6 +82,7 @@ var app = okcms { type: "bread" }, { type: "test" }, { type: "flour" }, + { type: "filez" }, ], services: { @@ -85,6 +91,10 @@ var app = okcms secret: process.env.S3_SECRET, bucket: process.env.S3_BUCKET, dirname: "okcms-example", + local: { + localPath: "/Users/user/Sites/okcms/examples/public/uploads/", + remotePath: "/uploads/", + }, image: { allowed: true, preserveFilename: false, @@ -163,7 +173,7 @@ var app = okcms "/contact": { data: { type: "page", query: "contact" }, }, - "/:id": { + "/bread/:id": { data: { type: "bread", query: ":id" }, }, }, diff --git a/examples/templates/index.liquid b/examples/templates/index.liquid index 7c12a86..4f26378 100644 --- a/examples/templates/index.liquid +++ b/examples/templates/index.liquid @@ -12,7 +12,7 @@ <nav> <ul> {% for page in pages %} - <li><a href="{{page.id}}">{{page.id | capitalize}}</a></li> + <li><a href="/{{page.id}}">{{page.id | capitalize}}</a></li> {% endfor %} </ul> <nav> @@ -20,7 +20,7 @@ <h2>Great breads:</h2> <ul> {% for bread in breads %} - <li><a href="{{bread.id}}">{{bread.id | capitalize}}</a></li> + <li><a href="/bread/{{bread.id}}">{{bread.id | capitalize}}</a></li> {% endfor %} </ul> </div> |
