Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

713 рядки
23KB

  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <head>
  5. <style>
  6. #header
  7. {
  8. background: #856d51;
  9. padding: 0.7em;
  10. text-align: left;
  11. }
  12. #header a
  13. {
  14. color: white;
  15. text-decoration: none;
  16. padding: 0.5em 1em 0.5em 1em;
  17. }
  18. #title
  19. {
  20. color: #433729;
  21. }
  22. html
  23. {
  24. font-family: sans-serif;
  25. }
  26. body
  27. {
  28. line-height: 1.5em;
  29. }
  30. body
  31. {
  32. background: #FAFAFA;
  33. }
  34. table
  35. {
  36. border-collapse: collapse;
  37. width: 100%;
  38. }
  39. table, th, td
  40. {
  41. border: 1px solid #aaa;
  42. padding: 0.5em;
  43. margin-top: 0.5em;
  44. margin-bottom: 0.5em;
  45. }
  46. code, pre
  47. {
  48. font-family: monospace, serif;
  49. font-size: 1em;
  50. color: #7f0a0c;
  51. background: #f5f5f5;
  52. white-space: pre-wrap;
  53. }
  54. .contents
  55. {
  56. background: #FFFFFF;
  57. width: 720px;
  58. padding: 1em;
  59. margin-top: 2em;
  60. margin-bottom: 2em;
  61. border: 1px solid #E0E0E0;
  62. text-align: left;
  63. color: #444;
  64. }
  65. #footer
  66. {
  67. text-align: center;
  68. }
  69. #lang
  70. {
  71. float: right;
  72. }
  73. </style>
  74. <title>
  75. PSKOV
  76. </title>
  77. </head>
  78. <body>
  79. <div id="header">
  80. <strong id="title">PSKOV</strong>
  81. <a href="pskov_1.0.0.html">Tool</a>
  82. <a href="education.html">Education</a>
  83. <div id="lang">
  84. <a href="../en/education.05.blog.html">EN</a>
  85. <a href="../ru/education.05.blog.html">RU</a>
  86. </div>
  87. </div>
  88. <center><h1>
  89. Education: 05. Blog
  90. </h1></center>
  91. <center><div class="contents">
  92. <table>
  93. <thead>
  94. <tr>
  95. <th>&lt; Back</th>
  96. <th>Index</th>
  97. <th>Next &gt;</th>
  98. </tr>
  99. </thead>
  100. <tbody>
  101. <tr>
  102. <td><a href="education.04.lang.html">04. Language</a></td>
  103. <td><a href="education.html">Education</a></td>
  104. <td>Not available</td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <p></div><div class="contents"></p>
  109. <p>In this document we create "dynamic" pages for a blog.</p>
  110. <p>Estimated completion time: 20 minutes.</p>
  111. <p><strong>Table of contents</strong></p>
  112. <ul>
  113. <li><a href="#blog">01. Blog</a></li>
  114. <li><a href="#cfg">02. Investigate <code>pskov.cfg</code> file</a></li>
  115. <li><a href="#item">03. Investigate item templates of the blog</a></li>
  116. <li><a href="#preview">04. Investigate preview templates</a></li>
  117. <li><a href="#index">05. Investigate templates of preview pages</a></li>
  118. <li><a href="#pagination">06. Investigate pagination templates</a></li>
  119. <li><a href="#md">07. Investigate Markdown files</a></li>
  120. <li><a href="#gen">08. Launch LFSA and generate the site</a></li>
  121. <li><a href="#summary">09. Summary</a></li>
  122. </ul>
  123. <p><a name="blog"/></p>
  124. <h2 id="01blog">01. Blog</h2>
  125. <p>So, you have your web site in both English and Russian. You start to feel the need to regularly share your thoughts with the world as blog posts.</p>
  126. <p>You set on to create the following <a href="https://github.com/OGStudio/site-pskov-sample/tree/master/03.Blog">directory structure</a>:</p>
  127. <ul>
  128. <li><code>pskov.cfg</code></li>
  129. <li><code>en/blog/</code><ul>
  130. <li><code>item.template</code></li>
  131. <li><code>index.template</code></li>
  132. <li><code>preview.template</code></li>
  133. <li><code>pagination.template</code></li>
  134. <li><code>pagination.prev.template</code></li>
  135. <li><code>pagination.next.template</code></li>
  136. <li><code>1885.md</code></li>
  137. <li><code>1886.01.md</code></li>
  138. <li><code>1886.02.md</code></li>
  139. <li><code>1887.01.md</code></li>
  140. <li><code>1887.02.md</code></li>
  141. <li><code>1888.md</code></li>
  142. <li><code>1896.md</code></li>
  143. <li><code>1899.md</code></li></ul></li>
  144. <li><code>en/page/</code><ul>
  145. <li><code>item.template</code></li>
  146. <li><code>about.md</code></li>
  147. <li><code>cv.md</code></li></ul></li>
  148. <li><code>ru/blog/</code><ul>
  149. <li><code>item.template</code></li>
  150. <li><code>index.template</code></li>
  151. <li><code>preview.template</code></li>
  152. <li><code>pagination.template</code></li>
  153. <li><code>pagination.prev.template</code></li>
  154. <li><code>pagination.next.template</code></li>
  155. <li><code>1885.md</code></li>
  156. <li><code>1886.01.md</code></li>
  157. <li><code>1886.02.md</code></li>
  158. <li><code>1887.01.md</code></li>
  159. <li><code>1887.02.md</code></li>
  160. <li><code>1888.md</code></li>
  161. <li><code>1896.md</code></li>
  162. <li><code>1899.md</code></li></ul></li>
  163. <li><code>ru/page/</code><ul>
  164. <li><code>item.template</code></li>
  165. <li><code>about.md</code></li>
  166. <li><code>cv.md</code></li></ul></li>
  167. </ul>
  168. <p>Let's look at the contents of these files closer.</p>
  169. <p><a name="cfg"/></p>
  170. <h2 id="02investigatepskovcfgfile">02. Investigate <code>pskov.cfg</code> file</h2>
  171. <p><code>pskov.cfg</code> file has the following contents:</p>
  172. <pre><code>input = en/page;ru/page;en/blog;ru/blog
  173. item = item.template
  174. preview = preview.template
  175. index = index.template
  176. paginationPrev = pagination.prev.template
  177. paginationNext = pagination.next.template
  178. paginationPrevNext = pagination.template
  179. previewSize = 200
  180. previewEnding = . . .
  181. previewsPerPage = 3
  182. previewPageBaseName = index
  183. </code></pre>
  184. <p>You already met <code>input</code> and <code>item</code> keys. Let's see into new ones:</p>
  185. <table>
  186. <thead>
  187. <tr>
  188. <th>Key</th>
  189. <th>Description</th>
  190. </tr>
  191. </thead>
  192. <tbody>
  193. <tr>
  194. <td><code>preview</code></td>
  195. <td>Points to an HTML template that is used to generate HTML preview out of the first <code>previewSize</code> (approximately) characters for each Markdown file</td>
  196. </tr>
  197. <tr>
  198. <td><code>index</code></td>
  199. <td>Points to an HTML template that is used to generate preview page to host previews</td>
  200. </tr>
  201. <tr>
  202. <td><code>paginationPrev</code></td>
  203. <td>Points to an HTML template that is used to generate pagination section to navigate backwards</td>
  204. </tr>
  205. <tr>
  206. <td><code>paginationNext</code></td>
  207. <td>Points to an HTML template that is used to generate pagination section to navigate forward</td>
  208. </tr>
  209. <tr>
  210. <td><code>paginationPrevNext</code></td>
  211. <td>Points to an HTML template that is used to generate pagination section</td>
  212. </tr>
  213. <tr>
  214. <td><code>previewSize</code></td>
  215. <td>How many characters (approximately) to take out of a Markdown file to generate a preview</td>
  216. </tr>
  217. <tr>
  218. <td><code>previewEnding</code></td>
  219. <td>String to use at the end of each preview</td>
  220. </tr>
  221. <tr>
  222. <td><code>previewsPerPage</code></td>
  223. <td>Maximum number of previews hosted by a preview page</td>
  224. </tr>
  225. <tr>
  226. <td><code>previewsPageBaseName</code></td>
  227. <td>Base file name for preview pages</td>
  228. </tr>
  229. </tbody>
  230. </table>
  231. <p>In our case:</p>
  232. <ul>
  233. <li>we restrict previews to <code>200</code> characters in size (approximately)</li>
  234. <li>we use <code>. . .</code> string at the end of each preview</li>
  235. <li>preview pages host <code>3</code> previews maximum</li>
  236. <li>preview pages are saved as <code>index.html</code>, <code>index2.html</code>, <code>index3.html</code>, etc.</li>
  237. </ul>
  238. <p><a name="item"/></p>
  239. <h2 id="03investigateitemtemplatesoftheblog">03. Investigate item templates of the blog</h2>
  240. <ul>
  241. <li><p><code>en/blog/item.template</code> contents:</p>
  242. <pre><code>- - - - Collapsed for brevity - - - -
  243. &lt;body&gt;
  244. &lt;div id="header"&gt;
  245. &lt;strong&gt;Serov&lt;/strong&gt;
  246. &lt;a href="../../en/blog/index.html"&gt;Blog&lt;/a&gt;
  247. &lt;a href="../../en/page/about.html"&gt;About me&lt;/a&gt;
  248. &lt;a href="../../en/page/cv.html"&gt;CV&lt;/a&gt;
  249. &lt;div id="lang"&gt;
  250. &lt;a href="../../en/blog/PSKOV_ITEM_URL"&gt;EN&lt;/a&gt;
  251. &lt;a href="../../ru/blog/PSKOV_ITEM_URL"&gt;RU&lt;/a&gt;
  252. &lt;/div&gt;
  253. &lt;/div&gt;
  254. &lt;center&gt;
  255. &lt;h1&gt;In the blog...&lt;/h1&gt;
  256. &lt;div class="contents"&gt;
  257. &lt;h2 class="itemTitle"&gt;
  258. &lt;a href="PSKOV_ITEM_URL"&gt;PSKOV_ITEM_TITLE&lt;/a&gt;
  259. &lt;/h2&gt;
  260. &lt;p class="itemDate"&gt;PSKOV_ITEM_DATE&lt;/p&gt;
  261. PSKOV_ITEM_CONTENTS
  262. &lt;/div&gt;
  263. &lt;div id="footer"&gt;
  264. This sample web site has been generated by &lt;a href="http://opengamestudio.org/pskov"&gt;PSKOV&lt;/a&gt;.
  265. &lt;/div&gt;
  266. &lt;/center&gt;
  267. &lt;/body&gt;
  268. - - - - Collapsed for brevity - - - -
  269. </code></pre></li>
  270. <li><p><code>ru/blog/item.template</code> contents:</p>
  271. <pre><code>- - - - Collapsed for brevity - - - -
  272. &lt;body&gt;
  273. &lt;div id="header"&gt;
  274. &lt;strong&gt;Серов&lt;/strong&gt;
  275. &lt;a href="../../ru/blog/index.html"&gt;Блог&lt;/a&gt;
  276. &lt;a href="../../ru/page/about.html"&gt;Обо мне&lt;/a&gt;
  277. &lt;a href="../../ru/page/cv.html"&gt;Резюме&lt;/a&gt;
  278. &lt;div id="lang"&gt;
  279. &lt;a href="../../en/blog/PSKOV_ITEM_URL"&gt;EN&lt;/a&gt;
  280. &lt;a href="../../ru/blog/PSKOV_ITEM_URL"&gt;RU&lt;/a&gt;
  281. &lt;/div&gt;
  282. &lt;/div&gt;
  283. &lt;center&gt;
  284. &lt;h1&gt;В блоге...&lt;/h1&gt;
  285. &lt;div class="contents"&gt;
  286. &lt;h2 class="itemTitle"&gt;
  287. &lt;a href="PSKOV_ITEM_URL"&gt;PSKOV_ITEM_TITLE&lt;/a&gt;
  288. &lt;/h2&gt;
  289. &lt;p class="itemDate"&gt;PSKOV_ITEM_DATE&lt;/p&gt;
  290. PSKOV_ITEM_CONTENTS
  291. &lt;/div&gt;
  292. &lt;div id="footer"&gt;
  293. Этот пример сайта сгенерирован &lt;a href="http://opengamestudio.org/pskov"&gt;ПСКОВОМ&lt;/a&gt;.
  294. &lt;/div&gt;
  295. &lt;/center&gt;
  296. &lt;/body&gt;
  297. - - - - Collapsed for brevity - - - -
  298. </code></pre></li>
  299. </ul>
  300. <p><strong>Note</strong>: beginning and ending were collapsed for brevity.</p>
  301. <p>As you can see, both files look similar to <code>item.template</code> files we saw <a href="education.04.lang.html">before</a>.</p>
  302. <p>The changes include:</p>
  303. <ul>
  304. <li>new URLs to reference pages in <code>page</code> directory and the first preview page in <code>blog</code> directory</li>
  305. <li>title is referenced inside <code>contents</code> section as a link pointing to a complete blog post</li>
  306. <li>date is referenced to highlight relationship among different blog posts in time</li>
  307. </ul>
  308. <p>Date reference uses new <code>PSKOV_ITEM_DATE</code> constant:</p>
  309. <table>
  310. <thead>
  311. <tr>
  312. <th>PSKOV constant</th>
  313. <th>Description</th>
  314. </tr>
  315. </thead>
  316. <tbody>
  317. <tr>
  318. <td><code>PSKOV_ITEM_DATE</code></td>
  319. <td>Value of <code>Date</code> key of the page's Markdown file</td>
  320. </tr>
  321. </tbody>
  322. </table>
  323. <p><a name="preview"/></p>
  324. <h2 id="04investigatepreviewtemplates">04. Investigate preview templates</h2>
  325. <ul>
  326. <li><p><code>en/blog/preview.template</code> contents:</p>
  327. <pre><code>&lt;div class="contents"&gt;
  328. &lt;h2 class="itemTitle"&gt;
  329. &lt;a href="PSKOV_ITEM_URL"&gt;PSKOV_ITEM_TITLE&lt;/a&gt;
  330. &lt;/h2&gt;
  331. &lt;p class="itemDate"&gt;PSKOV_ITEM_DATE&lt;/p&gt;
  332. PSKOV_PREVIEW
  333. &lt;div class="itemMore"&gt;
  334. &lt;a href="PSKOV_ITEM_URL"&gt;Continue reading&lt;/a&gt;
  335. &lt;/div&gt;
  336. &lt;/div&gt;
  337. </code></pre></li>
  338. <li><p><code>ru/blog/preview.template</code> contents:</p>
  339. <pre><code>&lt;div class="contents"&gt;
  340. &lt;h2 class="itemTitle"&gt;
  341. &lt;a href="PSKOV_ITEM_URL"&gt;PSKOV_ITEM_TITLE&lt;/a&gt;
  342. &lt;/h2&gt;
  343. &lt;p class="itemDate"&gt;PSKOV_ITEM_DATE&lt;/p&gt;
  344. PSKOV_PREVIEW
  345. &lt;div class="itemMore"&gt;
  346. &lt;a href="PSKOV_ITEM_URL"&gt;Читать дальше&lt;/a&gt;
  347. &lt;/div&gt;
  348. &lt;/div&gt;
  349. </code></pre></li>
  350. </ul>
  351. <p>Previews have no <code>&lt;head&gt;</code>, <code>&lt;body&gt;</code>, and similar full page HTML tags. Previews represent sections inserted into preview pages.</p>
  352. <p>Preview itself is referenced by <code>PSKOV_PREVIEW</code> constant:</p>
  353. <table>
  354. <thead>
  355. <tr>
  356. <th>PSKOV constant</th>
  357. <th>Description</th>
  358. </tr>
  359. </thead>
  360. <tbody>
  361. <tr>
  362. <td><code>PSKOV_PREVIEW</code></td>
  363. <td>Provides contents of a Markdown file limited by <code>previewSize</code> characters (approximately)</td>
  364. </tr>
  365. </tbody>
  366. </table>
  367. <p><a name="index"/></p>
  368. <h2 id="05investigatetemplatesofpreviewpages">05. Investigate templates of preview pages</h2>
  369. <ul>
  370. <li><p><code>en/blog/index.template</code> contents:</p>
  371. <pre><code>- - - - Collapsed for brevity - - - -
  372. &lt;body&gt;
  373. &lt;div id="header"&gt;
  374. &lt;strong&gt;Serov&lt;/strong&gt;
  375. &lt;a href="../../en/blog/index.html"&gt;Blog&lt;/a&gt;
  376. &lt;a href="../../en/page/about.html"&gt;About me&lt;/a&gt;
  377. &lt;a href="../../en/page/cv.html"&gt;CV&lt;/a&gt;
  378. &lt;div id="lang"&gt;
  379. &lt;a href="../../en/blog/PSKOV_INDEX_URL"&gt;EN&lt;/a&gt;
  380. &lt;a href="../../ru/blog/PSKOV_INDEX_URL"&gt;RU&lt;/a&gt;
  381. &lt;/div&gt;
  382. &lt;/div&gt;
  383. &lt;center&gt;
  384. &lt;h1&gt;Blog&lt;/h1&gt;
  385. PSKOV_PREVIEWS
  386. PSKOV_PAGINATION
  387. &lt;div id="footer"&gt;
  388. This sample web site has been generated by &lt;a href="http://opengamestudio.org/pskov"&gt;PSKOV&lt;/a&gt;.
  389. &lt;/div&gt;
  390. &lt;/center&gt;
  391. &lt;/body&gt;
  392. - - - - Collapsed for brevity - - - -
  393. </code></pre></li>
  394. <li><p><code>ru/blog/index.template</code> contents:</p>
  395. <pre><code>- - - - Collapsed for brevity - - - -
  396. &lt;body&gt;
  397. &lt;div id="header"&gt;
  398. &lt;strong&gt;Серов&lt;/strong&gt;
  399. &lt;a href="../../ru/blog/index.html"&gt;Блог&lt;/a&gt;
  400. &lt;a href="../../ru/page/about.html"&gt;Обо мне&lt;/a&gt;
  401. &lt;a href="../../ru/page/cv.html"&gt;Резюме&lt;/a&gt;
  402. &lt;div id="lang"&gt;
  403. &lt;a href="../../en/blog/PSKOV_INDEX_URL"&gt;EN&lt;/a&gt;
  404. &lt;a href="../../ru/blog/PSKOV_INDEX_URL"&gt;RU&lt;/a&gt;
  405. &lt;/div&gt;
  406. &lt;/div&gt;
  407. &lt;center&gt;
  408. &lt;h1&gt;Блог&lt;/h1&gt;
  409. PSKOV_PREVIEWS
  410. PSKOV_PAGINATION
  411. &lt;div id="footer"&gt;
  412. Этот пример сайта сгенерирован &lt;a href="http://opengamestudio.org/pskov"&gt;ПСКОВОМ&lt;/a&gt;.
  413. &lt;/div&gt;
  414. &lt;/center&gt;
  415. &lt;/body&gt;
  416. - - - - Collapsed for brevity - - - -
  417. </code></pre></li>
  418. </ul>
  419. <p><strong>Notes</strong>:</p>
  420. <ul>
  421. <li>beginning and ending were collapsed for brevity</li>
  422. <li><code>PSKOV_INDEX_URL</code> constant is used to provide language selection</li>
  423. </ul>
  424. <p>Here are new <strong>PSKOV</strong> constants explained:</p>
  425. <table>
  426. <thead>
  427. <tr>
  428. <th>PSKOV constant</th>
  429. <th>Description</th>
  430. </tr>
  431. </thead>
  432. <tbody>
  433. <tr>
  434. <td><code>PSKOV_INDEX_URL</code></td>
  435. <td>Provides generated preview page file name: <code>&lt;previewsPageBaseName&gt;&lt;id&gt;.html</code></td>
  436. </tr>
  437. <tr>
  438. <td><code>PSKOV_PREVIEWS</code></td>
  439. <td>Provides a set of previews</td>
  440. </tr>
  441. <tr>
  442. <td><code>PSKOV_PAGINATION</code></td>
  443. <td>Provides pagination section to navigate preview pages</td>
  444. </tr>
  445. </tbody>
  446. </table>
  447. <p><a name="pagination"/></p>
  448. <h2 id="06investigatepaginationtemplates">06. Investigate pagination templates</h2>
  449. <p>Pagination templates represent HTML sections to navigate preview pages.</p>
  450. <p>There are free pagination templates:</p>
  451. <table>
  452. <thead>
  453. <tr>
  454. <th>Pagination template</th>
  455. <th>Description</th>
  456. </tr>
  457. </thead>
  458. <tbody>
  459. <tr>
  460. <td>Previous</td>
  461. <td>A visitor can only go backwards</td>
  462. </tr>
  463. <tr>
  464. <td>Next</td>
  465. <td>A visitor can only go forward</td>
  466. </tr>
  467. <tr>
  468. <td>Both</td>
  469. <td>A visitor can either go backwards, or forward</td>
  470. </tr>
  471. </tbody>
  472. </table>
  473. <p>Let's look at English pagination templates:</p>
  474. <ul>
  475. <li><p><code>en/blog/pagination.prev.template</code> contents:</p>
  476. <pre><code>&lt;p&gt;Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT&lt;/p&gt;
  477. &lt;p&gt;
  478. &lt;a href="PSKOV_PREV_PAGE_URL"&gt;« Newer&lt;/a&gt;
  479. &lt;/p&gt;
  480. </code></pre></li>
  481. <li><p><code>en/blog/pagination.next.template</code> contents:</p>
  482. <pre><code>&lt;p&gt;Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT&lt;/p&gt;
  483. &lt;p&gt;
  484. &lt;a href="PSKOV_NEXT_PAGE_URL"&gt;Older »&lt;/a&gt;
  485. &lt;/p&gt;
  486. </code></pre></li>
  487. <li><p><code>en/blog/pagination.template</code> contents:</p>
  488. <pre><code>&lt;p&gt;Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT&lt;/p&gt;
  489. &lt;p&gt;
  490. &lt;a href="PSKOV_PREV_PAGE_URL"&gt;« Newer&lt;/a&gt;
  491. &lt;a href="PSKOV_NEXT_PAGE_URL"&gt;Older »&lt;/a&gt;
  492. &lt;/p&gt;
  493. </code></pre></li>
  494. </ul>
  495. <p>Russian counterparts look similar. Here's <code>ru/blog/pagination.template</code> contents:</p>
  496. <pre><code>&lt;p&gt;Страница PSKOV_PAGE_ID из PSKOV_PAGES_COUNT&lt;/p&gt;
  497. &lt;p&gt;
  498. &lt;a href="PSKOV_PREV_PAGE_URL"&gt;« Новее&lt;/a&gt;
  499. &lt;a href="PSKOV_NEXT_PAGE_URL"&gt;Старее »&lt;/a&gt;
  500. &lt;/p&gt;
  501. </code></pre>
  502. <p>Here are new <strong>PSKOV</strong> constants we used:</p>
  503. <table>
  504. <thead>
  505. <tr>
  506. <th>PSKOV constant</th>
  507. <th>Description</th>
  508. </tr>
  509. </thead>
  510. <tbody>
  511. <tr>
  512. <td><code>PSKOV_PAGE_ID</code></td>
  513. <td>Provides preview page id starting from <code>1</code></td>
  514. </tr>
  515. <tr>
  516. <td><code>PSKOV_PAGES_COUNT</code></td>
  517. <td>Provides total number of generated preview pages</td>
  518. </tr>
  519. <tr>
  520. <td><code>PSKOV_PREV_PAGE_URL</code></td>
  521. <td>Provides previous preview page file name</td>
  522. </tr>
  523. <tr>
  524. <td><code>PSKOV_NEXT_PAGE_URL</code></td>
  525. <td>Provides next preview page file name</td>
  526. </tr>
  527. </tbody>
  528. </table>
  529. <p><a name="md"/></p>
  530. <h2 id="07investigatemarkdownfiles">07. Investigate Markdown files</h2>
  531. <p>Markdown files represent blog posts and they look almost like Markdown files for pages. Here's <code>en/blog/1885.md</code> contents:</p>
  532. <pre><code> Title: Bullocks
  533. Date: 1885
  534. Slug: 1885.01.bullocks
  535. ![Bullocks][bullocks]
  536. I've been painting "Bullocks" sketch while I was staying in Odessa at Kuznetsov's in 1885.
  537. [bullocks]: https://upload.wikimedia.org/wikipedia/commons/c/cb/Walentin_Aleksandrovich_Serov_Bullocks.jpg
  538. </code></pre>
  539. <p>Date is used to sort blog posts by date in descending order:</p>
  540. <table>
  541. <thead>
  542. <tr>
  543. <th>Header key</th>
  544. <th>Description</th>
  545. </tr>
  546. </thead>
  547. <tbody>
  548. <tr>
  549. <td><code>Date</code></td>
  550. <td>Provides value for <code>PSKOV_ITEM_DATE</code> constant when generating HTML out of Markdown</td>
  551. </tr>
  552. </tbody>
  553. </table>
  554. <p><a name="gen"/></p>
  555. <h2 id="08launchlfsaandgeneratethesite">08. Launch LFSA and generate the site</h2>
  556. <p>Launch <a href="http://opengamestudio.org/lfsa">LFSA</a> so that it points to directory with the files we just observed:</p>
  557. <pre><code>$ /path/to/lfsa_1.0.0.py /path/to/dir/03.Blog
  558. </code></pre>
  559. <p>Generate the site:</p>
  560. <ul>
  561. <li>Go to <a href="http://opengamestudio.org/pskov">Tool</a> page</li>
  562. <li>Press <code>Generate</code> button</li>
  563. <li>Open generated <code>en/blog/index.html</code> or <code>ru/blog/index.html</code> from the site's directory locally</li>
  564. <li>Navigate preview pages to make sure everything works fine</li>
  565. </ul>
  566. <p><a name="summary"/></p>
  567. <h2 id="09summary">09. Summary</h2>
  568. <p>You have successfully generated a web site with "dynamic" blog posts. <a href="http://opengamestudio.org/pskov/sample/03.Blog/en/blog/index.html">Check out the result</a>.</p>
  569. <p>Introduced PSKOV constants include:</p>
  570. <table>
  571. <thead>
  572. <tr>
  573. <th>PSKOV constant</th>
  574. <th>Description</th>
  575. </tr>
  576. </thead>
  577. <tbody>
  578. <tr>
  579. <td><code>PSKOV_ITEM_DATE</code></td>
  580. <td>Value of <code>Date</code> key of the page's Markdown file</td>
  581. </tr>
  582. <tr>
  583. <td><code>PSKOV_PREVIEW</code></td>
  584. <td>Provides contents of a Markdown file limited by <code>previewSize</code> characters (approximately)</td>
  585. </tr>
  586. <tr>
  587. <td><code>PSKOV_INDEX_URL</code></td>
  588. <td>Provides generated preview page file name: <code>&lt;previewsPageBaseName&gt;&lt;id&gt;.html</code></td>
  589. </tr>
  590. <tr>
  591. <td><code>PSKOV_PREVIEWS</code></td>
  592. <td>Provides a set of previews</td>
  593. </tr>
  594. <tr>
  595. <td><code>PSKOV_PAGINATION</code></td>
  596. <td>Provides pagination section to navigate preview pages</td>
  597. </tr>
  598. <tr>
  599. <td><code>PSKOV_PAGE_ID</code></td>
  600. <td>Provides preview page id starting from <code>1</code></td>
  601. </tr>
  602. <tr>
  603. <td><code>PSKOV_PAGES_COUNT</code></td>
  604. <td>Provides total number of generated preview pages</td>
  605. </tr>
  606. <tr>
  607. <td><code>PSKOV_PREV_PAGE_URL</code></td>
  608. <td>Provides previous preview page file name</td>
  609. </tr>
  610. <tr>
  611. <td><code>PSKOV_NEXT_PAGE_URL</code></td>
  612. <td>Provides next preview page file name</td>
  613. </tr>
  614. </tbody>
  615. </table>
  616. <p>Introduced configuration keys include:</p>
  617. <table>
  618. <thead>
  619. <tr>
  620. <th>Key</th>
  621. <th>Description</th>
  622. </tr>
  623. </thead>
  624. <tbody>
  625. <tr>
  626. <td><code>preview</code></td>
  627. <td>Points to an HTML template that is used to generate HTML preview out of the first <code>previewSize</code> (approximately) characters for each Markdown file</td>
  628. </tr>
  629. <tr>
  630. <td><code>index</code></td>
  631. <td>Points to an HTML template that is used to generate preview page to host previews</td>
  632. </tr>
  633. <tr>
  634. <td><code>paginationPrev</code></td>
  635. <td>Points to an HTML template that is used to generate pagination section to navigate backwards</td>
  636. </tr>
  637. <tr>
  638. <td><code>paginationNext</code></td>
  639. <td>Points to an HTML template that is used to generate pagination section to navigate forward</td>
  640. </tr>
  641. <tr>
  642. <td><code>paginationPrevNext</code></td>
  643. <td>Points to an HTML template that is used to generate pagination section</td>
  644. </tr>
  645. <tr>
  646. <td><code>previewSize</code></td>
  647. <td>How many characters (approximately) to take out of a Markdown file to generate a preview</td>
  648. </tr>
  649. <tr>
  650. <td><code>previewEnding</code></td>
  651. <td>String to use at the end of each preview</td>
  652. </tr>
  653. <tr>
  654. <td><code>previewsPerPage</code></td>
  655. <td>Maximum number of previews hosted by a preview page</td>
  656. </tr>
  657. <tr>
  658. <td><code>previewsPageBaseName</code></td>
  659. <td>Base file name for preview pages</td>
  660. </tr>
  661. </tbody>
  662. </table>
  663. <p>Introduced header keys include:</p>
  664. <table>
  665. <thead>
  666. <tr>
  667. <th>Header key</th>
  668. <th>Description</th>
  669. </tr>
  670. </thead>
  671. <tbody>
  672. <tr>
  673. <td><code>Date</code></td>
  674. <td>Provides value for <code>PSKOV_ITEM_DATE</code> constant when generating HTML out of Markdown</td>
  675. </tr>
  676. </tbody>
  677. </table>
  678. <p>This was the final document to make you proficient in generating static sites with <strong>PSKOV</strong>. If you like what we do, join us at <a href="https://vk.com/opengamestudo">VK</a>, <a href="https://twitter.com/OpenGameStudio">Twitter</a>, or <a href="https://www.facebook.com/groups/162611230470183">Facebook</a>.</p>
  679. <p>Now use <strong>PSKOV</strong> to generate your very own web site!</p>
  680. <p></div><div class="contents"></p>
  681. <table>
  682. <thead>
  683. <tr>
  684. <th>&lt; Back</th>
  685. <th>Index</th>
  686. <th>Next &gt;</th>
  687. </tr>
  688. </thead>
  689. <tbody>
  690. <tr>
  691. <td><a href="education.04.lang.html">04. Language</a></td>
  692. <td><a href="education.html">Education</a></td>
  693. <td>Not available</td>
  694. </tr>
  695. </tbody>
  696. </table>
  697. </div></center>
  698. <div id="footer">
  699. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  700. from <a href="http://github.com/ogstudio/site-pskov">this source code</a>.
  701. The site is hosted by <a href="https://pages.github.com">GitHub Pages</a>.
  702. </div>
  703. <script type="text/javascript">
  704. </script>
  705. </body>
  706. </html>