start docs (AI) fix some caching logic
All checks were successful
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 9s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 19s
Release / build (release) Successful in 39s
All checks were successful
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 9s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 19s
Release / build (release) Successful in 39s
This commit is contained in:
3
docs/content/added-tools.md
Normal file
3
docs/content/added-tools.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Added Tools for the Template
|
||||
|
||||
Foldsite provides additional tools for templates, such as functions to get sibling content files, text document previews, and folder contents.
|
19
docs/content/configuration.md
Normal file
19
docs/content/configuration.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Configuration
|
||||
|
||||
The configuration file is written in TOML format and contains various settings for the application. Below is an example configuration file (`config.toml`):
|
||||
|
||||
```toml
|
||||
[paths]
|
||||
content_dir = "example/content"
|
||||
templates_dir = "templates"
|
||||
styles_dir = "styles"
|
||||
|
||||
[server]
|
||||
listen_address = "127.0.0.1"
|
||||
listen_port = 8080
|
||||
debug = false
|
||||
access_log = true
|
||||
max_threads = 4
|
||||
admin_browser = false
|
||||
admin_password = "your_admin_password"
|
||||
```
|
12
docs/content/deployment.md
Normal file
12
docs/content/deployment.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Deployment
|
||||
|
||||
To deploy Foldsite, you can use Docker. Below is an example Dockerfile:
|
||||
|
||||
```dockerfile
|
||||
FROM python:3.13.2-bookworm
|
||||
WORKDIR /app
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY . .
|
||||
CMD ["python", "main.py"]
|
||||
```
|
16
docs/content/docker-compose-example.md
Normal file
16
docs/content/docker-compose-example.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Docker Compose Example
|
||||
|
||||
Below is an example `docker-compose.yml` file to deploy Foldsite using Docker Compose:
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
services:
|
||||
foldsite:
|
||||
build: .
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- .:/app
|
||||
environment:
|
||||
- CONFIG_PATH=config.toml
|
||||
```
|
39
docs/content/example-usages.md
Normal file
39
docs/content/example-usages.md
Normal file
@ -0,0 +1,39 @@
|
||||
# Example Usages for Tools and Types
|
||||
|
||||
### Example Usage of `get_sibling_content_files`
|
||||
|
||||
```html
|
||||
<ul>
|
||||
{% for file in get_sibling_content_files('path/to/directory') %}
|
||||
<li>{{ file[0] }} - {{ file[1] }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
```
|
||||
|
||||
### Example Usage of `get_text_document_preview`
|
||||
|
||||
```html
|
||||
<div>
|
||||
{{ get_text_document_preview('path/to/document.md') }}
|
||||
</div>
|
||||
```
|
||||
|
||||
### Example Usage of `get_sibling_content_folders`
|
||||
|
||||
```html
|
||||
<ul>
|
||||
{% for folder in get_sibling_content_folders('path/to/directory') %}
|
||||
<li>{{ folder[0] }} - {{ folder[1] }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
```
|
||||
|
||||
### Example Usage of `get_folder_contents`
|
||||
|
||||
```html
|
||||
<ul>
|
||||
{% for item in get_folder_contents('path/to/directory') %}
|
||||
<li>{{ item.name }} - {{ item.path }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
```
|
0
docs/content/folder-layout.md
Normal file
0
docs/content/folder-layout.md
Normal file
23
docs/content/how-template-written.md
Normal file
23
docs/content/how-template-written.md
Normal file
@ -0,0 +1,23 @@
|
||||
# How a Template is Written
|
||||
|
||||
Templates are written in HTML and use Jinja2 syntax for dynamic content. Below is an example template (`base.html`):
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }}</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='base.css') }}">
|
||||
{% for style in styles %}
|
||||
<link rel="stylesheet" href="{{ style }}">
|
||||
{% endfor %}
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
{{ content }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
20
docs/content/index.md
Normal file
20
docs/content/index.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Foldsite Documentation
|
||||
|
||||
Welcome to the Foldsite documentation. This site will guide you through the setup, configuration, and usage of Foldsite.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Introduction](introduction.md)
|
||||
2. [Configuration](configuration.md)
|
||||
3. [Template Setup](template-setup.md)
|
||||
4. [Site Setup](site-setup.md)
|
||||
5. [Style Setup](style-setup.md)
|
||||
6. [Template and Style Search](template-style-search.md)
|
||||
7. [How a Template is Written](how-template-written.md)
|
||||
8. [Jinja Primer](jinja-primer.md)
|
||||
9. [Added Tools for the Template](added-tools.md)
|
||||
10. [Tool Input and Return Types](tool-input-return-types.md)
|
||||
11. [Example Usages for Tools and Types](example-usages.md)
|
||||
12. [Deployment](deployment.md)
|
||||
13. [Docker Compose Example](docker-compose-example.md)
|
||||
14. [Folder Layout](folder-layout.md)
|
5
docs/content/introduction.md
Normal file
5
docs/content/introduction.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Introduction
|
||||
|
||||
Foldsite is a dynamic site generator built with Python and Flask. It allows you to create and manage a website using Markdown content, HTML templates, and CSS styles.
|
||||
|
||||
This documentation will guide you through the setup, configuration, and usage of Foldsite.
|
8
docs/content/jinja-primer.md
Normal file
8
docs/content/jinja-primer.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Jinja Primer
|
||||
|
||||
Jinja2 is a templating engine for Python. It allows you to include dynamic content in your HTML templates. Below are some basic Jinja2 syntax examples:
|
||||
|
||||
- Variables: `{{ variable }}`
|
||||
- Loops: `{% for item in list %} ... {% endfor %}`
|
||||
- Conditionals: `{% if condition %} ... {% endif %}`
|
||||
- Includes: `{% include 'template.html' %}`
|
3
docs/content/site-setup.md
Normal file
3
docs/content/site-setup.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Site Setup
|
||||
|
||||
The site content is stored in the `content` directory. Each Markdown file represents a page on your site. The directory structure of the `content` directory determines the URL structure of your site.
|
3
docs/content/style-setup.md
Normal file
3
docs/content/style-setup.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Style Setup
|
||||
|
||||
Styles are CSS files that define the appearance of your web pages. They are stored in the `styles` directory. You can create specific styles for different types of content and categories.
|
3
docs/content/template-setup.md
Normal file
3
docs/content/template-setup.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Template Setup
|
||||
|
||||
Templates are HTML files that define the structure of your web pages. They are stored in the `templates` directory. Each template can include other templates and use Jinja2 syntax for dynamic content.
|
3
docs/content/template-style-search.md
Normal file
3
docs/content/template-style-search.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Template and Style Search
|
||||
|
||||
Templates and styles are searched in a specific order to apply the most specific styles first, followed by more general styles, and finally the base style.
|
13
docs/content/tool-input-return-types.md
Normal file
13
docs/content/tool-input-return-types.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Tool Input and Return Types
|
||||
|
||||
### `get_sibling_content_files(path: str) -> list`
|
||||
Returns a list of sibling content files in the specified directory.
|
||||
|
||||
### `get_text_document_preview(path: str) -> str`
|
||||
Generates a preview of the text document located at the given path.
|
||||
|
||||
### `get_sibling_content_folders(path: str) -> list`
|
||||
Returns a list of sibling content folders within a specified directory.
|
||||
|
||||
### `get_folder_contents(path: str) -> list`
|
||||
Retrieves the contents of a folder and returns a list of `TemplateFile` objects.
|
Reference in New Issue
Block a user