No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

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