Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

education.05.blog.html 23KB

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