SiteGenerator/README.md

39 lines
1.6 KiB
Markdown
Raw Normal View History

2022-01-28 13:56:36 +00:00
# Static Site Generator
Generates simple webpages.
# How to use
1. Create a file with `.page` extension in the same directory as `generate.py`, the file name will be title of the page, for example: About.page
2. Use markdown in the created file, it will be auto-converted to HTML. You can also use raw HTML in the file, with `>` symbol, like this:
```
**Example**
>
<p>Hello world</p>
**Back to just markdown**
```
Line before HTML code must be a single character `>` and HTML code below must be indented by 2 spaces. You can also use Markdown inside HTML, for example:
```
<p>**Hello world**<p>
```
will display as bold.
3. (Optional) Create a file called `navbar` and/or `footer` to have a navigation bar/footer that is added to every generated page file. Example navbar file: (See example/resources/style.css for styling dropdown)
2022-01-28 13:56:36 +00:00
```
Home;Home.page
About;About.page
External Site;https://example.com
Dropdown;#|
Site 1;https://example1.com
Site 2;https://example2.com
FAQ;FAQ.page
2022-01-28 13:56:36 +00:00
```
It also supports HTML, but HTML code will not be formatted as navigation bar automatically.
2022-01-31 11:03:04 +00:00
4. (Optional) Add `resources` folder, its contents will be copied to generated site's folder. You can create subfolders in it that have the same name as a specific `.page` file, in order to put resources in that page's folder.
Note: folder name must be lowercase and spaces must be replaced with `-` character.
5. Run generate.py, it will generate output website files in `website-output` folder.
2022-01-28 13:56:36 +00:00
# To-do list
- Re-think footer
2022-01-31 11:03:04 +00:00
- Delete removed page files from website-output during next site generation (Last, to be done on release, so it doesn't disturb development)