<li><p><aclass="github-button"href="https://github.com/Arstman/lektor-qiniu"data-icon="octicon-star"data-size="large"data-show-count="true"aria-label="Star lektor-qiniu on GitHub"target="_blank">Star</a></p></li>
<li>deploy your site to a folder in a qiniu bucket</li>
<li>exclude files and directories from deployment.</li>
<li>refresh your qiniu cdn.</li>
</ol>
<h2>Before Installation</h2>
<p>You may need a bucket from qiniu cloud to deploy your lektor project. Qiniu Cloud provides 10GB storage and cdn for free, that should be enough for most small projects.</p>
<p>Go to <ahref="https://portal.qiniu.com/signup?code=1hltq2pevt7bm"rel="nofollow"><code>QINIU Cloud</code></a> for more details.</p>
<p><strong>This plugin does not do anything to help you create or configure qiniu account or bucket.</strong> You will have to make it done by yourself.</p>
<h2>Installation</h2>
<p>There ways to install plugin in Lektor, the easy ways is run below command in your project.</p>
<p>for example, if you want to deploy your site to a bucket name "abcde", folder "fjhi", you will need to add a server section as below:</p>
<p>after this you should see a server shows when you push the deploy button in your Lektor Admin Dashboard.</p>
<p>but still you will need just 5 minutes to configure this plugin to make it works.</p>
<h2>Configuration</h2>
<p>After setup your target server, you need to configure the plugin to make it works.</p>
<p>Go to your project's configs folder, which should be in root directory of your project. this folder is where Lektor keep the configuration files of all plugins. If you can't find any <strong>configs</strong> folder in your project's root directory, you need create it.</p>
<p>In configs folder, create a configuration file exactly named <strong>qiniu.ini</strong>.</p>
<h4>Attention: DO NOT name the configuration file with other names, otherwise this plugin will not work properly.</h4>
<p>In this configuration file, you will need add few more sections, you can copy a sample configuration ini file from the sample_config folder, it looks like this:</p>
<p>You need to get your own Access Key and Secret Key from Qiniu Admin Dashboard, and put them in the <strong>auth</strong> section.</p>
<h4>Refresh cdn cache</h4>
<p>mostly, Qiniu provides a free(with limitations) cdn for your bucket site, after you update your bucket file, the cdn wouldn't update automatically, therefore you will need to refresh your bucket site's directory (via your site's root url), for more details you can check Qiniu's documentation.</p>
<p>fortunately, you don't need to do refresh manually, you can just set the <strong>refresh_enable</strong> to <strong>yes</strong> in your <strong>cdn</strong> section, and change the refresh_url to your site's root url. this plugin will automatically refresh your cdn site after all files are uploaded.</p>
<h4>exclusions</h4>
<p>Another function this plugin provides is exclude folders or files you want to upload during deployment.</p>
<p>To exclude files or folders, just put the name of the folders or files in the <strong>exclusions</strong> section of configuration file, separated each one with commas.</p>
<p>One special folder here is <strong>.lektor</strong>, which Lektor officially suggests that this folder should be exclude during deployment, therefore you should keep at least this one, unless you have other needs for this folder.</p>
<h3>About Lektor CMS</h3>
<p>Lektor CMS is one of my favorite static website generators, I have use this in production for several projects, you can see some of my sites as below:</p>
<p>Looks pretty good, right? Thanks for lektor, you can try this best Static CMS as well via <ahref="https://www.getlektor.com"rel="nofollow"><code>Lektor CMS Official Site</code></a></p>
Please enable JavaScript to view the <ahref="https://disqus.com/?ref_noscript"
rel="nofollow">comments powered by Disqus.</a>
</noscript>
</div>
</div>
</div>
</div>
</div>
</div>
<divclass="bottomsummary">
<divclass="container">
</div>
</div>
<footer>
<divclass="container">
<divclass="row">
<divclass="col-sm-4 icon-bar">
<ahref="https://github.com/lektor/lektor/"title="Lektor on GitHub"
><iclass="fa fa-github"></i></a>
<ahref="https://github.com/lektor/lektor/issues/"title="Report Issues for Lektor"
><iclass="fa fa-bug"></i></a>
<ahref="https://twitter.com/getlektor"title="Find Lektor on Twitter"
><iclass="fa fa-twitter"></i></a>
<ahref="https://gitter.im/lektor/lektor"title="Chat on Gitter"
><iclass="fa fa-comment"></i></a>
<ahref="https://github.com/lektor/lektor-website/tree/master/content/plugins/lektor-qiniu/contents.lr"title="View source for this page"><iclass="fa fa-code"></i></a>
</div>
<divclass="col-sm-8">
<ahref="../../license/">License & Copyright</a> •
<ahref="../../contact/">Contact</a> •
Made with <iclass="fa fa-fw fa-heart"title="Heart"><spanhidden>Heart</span></i> in Carinthia