Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

education.05.blog.html 24KB

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