{"id":715,"date":"2019-08-11T16:00:24","date_gmt":"2019-08-11T16:00:24","guid":{"rendered":"https:\/\/www.rolanddreger.net\/de\/?p=715"},"modified":"2019-09-20T15:16:42","modified_gmt":"2019-09-20T15:16:42","slug":"cloud-publishing-with-adobe-indesign-and-kirby","status":"publish","type":"post","link":"https:\/\/www.rolanddreger.net\/de\/715\/cloud-publishing-with-adobe-indesign-and-kirby\/","title":{"rendered":"Cloud publishing with Adobe InDesign and Kirby"},"content":{"rendered":"\n<p class=\"lead\">3 steps to <a href=\"https:\/\/vimeo.com\/360116607\">connecting Adobe InDesign and Kirby<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Install Kirby<\/h4>\n\n\n\n<p>Kirby is a flat-file CMS. That means all content is stored in files and folders. You can create that files and folders manually in the file system (and edit content files with the text editor). But it&#8217;s also possible to use a panel for that or create and modify content programmatically \u2013 with Kirby&#8217;s API.<\/p>\n\n\n\n<p>Kirby has an extremely flexible and versatile panel for data input. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"542\" src=\"https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page_list-1024x542.png\" alt=\"\" class=\"wp-image-718\" srcset=\"https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page_list-1024x542.png 1024w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page_list-624x330.png 624w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page_list-768x406.png 768w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page_list.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"601\" src=\"https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page-1024x601.png\" alt=\"\" class=\"wp-image-719\" srcset=\"https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page-1024x601.png 1024w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page-624x366.png 624w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page-768x451.png 768w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_panel_page.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The individual layout and field definitions are done in blueprints with YAML. Many predefined field types are already included. Custom fields can also be created. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"667\" src=\"https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_blueprint_yaml-1024x667.png\" alt=\"\" class=\"wp-image-720\" srcset=\"https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_blueprint_yaml-1024x667.png 1024w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_blueprint_yaml-614x400.png 614w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_blueprint_yaml-768x500.png 768w, https:\/\/www.rolanddreger.net\/de\/wp-content\/uploads\/2019\/08\/kirby_blueprint_yaml.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>So you have full control over input fields and output format: <em>\u00bbContent Representations allow you to output the content in different formats. Be it JSON for your frontend JS library of choice or to use Kirby as an API for other tools, [\u2026]\u00ab<\/em>. And this is where InDesign comes in \u2026<\/p>\n\n\n\n<p>You can download Kirby via <a href=\"https:\/\/getkirby.com\/\">https:\/\/getkirby.com\/<\/a> (One license currently costs 99 Euro.)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Configure Kirby<\/h4>\n\n\n\n<p>To connect to InDesign, Kirby 3 has a built in REST API: <em>\u00bbIt offers full access to your site, pages, files, users and more.\u00ab<\/em> Every API request requires authentication. Kirby offer session-based authentication or HTTP Basic auth.<\/p>\n\n\n\n<p>\u00bbBasic auth\u00ab has to be activated in the configuration file:<\/p>\n\n\n\n<p>\/site\/config\/config.php<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\nreturn [\n    'api' =&gt; [\n        'basicAuth' =&gt; true\n    ]\n];<\/pre>\n\n\n\n<p>When \u00bbBasic auth\u00ab is activated, you must send an authorization header with every request.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step: Fetch data in InDesign<\/h4>\n\n\n\n<p>Via doScript and for example cURL the data can be fetched from Kirby in InDesign. Here is an example:<\/p>\n\n\n\n<h6>cURL command for API data:<\/h6>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\">var  _curlCommand = \"curl -X GET 'https:\/\/www.rolanddreger.net\n\/apollo\/api\/pages\/list\/children?select=id,num,title,url,content' \n-u yourUserName:yourPasswort -H 'Host: www.rolanddreger.net'\";<\/pre>\n\n\n\n<p><strong>API-URL:<\/strong> https:\/\/www.rolanddreger.net\/apollo\/api<br><strong> Endpoint:<\/strong> pages<br><strong> Page ID:<\/strong> list<br><strong> Query:<\/strong> children<br> <strong>Parameters:<\/strong> ?select=id,num,title,url,content<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">URL for the XML file:<\/h6>\n\n\n\n<p>In this example, an XML representation of all article pages (children of list page) will be created and imported into InDesign.<\/p>\n\n\n\n<p>https:\/\/www.rolanddreger.net\/apollo\/list\/lunar-surface-operations.xml<br> \u2026<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">app.doScript<\/h6>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\">var _apiRequestString = app.doScript('do shell script \"' +\n _curlCommand + '\"', ScriptLanguage.APPLESCRIPT_LANGUAGE);<\/pre>\n\n\n\n<p>On Vimeo you can see <a href=\"https:\/\/vimeo.com\/360116607\">some examples<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>3 steps to connecting Adobe InDesign and Kirby. Step 1: Install Kirby Kirby is a flat-file CMS. That means all content is stored in files [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":716,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,36,35,40],"tags":[],"class_list":["post-715","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-all","category-indesign","category-javascript","category-xml"],"_links":{"self":[{"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/posts\/715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":16,"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"predecessor-version":[{"id":739,"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/posts\/715\/revisions\/739"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/media\/716"}],"wp:attachment":[{"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rolanddreger.net\/de\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}