diff --git a/lfsa/en/index.html b/lfsa/en/index.html new file mode 100644 index 0000000..d10c83e --- /dev/null +++ b/lfsa/en/index.html @@ -0,0 +1,134 @@ + + + + + + + Local File System Access (LFSA) for Client Side Web Apps (CSWA) + + + + +

+

+
+

Overview

+

Local File System Access (LFSA) is:

+ +

CSWA

+

Client Side Web Apps run solely on your device, they are not related to cloud solutions in any way: nobody can pull the plug on you. +CSWAs use LFSA to keep data at your hard drive, so you have complete control of your data.

+

PSKOV static site generator is the first CSWA to use LFSA.

+

Install

+

If you use Linux or macOS released after 2005 (yes, 2005), you only need to download lfsa-201905.py.

+

If you use Windows 2000 or newer (excluding Windows ME), you need to:

+ +

Run

+

If you use Linux or macOS, run LFSA in Terminal this way:

+
/path/to/lfsa-201905.py /path/to/dir
+
+

Here's how it looks like on macOS Mojave:

+

LFSA on macOS Mojave

+

If you use Windows, run LFSA in CMD this way:

+
C:/path/to/Python/installation/python.exe C:/path/to/lfsa-201905.py C:/path/to/dir
+
+

Here's how it looks like on Windows 2000:

+

LFSA on Windows 2000

+

Durability

+

As you noticed, LFSA can run on really old operating systems dating back to 2000. That's intentional: we care about users, so we want to cover as many users as possible.

+
+ + + + + diff --git a/lfsa/en/index.md b/lfsa/en/index.md new file mode 100644 index 0000000..14edc6b --- /dev/null +++ b/lfsa/en/index.md @@ -0,0 +1,62 @@ +Title: Index +Date: 2019-05-30 00:00 +Category: Page +Slug: index +Lang: en + +## Overview + +Local File System Access (LFSA) is: + +* a tiny web server to allow client side JS access to local file system +* a buildling block for Client Side Web Apps (CSWA) +* a single Python file + +## CSWA + +Client Side Web Apps run solely on your device, they are not related to cloud solutions in any way: nobody can pull the plug on you. +CSWAs use LFSA to keep data at your hard drive, so you have complete control of your data. + +[PSKOV][pskov] static site generator is the first CSWA to use LFSA. + +## Install + +If you use Linux or macOS released after 2005 (yes, 2005), you only need to [download lfsa-201905.py][lfsa-local]. + +If you use Windows 2000 or newer (excluding Windows ME), you need to: + +* [download][python] and install Python 2.3 or newer +* [download lfsa-201905.py][lfsa-local] + +## Run + +If you use Linux or macOS, run LFSA in Terminal this way: + +``` +/path/to/lfsa-201905.py /path/to/dir +``` + +Here's how it looks like on macOS Mojave: + +![LFSA on macOS Mojave][lfsa-on-macos] + +If you use Windows, run LFSA in [CMD][cmd] this way: + +``` +C:/path/to/Python/installation/python.exe C:/path/to/lfsa-201905.py C:/path/to/dir +``` + +Here's how it looks like on Windows 2000: + +![LFSA on Windows 2000][lfsa-on-windows] + +## Durability + +As you noticed, LFSA can run on really old operating systems dating back to 2000. That's intentional: we care about users, so we want to cover as many users as possible. + +[pskov]: http://opengamestudio.org/pskov +[lfsa-local]: ../lfsa-201905.py +[python]: https://www.python.org/downloads/windows/ +[cmd]: https://en.wikipedia.org/wiki/Cmd.exe +[lfsa-on-macos]: ../img/lfsa-on-macos.png +[lfsa-on-windows]: ../img/lfsa-on-windows.png diff --git a/pskov/en/index.html b/lfsa/en/item.template similarity index 70% rename from pskov/en/index.html rename to lfsa/en/item.template index 8acae97..2e38774 100644 --- a/pskov/en/index.html +++ b/lfsa/en/item.template @@ -5,11 +5,10 @@ - PSKOV - Opensource Game Studio static site generator + Local File System Access (LFSA) for Client Side Web Apps (CSWA)

-Tool

-

PSKOV is a static site generator that runs in your web browser. What you see now has also been generated with PSKOV. If you're new to PSKOV, visit education page.

- +PSKOV_ITEM_CONTENTS
+ diff --git a/lfsa/img/lfsa-on-macos.png b/lfsa/img/lfsa-on-macos.png new file mode 100644 index 0000000..e08e2c9 Binary files /dev/null and b/lfsa/img/lfsa-on-macos.png differ diff --git a/lfsa/img/lfsa-on-windows.png b/lfsa/img/lfsa-on-windows.png new file mode 100644 index 0000000..1132166 Binary files /dev/null and b/lfsa/img/lfsa-on-windows.png differ diff --git a/lfsa/index.html b/lfsa/index.html new file mode 100644 index 0000000..5c2e90b --- /dev/null +++ b/lfsa/index.html @@ -0,0 +1,4 @@ + + + + diff --git a/lfsa/ru/index.html b/lfsa/ru/index.html new file mode 100644 index 0000000..b0cf206 --- /dev/null +++ b/lfsa/ru/index.html @@ -0,0 +1,134 @@ + + + + + + + К Локальной Файловой Системе Доступн (ЛФСД, LFSA) для Сетевых Приложений на Стороне Клиента (СПСК, CSWA) + + + + +

+

+
+

Обзор

+

К Локальной Файловой Системе Доступ (ЛФСД, LFSA) является:

+ +

СПСК

+

Сетевые Приложения на Стороне Клиента выполняются исключительно на вашем устройстве, они никак не связаны с облачными решениями: никто не сможет их отключить. +СПСК используют ЛФСД для хранения данных на вашем жёстком диске, поэтому вы полностью владеете своими данными.

+

ПСКОВ (генератор статических сайтов) является первым СПСК, использующим ЛФСД.

+

Установка

+

Если вы используете Linux или macOS, выпущенные после 2005-го (да, 2005-го), вам необходимо просто загрузить lfsa-201905.py.

+

Если вы используете Windows 2000 или новее (за исключением Windows ME), вам необходимо:

+ +

Запуск

+

Если вы используете Linux или macOS, запускайте ЛФСД в Терминале следующим образом:

+
/путь/до/lfsa-201905.py /путь/до/директории
+
+

Вот как это выглядит на macOS Mojave:

+

ЛФСД на macOS Mojave

+

Если вы используете Windows, запускайте ЛФСД в CMD следующим образом:

+
C:/путь/до/установки/Python/python.exe C:/путь/до/lfsa-201905.py C:/путь/до/директории
+
+

Вот как это выглядит на Windows 2000:

+

ЛФСД на Windows 2000

+

Долговечность

+

Как вы заметили, ЛФСД может работать на действительно старых операционных системах, родом из 2000-х. Это осознанный выбор: мы заботимся о пользователях, поэтому хотим предоставить наш инструмент как можно большему числу пользователей.

+
+ + + + + diff --git a/lfsa/ru/index.md b/lfsa/ru/index.md new file mode 100644 index 0000000..1dd77fb --- /dev/null +++ b/lfsa/ru/index.md @@ -0,0 +1,63 @@ +Title: Начальная +Date: 2019-05-30 00:00 +Category: Page +Slug: index +Lang: ru + +## Обзор + +К Локальной Файловой Системе Доступ (ЛФСД, LFSA) является: + +* крошечным веб-сервером для доступа клиентских приложений JS к локальной файловой системе +* кирпичиком фундамента Сетевых Приложений на Стороне Клиента (СПСК, CSWA) +* файлом Python + +## СПСК + +Сетевые Приложения на Стороне Клиента выполняются исключительно на вашем устройстве, они никак не связаны с облачными решениями: никто не сможет их отключить. +СПСК используют ЛФСД для хранения данных на вашем жёстком диске, поэтому вы полностью владеете своими данными. + +[ПСКОВ][pskov] (генератор статических сайтов) является первым СПСК, использующим ЛФСД. + +## Установка + +Если вы используете Linux или macOS, выпущенные после 2005-го (да, 2005-го), вам необходимо просто [загрузить lfsa-201905.py][lfsa-local]. + +Если вы используете Windows 2000 или новее (за исключением Windows ME), вам необходимо: + +* [загрузить][python] и установить Python 2.3 либо новее +* [загрузить lfsa-201905.py][lfsa-local] + +## Запуск + + +Если вы используете Linux или macOS, запускайте ЛФСД в Терминале следующим образом: + +``` +/путь/до/lfsa-201905.py /путь/до/директории +``` + +Вот как это выглядит на macOS Mojave: + +![ЛФСД на macOS Mojave][lfsa-on-macos] + +Если вы используете Windows, запускайте ЛФСД в [CMD][cmd] следующим образом: + +``` +C:/путь/до/установки/Python/python.exe C:/путь/до/lfsa-201905.py C:/путь/до/директории +``` + +Вот как это выглядит на Windows 2000: + +![ЛФСД на Windows 2000][lfsa-on-windows] + +## Долговечность + +Как вы заметили, ЛФСД может работать на действительно старых операционных системах, родом из 2000-х. Это осознанный выбор: мы заботимся о пользователях, поэтому хотим предоставить наш инструмент как можно большему числу пользователей. + +[pskov]: http://opengamestudio.org/pskov +[lfsa-local]: ../lfsa-201905.py +[python]: https://www.python.org/downloads/windows/ +[cmd]: https://ru.wikipedia.org/wiki/Cmd.exe +[lfsa-on-macos]: ../img/lfsa-on-macos.png +[lfsa-on-windows]: ../img/lfsa-on-windows.png diff --git a/lfsa/ru/item.template b/lfsa/ru/item.template new file mode 100644 index 0000000..f10118d --- /dev/null +++ b/lfsa/ru/item.template @@ -0,0 +1,104 @@ + + + + + + + К Локальной Файловой Системе Доступн (ЛФСД, LFSA) для Сетевых Приложений на Стороне Клиента (СПСК, CSWA) + + + + +

+

+
+PSKOV_ITEM_CONTENTS +
+ + + + + diff --git a/pskov/en/education.01.why.html b/pskov/en/education.01.why.html index b1af94b..5a176c6 100644 --- a/pskov/en/education.01.why.html +++ b/pskov/en/education.01.why.html @@ -20,11 +20,6 @@ { color: #433729; } - iframe - { - width: 720px; - height: 720px; - } html { font-family: sans-serif; @@ -71,13 +66,13 @@ } - PSKOV - Opensource Game Studio static site generator + PSKOV-201905

diff --git a/pskov/en/education.01.why.md b/pskov/en/education.01.why.md new file mode 100644 index 0000000..540bffa --- /dev/null +++ b/pskov/en/education.01.why.md @@ -0,0 +1,65 @@ +Title: Education: 01. Why +Date: 2019-05-14 00:00 +Category: Page +Slug: education.01.why +Lang: en + +| < Back | Index | Next > | +|---|---|---| +| Not available | [Education][index] | [02. Dependencies][next] | + +
+ +In this document we briefly explain why **PSKOV** was created. + +Estimated completion time: 5 minutes. + +**Table of contents** + +* [01. Why](#why) +* [02. Features](#features) + + + +## 01. Why + +You might know there already exist quite a lot of [static site generators][other-generators], why create another one? Because **they are not good enough** for [Opensource Game Studio][ogs] needs. + +Here's a list of **features we don't need**: + +| № | Unwelcome feature | Note | +|---|---|---| +| 1 | Learning anything beyond HTML, CSS, JavaScript, and Markdown | These technologies are enough to deliver information to users | +| 2 | Server side | Nobody should be able to pull the plug on you except yourself | +| 3 | Installation | We had enough updates that were never requested | +| 4 | Comprehensible source code | Single file with just enough number of lines | + + + +## 02. Features + +Consequently, here is a list of **PSKOV features**: + +| № | PSKOV feature | Note | +|---|---|---| +| 1 | Bare HTML, CSS, JavaScript, and Markdown | No need for template language, web framework or anything else | +| 2 | Client side | **PSKOV** is a client side JavaScript application, it runs solely on your device | +| 3 | Optional installation | **PSKOV** is available at [http://opengamestudio.org/pskov][pskov]. However, if you want to keep **PSKOV** locally, you can get **PSKOV** single HTML file [here][pskov-src] and open it locally | +| 4 | Comprehensible source code | **PSKOV** is a [single HTML file][pskov-src] with less than 10000 lines of code | +| 5 | Decades long support (DLS) | You can use **PSKOV** on both Windows 2000 and Windows 2030\* | + +\* Windows 2030 does not (yet) exist, we simply refer to the fact that **PSKOV** is designed to work for operating systems released in the range of years 2000-2030 + +

-

In this document we teach how to install PSKOV dependencies.

-

Estimated completion time: ?? minutes.

+

In this document we describe PSKOV dependencies and how to get them.

+

Estimated completion time: 5 minutes.

Table of contents

01. Dependencies

-

We designed PSKOV to run inside web browsers. Hence, here is a list of PSKOV dependencies:

+

We designed PSKOV to run inside web browsers. Here is what you need to run PSKOV:

- - + + @@ -128,18 +122,27 @@ Education: 02. Dependencies - - + +
DependencyNotePSKOV dependencyNotes
2Local file system access (LFSA)LFSA gives PSKOV access to your local file systemLocal file system accessLFSA gives PSKOV access to your local file system. Install LFSA to be able to use PSKOV.
-

Since PSKOV is a client side JavaScript application, it has no direct access to your local file system to generate files. That's why we have also created LFSA, a tiny Python server to provide read/write access to your local file system at 8000 port. LFSA is under 200 lines of code, feel free to inspect it to make sure we don't steal your data.

-

-

02. Install LFSA

-

TODO

-

-

03. Showdown

-

Tell Showdown.JS is used to convert Markdown to HTML, so users should refer to Showdown.JS for rules.

+

Note: install LFSA to be able to use PSKOV.

+

+

02. Details

+

PSKOV:

+
+

LFSA:

+
    +
  • is a tiny Python server to provide read/write access to local file system
  • +
  • runs at 8000 port
  • +
  • is under 200 lines of code, feel free to inspect it
  • +

diff --git a/pskov/en/education.02.deps.md b/pskov/en/education.02.deps.md new file mode 100644 index 0000000..9b1ab41 --- /dev/null +++ b/pskov/en/education.02.deps.md @@ -0,0 +1,64 @@ +Title: Education: 02. Dependencies +Date: 2019-05-14 00:00 +Category: Page +Slug: education.02.deps +Lang: en + +| < Back | Index | Next > | +|---|---|---| +| [01. Why][prev] | [Education][index] | [03. Site][next] | + +

In this document we create a simple static web site with two pages.

-

Estimated completion time: ? minutes.

+

Estimated completion time: 10 minutes.

Table of contents

01. Inspiration

@@ -124,7 +120,7 @@ Education: 03. Site
  • cfg
  • item.template
  • -
  • index.md
  • +
  • about.md
  • cv.md

Let's look at their contents closer.

@@ -149,7 +145,7 @@ item = item.template item -Points to an HTML template file that will be used to generate HTML files out of Markdown ones +Points to an HTML template file that is used to generate HTML files out of Markdown ones @@ -162,14 +158,14 @@ item = item.template <meta charset="utf-8"> <head> <style> - - - - - Style was collapsed for brevity - - - - + - - - - Collapsed for brevity - - - - </style> <title>Serov</title> </head> <body> <div id="header"> <strong>Serov</strong> - <a href="index.html">About me</a> + <a href="about.html">About me</a> <a href="cv.html">CV</a> </div> <center> @@ -177,12 +173,15 @@ item = item.template <div class="contents"> PSKOV_ITEM_CONTENTS </div> + <div id="footer"> + This sample web site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>. + </div> </center> </body> </html>

Note: style was collapsed for brevity.

-

As you can see, item.template is an average HTML file with two constants specified:

+

As you can see, item.template is an average HTML file with two PSKOV constants specified:

@@ -207,16 +206,16 @@ PSKOV_ITEM_CONTENTS
  • page's header section is described below
  • -

    04. Investigate index.md and cv.md files

    -

    index.md file has the following contents:

    +

    04. Investigate about.md and cv.md files

    +

    about.md file has the following contents:

     Title: About me
    - Slug: index
    + Slug: about
     
      Hi, my name is Valentin Serov. Here's my self-portrait:
     
      ![Valentin Serov self-portrait][serov-portrait]
     
    - - - - - Contents were collapsed for brevity - - - -
    + - - - - Collapsed for brevity - - - -
     
      Have a look at my [CV][cv] now.
     
    @@ -228,7 +227,7 @@ PSKOV_ITEM_CONTENTS
      [pskov]: http://opengamestudio.org/pskov
      [cv]: cv.html
     
    -

    index.md starts with a so-called header section:

    +

    about.md starts with a so-called header section:

    @@ -243,11 +242,11 @@ PSKOV_ITEM_CONTENTS - +
    Slug:Tells PSKOV that this particular Markdown file should be saved under <slug>.html filenameTells PSKOV that particular Markdown file should be saved under <slug>.html filename
    -

    The rest of index.md contents is what any Markdown file looks like.

    +

    The rest of about.md contents is what any Markdown file looks like.

    Note: cv page is referenced as cv.html, not cv.md

    cv.md file has the following contents:

     Title: Curriculum vitae
    @@ -267,8 +266,8 @@ PSKOV_ITEM_CONTENTS
     

    As you can see, there's nothing new in cv.md except for a Markdown table.

    05. Launch LFSA

    -

    Launch LFSA so that it points to directory with the files we just observed:

    -
    $ /path/to/local-file-system-access.py /path/to/dir/01.TwoPages
    +

    Launch LFSA so that it points to directory with the files we just observed:

    +
    $ /path/to/lfsa-201905.py /path/to/dir/01.TwoPages
     

    You should see output similar to this:

    DIR: '/Users/kornerr/p/site-pskov-sample/01.TwoPages'
    @@ -283,10 +282,69 @@ PORT: '8000'
     
  • Path: points to the same directory you specified before
  • Input directory: and Item template: have values from cfg
  • Press Generate button to generate HTML files right where Markdown ones reside
  • -
  • Open generated index.html from the site's directory
  • +
  • Open generated about.html from the site's directory
  • You should see your web site running locally
  • -

    Take time to observe your new shiny personal web site consisting of two pages.

    +

    +

    07. Summary

    +

    You have successfully generated a web site with two pages. Check out the result.

    +

    Introduced PSKOV constants include:

    + + + + + + + + + + + + + + + + + +
    PSKOV constantDescription
    PSKOV_ITEM_TITLEProvides title from Title: part of page's header section
    PSKOV_ITEM_CONTENTSProvides HTML contents generated out of Markdown contents
    +

    Introduced configuration keys include:

    + + + + + + + + + + + + + + + + + +
    KeyDescription
    inputPoints to a directory where item's file is located
    itemPoints to an HTML template file that is used to generate HTML files out of Markdown ones
    +

    Introduced header constants include:

    + + + + + + + + + + + + + + + + + +
    Header constantDescription
    Title:Provides value for PSKOV_ITEM_TITLE constant when generating HTML out of Markdown
    Slug:Tells PSKOV that particular Markdown file should be saved under <slug>.html filename

    diff --git a/pskov/en/education.03.site.md b/pskov/en/education.03.site.md new file mode 100644 index 0000000..069d708 --- /dev/null +++ b/pskov/en/education.03.site.md @@ -0,0 +1,247 @@ +Title: Education: 03. Site +Date: 2019-05-14 00:00 +Category: Page +Slug: education.03.site +Lang: en + +| < Back | Index | Next > | +|---|---|---| +| [02. Dependencies][prev] | [Education][index] | [04. Language][next] | + +
    + +In this document we create a simple static web site with two pages. + +Estimated completion time: 10 minutes. + +**Table of contents** + +* [01. Inspiration](#inspiration) +* [02. Investigate `cfg` file](#cfg) +* [03. Investigate `item.template` file](#item) +* [04. Investigate `about.md` and `cv.md` files](#md) +* [05. Launch LFSA](#lfsa) +* [06. Generate the site](#gen) +* [07. Summary](#summary) + + + +## 01. Inspiration + +Suppose you are a great Russian painter named Valentin Serov. Everytime anyone wants to know about you they refer to [Wikipedia][serov]. You wake up earlier today with a distinct desire to have your very own personal web site. + +You set on to create the following pages: + +* About me +* Curriculum vitae (CV) + +Some time later you have the following files in your [site directory][01-files]: + +* cfg +* item.template +* about.md +* cv.md + +Let's look at their contents closer. + + + +## 02. Investigate `cfg` file + +`cfg` file has the following contents: + +``` +input = . +item = item.template +``` + +`cfg` is an [INI file][ini-file] with the following keys specified: + +| Key | Description | +|---|---| +| `input` | Points to a directory where `item`'s file is located | +| `item` | Points to an HTML template file that is used to generate HTML files out of Markdown ones | + +In our case, `item.template` file is located alongside `cfg`, so we use `.` to denote current directory. + + + +## 03. Investigate `item.template` file + +`item.template` file has the following contents: + +``` + + + + + + Serov + + + +
    +

    PSKOV_ITEM_TITLE

    +
    +PSKOV_ITEM_CONTENTS +
    + +
    + + +``` + +**Note**: style was collapsed for brevity. + +As you can see, `item.template` is an average HTML file with two **PSKOV** constants specified: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_ITEM_TITLE` | Provides title from `Title:` part of page's header section | +| `PSKOV_ITEM_CONTENTS` | Provides HTML contents generated out of Markdown contents | + +**Notes**: + +* other **PSKOV** constants are described later +* page's header section is described below + + + +## 04. Investigate `about.md` and `cv.md` files + +`about.md` file has the following contents: + +``` + Title: About me + Slug: about + + Hi, my name is Valentin Serov. Here's my self-portrait: + + ![Valentin Serov self-portrait][serov-portrait] + + - - - - Collapsed for brevity - - - - + + Have a look at my [CV][cv] now. + + [serov]: https://en.wikipedia.org/wiki/Valentin_Serov + [revolution]: https://en.wikipedia.org/wiki/Russian_Revolution + [serov-portrait]: myself.jpg + [serov-work]: mywork.jpg + [girl-with-peaches]: https://en.wikipedia.org/wiki/Girl_with_Peaches + [pskov]: http://opengamestudio.org/pskov + [cv]: cv.html +``` + +`about.md` starts with a so-called header section: + +| Header constant | Description | +|---|---| +| `Title:` | Provides value for `PSKOV_ITEM_TITLE` constant when generating HTML out of Markdown | +| `Slug:` | Tells **PSKOV** that particular Markdown file should be saved under `.html` filename | + +The rest of `about.md` contents is what any Markdown file looks like. + +**Note**: `cv` page is referenced as `cv.html`, not `cv.md` + +`cv.md` file has the following contents: + +``` + Title: Curriculum vitae + Slug: cv + + Here's my CV in case my paintings still interest you. I took a bit of a modern IT approach to structure my CV as key-value pairs of a dictionary (map), enjoy! + + | Key | Value | + |---|---| + | Name | Valentin Serov | + | Age | 46 | + | Marital status | Married | + | Country | Russian Empire | + | Alma mater | Imperial Academy of Arts | + | Education | * Member Academy of Arts (1898)
    * Full Member Academy of Arts (1903) | +``` + +As you can see, there's nothing new in `cv.md` except for a Markdown table. + +
    + +## 05. Launch LFSA + +Launch [LFSA][lfsa] so that it points to directory with the files we just observed: + +``` +$ /path/to/lfsa-201905.py /path/to/dir/01.TwoPages +``` + +You should see output similar to this: + +``` +DIR: '/Users/kornerr/p/site-pskov-sample/01.TwoPages' +PORT: '8000' +``` + + + +## 06. Generate the site + +Now it's finally time to generate your personal web site: + +* Go to [Tool][tool] page +* Make sure + * `Path:` points to the same directory you specified before + * `Input directory:` and `Item template:` have values from `cfg` +* Press `Generate` button to generate HTML files right where Markdown ones reside +* Open generated `about.html` from the site's directory +* You should see your web site running locally + + + +## 07. Summary + +You have successfully generated a web site with two pages. [Check out the result][01-sample]. + +Introduced PSKOV constants include: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_ITEM_TITLE` | Provides title from `Title:` part of page's header section | +| `PSKOV_ITEM_CONTENTS` | Provides HTML contents generated out of Markdown contents | + +Introduced configuration keys include: + +| Key | Description | +|---|---| +| `input` | Points to a directory where `item`'s file is located | +| `item` | Points to an HTML template file that is used to generate HTML files out of Markdown ones | + +Introduced header constants include: + +| Header constant | Description | +|---|---| +| `Title:` | Provides value for `PSKOV_ITEM_TITLE` constant when generating HTML out of Markdown | +| `Slug:` | Tells **PSKOV** that particular Markdown file should be saved under `.html` filename | + +

    In this document we add language selection.

    -

    Estimated completion time: ? minutes.

    +

    Estimated completion time: 10 minutes.

    Table of contents

    01. Localization

    @@ -118,10 +114,10 @@ Education: 04. Language
    • cfg
    • en/item.template
    • -
    • en/index.md
    • +
    • en/about.md
    • en/cv.md
    • ru/item.template
    • -
    • ru/index.md
    • +
    • ru/about.md
    • ru/cv.md

    Let's look at the contents of these files closer.

    @@ -143,7 +139,7 @@ item = item.template <body> <div id="header"> <strong>Serov</strong> - <a href="index.html">About me</a> + <a href="about.html">About me</a> <a href="cv.html">CV</a> <div id="lang"> <a href="../en/PSKOV_ITEM_URL">EN</a> @@ -160,7 +156,7 @@ item = item.template <body> <div id="header"> <strong>Серов</strong> - <a href="index.html">Обо мне</a> + <a href="about.html">Обо мне</a> <a href="cv.html">Резюме</a> <div id="lang"> <a href="../en/PSKOV_ITEM_URL">EN</a> @@ -189,14 +185,14 @@ item = item.template PSKOV_ITEM_URL -Provides <slug>.html value for the page +Provides generated page's file name: <slug>.html

    As you see, PSKOV_ITEM_URL is all you need to have your page in as many languages as you please.

    04. Investigate Markdown files

    -

    en/index.md and en/cv.md files look exactly as before. ru/index.md and ru/cv.md are simply Russian variants of the same pages.

    +

    en/about.md and en/cv.md files look almost exactly as before. ru/about.md and ru/cv.md are simply Russian variants of the same pages.

    For example, ru/cv.md has the following contents:

     Title: Резюме
      Slug: cv
    @@ -215,17 +211,34 @@ item = item.template
     

    Note: Russian page has exactly the same Slug: value as English one.

    05. Launch LFSA and generate the site

    -

    Launch LFSA so that it points to directory with the files we just observed:

    -
    $ /path/to/local-file-system-access.py /path/to/dir/02.Language
    +

    Launch LFSA so that it points to directory with the files we just observed:

    +
    $ /path/to/lfsa-201905.py /path/to/dir/02.Language
     

    Generate the site:

    • Go to Tool page
    • Press Generate button
    • -
    • Open generated en/index.html or ru/index.html from the site's directory locally
    • +
    • Open generated en/about.html or ru/about.html from the site's directory locally
    • Switch language to verify language selection works fine
    -

    Take time to observe just how little effort you spent to have your web site localized.

    +

    +

    06. Summary

    +

    You have successfully added language selection. Check out the result.

    +

    Introduced PSKOV constants include:

    + + + + + + + + + + + + + +
    PSKOV constantDescription
    PSKOV_ITEM_URLProvides generated page's file name: <slug>.html

    diff --git a/pskov/en/education.04.lang.md b/pskov/en/education.04.lang.md new file mode 100644 index 0000000..fd2f344 --- /dev/null +++ b/pskov/en/education.04.lang.md @@ -0,0 +1,187 @@ +Title: Education: 04. Language +Date: 2019-05-21 00:00 +Category: Page +Slug: education.04.lang +Lang: en + +| < Back | Index | Next > | +|---|---|---| +| [03. Site][prev] | [Education][index] | [05. Blog][next] | + +
    + +In this document we add language selection. + +Estimated completion time: 10 minutes. + +**Table of contents** + +* [01. Localization](#localization) +* [02. Investigate `cfg` file](#cfg) +* [03. Investigate template files](#item) +* [04. Investigate Markdown files](#md) +* [05. Launch LFSA and generate the site](#gen) +* [06. Summary](#summary) + + + +## 01. Localization + +Now that you have your web site in English you start to wonder why there's no Russian version, you're Russian after all! + +You set on to create the following [directory structure][02-files]: + +* `cfg` +* `en/item.template` +* `en/about.md` +* `en/cv.md` +* `ru/item.template` +* `ru/about.md` +* `ru/cv.md` + +Let's look at the contents of these files closer. + + + +## 02. Investigate `cfg` file + +`cfg` file has the following contents: + +``` +input = en;ru +item = item.template +``` + +As you see, `input` can accept multiple directories separated by `;` symbol: **PSKOV** will go over each directory specified and run as before. + +In this case, both `en/` and `ru/` directories have their own `item.template` file. + + + +## 03. Investigate template files + +* `en/item.template` contents: + + ``` + - - - - Collapsed for brevity - - - - + Serov + + + +
    + - - - - Collapsed for brevity - - - - + ``` +* `ru/item.template` contents: + + ``` + - - - - Collapsed for brevity - - - - + Серов + + + +
    + - - - - Collapsed for brevity - - - - + ``` + +**Note**: beginning and ending were collapsed for brevity. + +As you can see, both `en/item.template` and `ru/item.template` look similar to `item.template` we saw [before][prev]. + +The changes include: + +* use of `
    ...
    ` section to present language selection +* localization of titles into English and Russian + +Language selection uses new **PSKOV** constant: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_ITEM_URL` | Provides generated page's file name: `.html` | + +As you see, `PSKOV_ITEM_URL` is all you need to have your page in as many languages as you please. + + + +## 04. Investigate Markdown files + +`en/about.md` and `en/cv.md` files look almost exactly as [before][prev]. `ru/about.md` and `ru/cv.md` are simply Russian variants of the same pages. + +For example, `ru/cv.md` has the following contents: + +``` + Title: Резюме + Slug: cv + + Здесь вы можете увидеть моё резюме в том случае, если мои произведения всё ещё вас интересуют. Я использовал современный подход ИТ для структурирования своего резюме в виде пар ключ-значение словаря (карты). Наслаждайтесь! + + | Ключ | Значение | + |---|---| + | Имя | Валентин Серов | + | Возраст | 46 | + | Семейное положение | Женат | + | Страна | Российская Империя | + | Учёба | Императорская Академия художеств | + | Звания | * академик ИАХ (1898)
    * действительный член ИАХ (1903) | +``` + +**Note**: Russian page has exactly the same `Slug:` value as English one. + +
    + +## 05. Launch LFSA and generate the site + +Launch [LFSA][lfsa] so that it points to directory with the files we just observed: + +``` +$ /path/to/lfsa-201905.py /path/to/dir/02.Language +``` + +Generate the site: + +* Go to [Tool][tool] page +* Press `Generate` button +* Open generated `en/about.html` or `ru/about.html` from the site's directory locally +* Switch language to verify language selection works fine + + + +## 06. Summary + +You have successfully added language selection. [Check out the result][02-sample]. + +Introduced PSKOV constants include: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_ITEM_URL` | Provides generated page's file name: `.html` | + +
    + +| < Back | Index | Next > | +|---|---|---| +| [03. Site][prev] | [Education][index] | [05. Blog][next] | + +[index]: education.html +[prev]: education.03.site.html +[next]: education.05.blog.html + +[02-files]: https://github.com/OGStudio/site-pskov-sample/tree/master/02.Language +[02-sample]: http://opengamestudio.org/pskov/sample/02.Language/en/about.html +[lfsa]: http://opengamestudio.org/lfsa +[tool]: http://opengamestudio.org/pskov diff --git a/pskov/en/education.05.blog.html b/pskov/en/education.05.blog.html new file mode 100644 index 0000000..be307d0 --- /dev/null +++ b/pskov/en/education.05.blog.html @@ -0,0 +1,696 @@ + + + + + + + PSKOV-201905 + + + + +

    +Education: 05. Blog +

    +
    +
    + + + + + + + + + + + + + + +
    < BackIndexNext >
    04. LanguageEducationNot available
    +

    +

    In this document we create "dynamic" pages like blog posts.

    +

    Estimated completion time: 20 minutes.

    +

    Table of contents

    + +

    +

    01. Blog

    +

    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.

    +

    You set on to create the following directory structure:

    +
      +
    • cfg
    • +
    • en/blog/
        +
      • item.template
      • +
      • index.template
      • +
      • preview.template
      • +
      • pagination.template
      • +
      • pagination.prev.template
      • +
      • pagination.next.template
      • +
      • 1885.md
      • +
      • 1886.01.md
      • +
      • 1886.02.md
      • +
      • 1887.01.md
      • +
      • 1887.02.md
      • +
      • 1888.md
      • +
      • 1896.md
      • +
      • 1899.md
    • +
    • en/page/
        +
      • item.template
      • +
      • about.md
      • +
      • cv.md
    • +
    • ru/blog/
        +
      • item.template
      • +
      • index.template
      • +
      • preview.template
      • +
      • pagination.template
      • +
      • pagination.prev.template
      • +
      • pagination.next.template
      • +
      • 1885.md
      • +
      • 1886.01.md
      • +
      • 1886.02.md
      • +
      • 1887.01.md
      • +
      • 1887.02.md
      • +
      • 1888.md
      • +
      • 1896.md
      • +
      • 1899.md
    • +
    • ru/page/
        +
      • item.template
      • +
      • about.md
      • +
      • cv.md
    • +
    +

    Let's look at the contents of these files closer.

    +

    +

    02. Investigate cfg file

    +

    cfg file has the following contents:

    +
    input = en/page;ru/page;en/blog;ru/blog
    +item = item.template
    +preview = preview.template
    +index = index.template
    +paginationPrev = pagination.prev.template
    +paginationNext = pagination.next.template
    +paginationPrevNext = pagination.template
    +previewSize = 200
    +previewEnding = . . .
    +previewsPerPage = 3
    +previewPageBaseName = index
    +
    +

    Apart from already used input and item keys, we have quite a lot of new ones. Let's break them down:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyDescription
    previewPoints to an HTML template file that is used to generate HTML previews out of the first previewSize (approximately) characters of Markdown files
    indexPoints to an HTML template file that is used to generate HTML index (summary) files to host previews
    paginationPrevPoints to an HTML template file that is used to generate pagination section used by the last index (summary) file
    paginationNextPoints to an HTML template file that is used to generate pagination section used by the first index (summary) file
    paginationPrevNextPoints to an HTML template file that is used to generate pagination section used by index (summary) files except the ones at the beginning and at the end
    previewSizeHow many characters (approximately) to take out of a Markdown file to generate an HTML preview
    previewEndingString to use at the end of HTML previews
    previewsPerPageNumber of HTML previews hosted by single index (summary) file
    previewsPageBaseNameIndex (summary) file base name
    +

    In our case:

    +
      +
    • we restrict previews to 200 characters in size (approximately)
    • +
    • we use . . . string at the end of each preview
    • +
    • index (summary) files host 3 previews maximum
    • +
    • index (summary) files are saved as index.html, index2.html, index3.html, etc.
    • +
    +

    +

    03. Investigate item templates of the blog

    +
      +
    • en/blog/item.template contents:

      +
      - - - - Collapsed for brevity - - - -
      +<body>
      +    <div id="header">
      +        <strong>Serov</strong>
      +        <a href="../../en/blog/index.html">Blog</a>
      +        <a href="../../en/page/about.html">About me</a>
      +        <a href="../../en/page/cv.html">CV</a>
      +        <div id="lang">
      +            <a href="../../en/blog/PSKOV_ITEM_URL">EN</a>
      +            <a href="../../ru/blog/PSKOV_ITEM_URL">RU</a>
      +        </div>
      +    </div>
      +    <center>
      +        <h1>In the blog...</h1>
      +        <div class="contents">
      +            <h2 class="itemTitle">
      +                <a href="PSKOV_ITEM_URL">PSKOV_ITEM_TITLE</a>
      +            </h2>
      +            <p class="itemDate">PSKOV_ITEM_DATE</p>
      +PSKOV_ITEM_CONTENTS
      +        </div>
      +        <div id="footer">
      +            This sample web site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>.
      +        </div>
      +    </center>
      +</body>
      +- - - - Collapsed for brevity - - - -
      +
    • +
    • ru/blog/item.template contents:

      +
      - - - - Collapsed for brevity - - - -
      +<body>
      +    <div id="header">
      +        <strong>Серов</strong>
      +        <a href="../../ru/blog/index.html">Блог</a>
      +        <a href="../../ru/page/about.html">Обо мне</a>
      +        <a href="../../ru/page/cv.html">Резюме</a>
      +        <div id="lang">
      +            <a href="../../en/blog/PSKOV_ITEM_URL">EN</a>
      +            <a href="../../ru/blog/PSKOV_ITEM_URL">RU</a>
      +        </div>
      +    </div>
      +    <center>
      +        <h1>В блоге...</h1>
      +        <div class="contents">
      +            <h2 class="itemTitle">
      +                <a href="PSKOV_ITEM_URL">PSKOV_ITEM_TITLE</a>
      +            </h2>
      +            <p class="itemDate">PSKOV_ITEM_DATE</p>
      +PSKOV_ITEM_CONTENTS
      +        </div>
      +        <div id="footer">
      +            Этот пример сайта сгенерирован <a href="http://opengamestudio.org/pskov">ПСКОВОМ</a>.
      +        </div>
      +    </center>
      +</body>
      +- - - - Collapsed for brevity - - - -
      +
    • +
    +

    Note: beginning and ending were collapsed for brevity.

    +

    As you can see, both files look similar to item.template files we saw before.

    +

    The changes include:

    +
      +
    • new URLs to reference pages in page directory and first index (summary) file in blog directory
    • +
    • title is now referenced inside contents section as a link to complete page
    • +
    • date is referenced to highlight relationship among different blog posts in time
    • +
    +

    Date reference uses new PSKOV_ITEM_DATE constant:

    + + + + + + + + + + + + + +
    PSKOV constantDescription
    PSKOV_ITEM_DATEProvides date from Date: part of page's header section
    +

    +

    04. Investigate preview templates

    +
      +
    • en/blog/preview.template contents:

      +
      <div class="contents">
      +    <h2 class="itemTitle">
      +        <a href="PSKOV_ITEM_URL">PSKOV_ITEM_TITLE</a>
      +    </h2>
      +    <p class="itemDate">PSKOV_ITEM_DATE</p>
      +PSKOV_PREVIEW
      +    <div class="itemMore">
      +        <a href="PSKOV_ITEM_URL">Continue reading</a>
      +    </div>
      +</div>
      +
    • +
    • ru/blog/preview.template contents:

      +
      <div class="contents">
      +    <h2 class="itemTitle">
      +        <a href="PSKOV_ITEM_URL">PSKOV_ITEM_TITLE</a>
      +    </h2>
      +    <p class="itemDate">PSKOV_ITEM_DATE</p>
      +PSKOV_PREVIEW
      +    <div class="itemMore">
      +        <a href="PSKOV_ITEM_URL">Читать дальше</a>
      +    </div>
      +</div>
      +
    • +
    +

    Previews have no <head>, <body>, and similar full page HTML tags. Previews represent sections inserted into index (summary) files.

    +

    Preview itself is referenced by PSKOV_PREVIEW constant:

    + + + + + + + + + + + + + +
    PSKOV constantDescription
    PSKOV_PREVIEWProvides contents from a Markdown file limited by previewSize characters (approximately)
    +

    +

    05. Investigate index (summary) templates

    +
      +
    • en/blog/index.template contents:

      +
      - - - - Collapsed for brevity - - - -
      +<body>
      +    <div id="header">
      +        <strong>Serov</strong>
      +        <a href="../../en/blog/index.html">Blog</a>
      +        <a href="../../en/page/about.html">About me</a>
      +        <a href="../../en/page/cv.html">CV</a>
      +        <div id="lang">
      +            <a href="../../en/blog/PSKOV_INDEX_URL">EN</a>
      +            <a href="../../ru/blog/PSKOV_INDEX_URL">RU</a>
      +        </div>
      +    </div>
      +    <center>
      +        <h1>Blog</h1>
      +PSKOV_PREVIEWS
      +PSKOV_PAGINATION
      +        <div id="footer">
      +            This sample web site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>.
      +        </div>
      +    </center>
      +</body>
      +- - - - Collapsed for brevity - - - -
      +
    • +
    • ru/blog/index.template contents:

      +
      - - - - Collapsed for brevity - - - -
      +<body>
      +    <div id="header">
      +        <strong>Серов</strong>
      +        <a href="../../ru/blog/index.html">Блог</a>
      +        <a href="../../ru/page/about.html">Обо мне</a>
      +        <a href="../../ru/page/cv.html">Резюме</a>
      +        <div id="lang">
      +            <a href="../../en/blog/PSKOV_INDEX_URL">EN</a>
      +            <a href="../../ru/blog/PSKOV_INDEX_URL">RU</a>
      +        </div>
      +    </div>
      +    <center>
      +        <h1>Блог</h1>
      +PSKOV_PREVIEWS
      +PSKOV_PAGINATION
      +        <div id="footer">
      +            Этот пример сайта сгенерирован <a href="http://opengamestudio.org/pskov">ПСКОВОМ</a>.
      +        </div>
      +    </center>
      +</body>
      +- - - - Collapsed for brevity - - - -
      +
    • +
    +

    Notes:

    +
      +
    • beginning and ending were collapsed for brevity
    • +
    • PSKOV_INDEX_URL constant is used to provide language selection
    • +
    +

    Index (summary) files are used to host previews.

    +

    Here are new PSKOV constants explained:

    + + + + + + + + + + + + + + + + + + + + + +
    PSKOV constantDescription
    PSKOV_INDEX_URLProvides generated page's file name: <previewsPageBaseName><id>.html
    PSKOV_PREVIEWSProvides a combination of PSKOV_PREVIEW sections
    PSKOV_PAGINATIONProvides pagination section to navigate index (summary) pages
    +

    +

    06. Investigate pagination templates

    +

    Pagination templates represent sections used to navigate index (summary) pages.

    +

    There are free pagination templates:

    + + + + + + + + + + + + + + + + + + + + + +
    Pagination templateDescription
    prevIs used for the last index (summary) page because we can only go backwards
    nextIs used for the first index (summary) page because we can only go forward
    bothIs used for intermediate index (summary) pages because we can either go backwards, or forward
    +

    Let's look at English pagination templates:

    +
      +
    • en/blog/pagination.prev.template contents:

      +
      <p>Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT</p>
      +<p>
      +    <a href="PSKOV_PREV_PAGE_URL">« Newer</a>
      +</p>
      +
    • +
    • en/blog/pagination.next.template contents:

      +
      <p>Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT</p>
      +<p>
      +    <a href="PSKOV_NEXT_PAGE_URL">Older »</a>
      +</p>
      +
    • +
    • en/blog/pagination.template contents:

      +
      <p>Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT</p>
      +<p>
      +    <a href="PSKOV_PREV_PAGE_URL">« Newer</a>
      +    <a href="PSKOV_NEXT_PAGE_URL">Older »</a>
      +</p>
      +
    • +
    +

    Russian counterparts look similar. Here's ru/blog/pagination.template contents:

    +
    <p>Страница PSKOV_PAGE_ID из PSKOV_PAGES_COUNT</p>
    +<p>
    +    <a href="PSKOV_PREV_PAGE_URL">« Новее</a>
    +    <a href="PSKOV_NEXT_PAGE_URL">Старее »</a>
    +</p>
    +
    +

    Here are new PSKOV constants we used:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    PSKOV constantDescription
    PSKOV_PAGE_IDProvides index (summary) page id starting from 1
    PSKOV_PAGES_COUNTProvides total number of index (summary) pages generated
    PSKOV_PREV_PAGE_URLProvides previous index (summary) page file name
    PSKOV_NEXT_PAGE_URLProvides next index (summary) page file name
    +

    +

    07. Investigate Markdown files

    +

    Markdown files represent blog posts and they look almost like Markdown files for pages. Here's en/blog/1885.md contents:

    +
     Title: Bullocks
    + Date: 1885
    + Slug: 1885.01.bullocks
    +
    + ![Bullocks][bullocks]
    +
    + I've been painting "Bullocks" sketch while I was staying in Odessa at Kuznetsov's in 1885.
    +
    + [bullocks]: https://upload.wikimedia.org/wikipedia/commons/c/cb/Walentin_Aleksandrovich_Serov_Bullocks.jpg
    +
    +

    Date is used to sort blog posts by date in ascending order:

    + + + + + + + + + + + + + +
    Header constantDescription
    Date:Provides value for PSKOV_ITEM_DATE constant when generating HTML out of Markdown
    +

    +

    08. Launch LFSA and generate the site

    +

    Launch LFSA so that it points to directory with the files we just observed:

    +
    $ /path/to/lfsa-201905.py /path/to/dir/03.Blog
    +
    +

    Generate the site:

    +
      +
    • Go to Tool page
    • +
    • Press Generate button
    • +
    • Open generated en/blog/index.html or ru/blog/index.html from the site's directory locally
    • +
    • Navigate index (summary) pages to make sure everything works fine
    • +
    +

    +

    09. Summary

    +

    You have successfully generated a web site with "constant" and "dynamic" pages. Check out the result.

    +

    Introduced PSKOV constants include:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PSKOV constantDescription
    PSKOV_ITEM_DATEProvides date from Date: part of page's header section
    PSKOV_PREVIEWProvides contents from a Markdown file limited by previewSize characters (approximately)
    PSKOV_INDEX_URLProvides generated page's file name: <previewsPageBaseName><id>.html
    PSKOV_PREVIEWSProvides a combination of PSKOV_PREVIEW sections
    PSKOV_PAGINATIONProvides pagination section to navigate index (summary) pages
    PSKOV_PAGE_IDProvides index (summary) page id starting from 1
    PSKOV_PAGES_COUNTProvides total number of index (summary) pages generated
    PSKOV_PREV_PAGE_URLProvides previous index (summary) page file name
    PSKOV_NEXT_PAGE_URLProvides next index (summary) page file name
    +

    Introduced configuration keys include:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyDescription
    previewPoints to an HTML template file that is used to generate HTML previews out of the first previewSize (approximately) characters of Markdown files
    indexPoints to an HTML template file that is used to generate HTML index (summary) files to host previews
    paginationPrevPoints to an HTML template file that is used to generate pagination section used by the last index (summary) file
    paginationNextPoints to an HTML template file that is used to generate pagination section used by the first index (summary) file
    paginationPrevNextPoints to an HTML template file that is used to generate pagination section used by index (summary) files except the ones at the beginning and at the end
    previewSizeHow many characters (approximately) to take out of a Markdown file to generate an HTML preview
    previewEndingString to use at the end of HTML previews
    previewsPerPageNumber of HTML previews hosted by single index (summary) file
    previewsPageBaseNameIndex (summary) file base name
    +

    Introduced header constants include:

    + + + + + + + + + + + + + +
    Header constantDescription
    Date:Provides value for PSKOV_ITEM_DATE constant when generating HTML out of Markdown
    +

    This was the final document to make you proficient in generating static sites with PSKOV. If you like what we do, support us by joining our group at Twitter, Facebook, or VK.

    +

    Now use PSKOV to generate your very own web site!

    +

    + + + + + + + + + + + + + + + +
    < BackIndexNext >
    04. LanguageEducationNot available
    +

    + + + + diff --git a/pskov/en/education.05.blog.md b/pskov/en/education.05.blog.md new file mode 100644 index 0000000..53c0227 --- /dev/null +++ b/pskov/en/education.05.blog.md @@ -0,0 +1,482 @@ +Title: Education: 05. Blog +Date: 2019-05-22 00:00 +Category: Page +Slug: education.05.blog +Lang: en + +| < Back | Index | Next > | +|---|---|---| +| [04. Language][prev] | [Education][index] | Not available | + +
    + +In this document we create "dynamic" pages like blog posts. + +Estimated completion time: 20 minutes. + +**Table of contents** + +* [01. Blog](#blog) +* [02. Investigate `cfg` file](#cfg) +* [03. Investigate item templates of the blog](#item) +* [04. Investigate preview templates](#preview) +* [05. Investigate index (summary) templates](#index) +* [06. Investigate pagination templates](#pagination) +* [07. Investigate Markdown files](#md) +* [08. Launch LFSA and generate the site](#gen) +* [09. Summary](#summary) + + + +## 01. Blog + +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. + +You set on to create the following [directory structure][03-files]: + +* `cfg` +* `en/blog/` + * `item.template` + * `index.template` + * `preview.template` + * `pagination.template` + * `pagination.prev.template` + * `pagination.next.template` + * `1885.md` + * `1886.01.md` + * `1886.02.md` + * `1887.01.md` + * `1887.02.md` + * `1888.md` + * `1896.md` + * `1899.md` +* `en/page/` + * `item.template` + * `about.md` + * `cv.md` +* `ru/blog/` + * `item.template` + * `index.template` + * `preview.template` + * `pagination.template` + * `pagination.prev.template` + * `pagination.next.template` + * `1885.md` + * `1886.01.md` + * `1886.02.md` + * `1887.01.md` + * `1887.02.md` + * `1888.md` + * `1896.md` + * `1899.md` +* `ru/page/` + * `item.template` + * `about.md` + * `cv.md` + +Let's look at the contents of these files closer. + + + +## 02. Investigate `cfg` file + +`cfg` file has the following contents: + +``` +input = en/page;ru/page;en/blog;ru/blog +item = item.template +preview = preview.template +index = index.template +paginationPrev = pagination.prev.template +paginationNext = pagination.next.template +paginationPrevNext = pagination.template +previewSize = 200 +previewEnding = . . . +previewsPerPage = 3 +previewPageBaseName = index +``` + +Apart from already used `input` and `item` keys, we have quite a lot of new ones. Let's break them down: + +| Key | Description | +|---|---| +| `preview` | Points to an HTML template file that is used to generate HTML previews out of the first `previewSize` (approximately) characters of Markdown files | +| `index` | Points to an HTML template file that is used to generate HTML index (summary) files to host previews | +| `paginationPrev` | Points to an HTML template file that is used to generate pagination section used by the *last* index (summary) file | +| `paginationNext` | Points to an HTML template file that is used to generate pagination section used by the *first* index (summary) file | +| `paginationPrevNext` | Points to an HTML template file that is used to generate pagination section used by index (summary) files *except the ones at the beginning and at the end* | +| `previewSize` | How many characters (approximately) to take out of a Markdown file to generate an HTML preview | +| `previewEnding` | String to use at the end of HTML previews | +| `previewsPerPage` | Number of HTML previews hosted by single index (summary) file | +| `previewsPageBaseName` | Index (summary) file base name | + +In our case: + +* we restrict previews to `200` characters in size (approximately) +* we use `. . .` string at the end of each preview +* index (summary) files host `3` previews maximum +* index (summary) files are saved as `index.html`, `index2.html`, `index3.html`, etc. + + + +## 03. Investigate item templates of the blog + +* `en/blog/item.template` contents: + + ``` + - - - - Collapsed for brevity - - - - + + +
    +

    In the blog...

    +
    +

    + PSKOV_ITEM_TITLE +

    +

    PSKOV_ITEM_DATE

    +PSKOV_ITEM_CONTENTS +
    + +
    + + - - - - Collapsed for brevity - - - - + ``` +* `ru/blog/item.template` contents: + + ``` + - - - - Collapsed for brevity - - - - + + +
    +

    В блоге...

    +
    +

    + PSKOV_ITEM_TITLE +

    +

    PSKOV_ITEM_DATE

    +PSKOV_ITEM_CONTENTS +
    + +
    + + - - - - Collapsed for brevity - - - - + ``` + +**Note**: beginning and ending were collapsed for brevity. + +As you can see, both files look similar to `item.template` files we saw [before][prev]. + +The changes include: + +* new URLs to reference pages in `page` directory and first index (summary) file in `blog` directory +* title is now referenced inside `contents` section as a link to complete page +* date is referenced to highlight relationship among different blog posts in time + +Date reference uses new `PSKOV_ITEM_DATE` constant: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_ITEM_DATE` | Provides date from `Date:` part of page's header section | + + + +## 04. Investigate preview templates + +* `en/blog/preview.template` contents: + + ``` +
    +

    + PSKOV_ITEM_TITLE +

    +

    PSKOV_ITEM_DATE

    + PSKOV_PREVIEW + +
    + ``` + +* `ru/blog/preview.template` contents: + + ``` +
    +

    + PSKOV_ITEM_TITLE +

    +

    PSKOV_ITEM_DATE

    + PSKOV_PREVIEW + +
    + ``` + +Previews have no ``, ``, and similar full page HTML tags. Previews represent sections inserted into index (summary) files. + +Preview itself is referenced by `PSKOV_PREVIEW` constant: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_PREVIEW` | Provides contents from a Markdown file limited by `previewSize` characters (approximately) | + + + +## 05. Investigate index (summary) templates + +* `en/blog/index.template` contents: + + ``` + - - - - Collapsed for brevity - - - - + + +
    +

    Blog

    + PSKOV_PREVIEWS + PSKOV_PAGINATION + +
    + + - - - - Collapsed for brevity - - - - + ``` + +* `ru/blog/index.template` contents: + + ``` + - - - - Collapsed for brevity - - - - + + +
    +

    Блог

    + PSKOV_PREVIEWS + PSKOV_PAGINATION + +
    + + - - - - Collapsed for brevity - - - - + ``` + +**Notes**: + +* beginning and ending were collapsed for brevity +* `PSKOV_INDEX_URL` constant is used to provide language selection + +Index (summary) files are used to host previews. + +Here are new **PSKOV** constants explained: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_INDEX_URL` | Provides generated page's file name: `.html` | +| `PSKOV_PREVIEWS` | Provides a combination of `PSKOV_PREVIEW` sections | +| `PSKOV_PAGINATION` | Provides pagination section to navigate index (summary) pages | + + + +## 06. Investigate pagination templates + +Pagination templates represent sections used to navigate index (summary) pages. + +There are free pagination templates: + +| Pagination template | Description | +|---|---| +| prev | Is used for the last index (summary) page because we can only go backwards | +| next | Is used for the first index (summary) page because we can only go forward | +| both | Is used for intermediate index (summary) pages because we can either go backwards, or forward | + +Let's look at English pagination templates: + +* `en/blog/pagination.prev.template` contents: + + ``` +

    Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT

    +

    + « Newer +

    + ``` + +* `en/blog/pagination.next.template` contents: + + ``` +

    Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT

    +

    + Older » +

    + ``` + +* `en/blog/pagination.template` contents: + + ``` +

    Page PSKOV_PAGE_ID of PSKOV_PAGES_COUNT

    +

    + « Newer + Older » +

    + ``` + +Russian counterparts look similar. Here's `ru/blog/pagination.template` contents: + +``` +

    Страница PSKOV_PAGE_ID из PSKOV_PAGES_COUNT

    +

    + « Новее + Старее » +

    +``` + +Here are new **PSKOV** constants we used: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_PAGE_ID` | Provides index (summary) page id starting from `1` | +| `PSKOV_PAGES_COUNT` | Provides total number of index (summary) pages generated | +| `PSKOV_PREV_PAGE_URL` | Provides previous index (summary) page file name | +| `PSKOV_NEXT_PAGE_URL` | Provides next index (summary) page file name | + + + +## 07. Investigate Markdown files + +Markdown files represent blog posts and they look almost like Markdown files for pages. Here's `en/blog/1885.md` contents: + +``` + Title: Bullocks + Date: 1885 + Slug: 1885.01.bullocks + + ![Bullocks][bullocks] + + I've been painting "Bullocks" sketch while I was staying in Odessa at Kuznetsov's in 1885. + + [bullocks]: https://upload.wikimedia.org/wikipedia/commons/c/cb/Walentin_Aleksandrovich_Serov_Bullocks.jpg +``` + +Date is used to sort blog posts by date in ascending order: + +| Header constant | Description | +|---|---| +| `Date:` | Provides value for `PSKOV_ITEM_DATE` constant when generating HTML out of Markdown | + + + +## 08. Launch LFSA and generate the site + +Launch [LFSA][lfsa] so that it points to directory with the files we just observed: + +``` +$ /path/to/lfsa-201905.py /path/to/dir/03.Blog +``` + +Generate the site: + +* Go to [Tool][tool] page +* Press `Generate` button +* Open generated `en/blog/index.html` or `ru/blog/index.html` from the site's directory locally +* Navigate index (summary) pages to make sure everything works fine + + + +## 09. Summary + +You have successfully generated a web site with "constant" and "dynamic" pages. [Check out the result][03-sample]. + +Introduced PSKOV constants include: + +| PSKOV constant | Description | +|---|---| +| `PSKOV_ITEM_DATE` | Provides date from `Date:` part of page's header section | +| `PSKOV_PREVIEW` | Provides contents from a Markdown file limited by `previewSize` characters (approximately) | +| `PSKOV_INDEX_URL` | Provides generated page's file name: `.html` | +| `PSKOV_PREVIEWS` | Provides a combination of `PSKOV_PREVIEW` sections | +| `PSKOV_PAGINATION` | Provides pagination section to navigate index (summary) pages | +| `PSKOV_PAGE_ID` | Provides index (summary) page id starting from `1` | +| `PSKOV_PAGES_COUNT` | Provides total number of index (summary) pages generated | +| `PSKOV_PREV_PAGE_URL` | Provides previous index (summary) page file name | +| `PSKOV_NEXT_PAGE_URL` | Provides next index (summary) page file name | + +Introduced configuration keys include: + +| Key | Description | +|---|---| +| `preview` | Points to an HTML template file that is used to generate HTML previews out of the first `previewSize` (approximately) characters of Markdown files | +| `index` | Points to an HTML template file that is used to generate HTML index (summary) files to host previews | +| `paginationPrev` | Points to an HTML template file that is used to generate pagination section used by the *last* index (summary) file | +| `paginationNext` | Points to an HTML template file that is used to generate pagination section used by the *first* index (summary) file | +| `paginationPrevNext` | Points to an HTML template file that is used to generate pagination section used by index (summary) files *except the ones at the beginning and at the end* | +| `previewSize` | How many characters (approximately) to take out of a Markdown file to generate an HTML preview | +| `previewEnding` | String to use at the end of HTML previews | +| `previewsPerPage` | Number of HTML previews hosted by single index (summary) file | +| `previewsPageBaseName` | Index (summary) file base name | + +Introduced header constants include: + +| Header constant | Description | +|---|---| +| `Date:` | Provides value for `PSKOV_ITEM_DATE` constant when generating HTML out of Markdown | + +This was the final document to make you proficient in generating static sites with **PSKOV**. If you like what we do, support us by joining our group at [Twitter][tw], [Facebook][fb], or [VK][vk]. + +Now use **PSKOV** to generate your very own web site! + +
    + +| < Back | Index | Next > | +|---|---|---| +| [04. Language][prev] | [Education][index] | Not available | + +[index]: education.html +[prev]: education.04.lang.html + +[03-files]: https://github.com/OGStudio/site-pskov-sample/tree/master/03.Blog +[03-sample]: http://opengamestudio.org/pskov/sample/03.Blog/en/blog/index.html +[lfsa]: http://opengamestudio.org/lfsa +[tool]: http://opengamestudio.org/pskov + +[tw]: https://twitter.com/OpenGameStudio +[fb]: https://www.facebook.com/groups/162611230470183 +[vk]: https://vk.com/opengamestudo diff --git a/pskov/en/education.html b/pskov/en/education.html index 546b8f9..9a97769 100644 --- a/pskov/en/education.html +++ b/pskov/en/education.html @@ -20,11 +20,6 @@ { color: #433729; } - iframe - { - width: 720px; - height: 720px; - } html { font-family: sans-serif; @@ -71,68 +66,156 @@ } - PSKOV - Opensource Game Studio static site generator + PSKOV-201905

    Education

    -

    Here you can find a set of documents to make you proficient in generating static sites with PSKOV. You are encouraged to read the documents in order.

    +

    Here is a set of documents to make you proficient in generating static sites with PSKOV. We encourage you to read the documents in order.

    +

    01. Why

    - - + - - - - + - + + + + +
    DocumentItem DetailsDemonstrationEstimated completion time
    1WhyDescription Find out why PSKOV was created-
    Estimated completion time 5 minutes
    +

    02. Dependencies

    + + + + + + + + - - + - - - - + + + + +
    ItemDetails
    2DependenciesDescription Install dependencies to start using PSKOV-?? minutes
    3SiteEstimated completion time5 minutes
    +

    03. Site

    + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + +
    ItemDetails
    Description Learn how to create a simple static web site with two pagesTODO Link?? minutes
    4Language?TODO Link?Estimated completion time10 minutes
    DemonstrationTwoPages
    Introduced PSKOV constants
    1. PSKOV_ITEM_TITLE
    2. PSKOV_ITEM_CONTENTS
    Introduced configuration keys
    1. input
    2. item
    Introduced header constants
    1. Title:
    2. Slug:
    +

    04. Language

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    ItemDetails
    DescriptionLearn how to add language selection
    Estimated completion time10 minutes
    DemonstrationLanguage
    Introduced PSKOV constants
    1. PSKOV_ITEM_URL
    +

    05. Blog

    + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + +
    ItemDetails
    DescriptionLearn how to create "dynamic" pages like blog posts
    Estimated completion time20 minutes
    DemonstrationBlog
    Introduced PSKOV constants
    1. PSKOV_ITEM_DATE
    2. PSKOV_PREVIEW
    3. PSKOV_INDEX_URL
    4. PSKOV_PREVIEWS
    5. PSKOV_PAGINATION
    6. PSKOV_PAGE_ID
    7. PSKOV_PAGES_COUNT
    8. PSKOV_PREV_PAGE_URL
    9. PSKOV_NEXT_PAGE_URL
    Introduced configuration keys
    1. preview
    2. index
    3. paginationPrev
    4. paginationNext
    5. paginationPrevNext
    6. previewSize
    7. previewEnding
    8. previewsPerPage
    9. previewsPageBaseName
    5Blog?TODO Link?Introduced header constants
    1. Date:
    +

    If you like what we do, support us by joining our group at Twitter, Facebook, or VK.

    diff --git a/pskov/en/education.md b/pskov/en/education.md new file mode 100644 index 0000000..62d092f --- /dev/null +++ b/pskov/en/education.md @@ -0,0 +1,68 @@ +Title: Education +Date: 2019-05-20 00:00 +Category: Page +Slug: education +Lang: en + +Here is a set of documents to make you proficient in generating static sites with **PSKOV**. We encourage you to read the documents in order. + +## [01. Why][why] + +| Item | Details | +|---|---| +| Description | Find out why **PSKOV** was created | +| Estimated completion time | 5 minutes | + +## [02. Dependencies][deps] + +| Item | Details | +|---|---| +| Description | Install dependencies to start using **PSKOV** | +| Estimated completion time | 5 minutes | + +## [03. Site][site] + +| Item | Details | +|---|---| +| Description | Learn how to create a simple static web site with two pages | +| Estimated completion time | 10 minutes | +| Demonstration | [TwoPages][01-sample] | +| Introduced PSKOV constants |
    1. `PSKOV_ITEM_TITLE`
    2. `PSKOV_ITEM_CONTENTS`
    | +| Introduced configuration keys |
    1. `input`
    2. `item`
    | +| Introduced header constants |
    1. `Title:`
    2. `Slug:`
    | + +## [04. Language][lang] + +| Item | Details | +|---|---| +| Description | Learn how to add language selection | +| Estimated completion time | 10 minutes | +| Demonstration | [Language][02-sample] | +| Introduced PSKOV constants |
    1. `PSKOV_ITEM_URL`
    | + +## [05. Blog][blog] + +| Item | Details | +|---|---| +| Description | Learn how to create "dynamic" pages like blog posts | +| Estimated completion time | 20 minutes | +| Demonstration | [Blog][03-sample] | +| Introduced PSKOV constants |
    1. `PSKOV_ITEM_DATE`
    2. `PSKOV_PREVIEW`
    3. `PSKOV_INDEX_URL`
    4. `PSKOV_PREVIEWS`
    5. `PSKOV_PAGINATION`
    6. `PSKOV_PAGE_ID`
    7. `PSKOV_PAGES_COUNT`
    8. `PSKOV_PREV_PAGE_URL`
    9. `PSKOV_NEXT_PAGE_URL`
    | +| Introduced configuration keys |
    1. `preview`
    2. `index`
    3. `paginationPrev`
    4. `paginationNext`
    5. `paginationPrevNext`
    6. `previewSize`
    7. `previewEnding`
    8. `previewsPerPage`
    9. `previewsPageBaseName`
    | +| Introduced header constants |
    1. `Date:`
    | + +If you like what we do, support us by joining our group at [Twitter][tw], [Facebook][fb], or [VK][vk]. + +[why]: education.01.why.html +[deps]: education.02.deps.html +[site]: education.03.site.html +[lang]: education.04.lang.html +[blog]: education.05.blog.html + +[01-sample]: http://opengamestudio.org/pskov/sample/01.TwoPages/about.html +[02-sample]: http://opengamestudio.org/pskov/sample/02.Language/en/about.html +[03-sample]: http://opengamestudio.org/pskov/sample/03.Blog/en/blog/index.html + +[tw]: https://twitter.com/OpenGameStudio +[fb]: https://www.facebook.com/groups/162611230470183 +[vk]: https://vk.com/opengamestudo diff --git a/pskov/en/item.template b/pskov/en/item.template index ae0f3c4..c7370cd 100644 --- a/pskov/en/item.template +++ b/pskov/en/item.template @@ -20,11 +20,6 @@ { color: #433729; } - iframe - { - width: 720px; - height: 720px; - } html { font-family: sans-serif; @@ -71,13 +66,13 @@ } - PSKOV - Opensource Game Studio static site generator + PSKOV-201905

    diff --git a/pskov/en/pskov-201905.html b/pskov/en/pskov-201905.html deleted file mode 120000 index b6acadf..0000000 --- a/pskov/en/pskov-201905.html +++ /dev/null @@ -1 +0,0 @@ -../pskov-201905.html \ No newline at end of file diff --git a/pskov/pskov-201905.html b/pskov/en/tool.pskov.html similarity index 97% rename from pskov/pskov-201905.html rename to pskov/en/tool.pskov.html index 997e3df..1bb4db7 100644 --- a/pskov/pskov-201905.html +++ b/pskov/en/tool.pskov.html @@ -3,6 +3,67 @@ + + PSKOV-201905 + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Local file system access -
    Path:Updating...
    - Configuration - -
    Input directory:
    Item template:
    Preview template:
    Index template:
    Pagination 'Previous' template:
    Pagination 'Next' template:
    Pagination 'Previous/Next' template:
    Preview characters limit:
    Preview ending string:
    Previews per page:
    Preview page base name:
    - News - -
    Log
    + +

    + PSKOV-201905 +

    +
    +

    + PSKOV is a static site generator that runs in your web browser. + What you see now has also been generated with PSKOV. + If you're new to PSKOV, visit education page. +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Local file system access +
    Path:Updating...
    + Configuration + +
    Input directory:
    Item template:
    Preview template:
    Index template:
    Pagination 'Previous' template:
    Pagination 'Next' template:
    Pagination 'Previous/Next' template:
    Preview characters limit:
    Preview ending string:
    Previews per page:
    Preview page base name:
    + News + +
    Log
    +
    + diff --git a/pskov/index.html b/pskov/index.html index 5c2e90b..4d3ce61 100644 --- a/pskov/index.html +++ b/pskov/index.html @@ -1,4 +1,4 @@ - +