scriptorium 0.0.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.lt3 +324 -0
- data/README.md +3155 -1
- data/assets/.DS_Store +0 -0
- data/assets/README.md +44 -0
- data/assets/back-icon.png +0 -0
- data/assets/icons/facebook.svg +1 -0
- data/assets/icons/github.svg +1 -0
- data/assets/icons/instagram.svg +1 -0
- data/assets/icons/reddit.svg +1 -0
- data/assets/icons/ui/.DS_Store +0 -0
- data/assets/icons/ui/back.png +0 -0
- data/assets/icons/ui/copy.png +0 -0
- data/assets/icons/ui/down.png +0 -0
- data/assets/icons/ui/end.png +0 -0
- data/assets/icons/ui/exit.png +0 -0
- data/assets/icons/ui/foo +10 -0
- data/assets/icons/ui/home.png +0 -0
- data/assets/icons/ui/left.png +0 -0
- data/assets/icons/ui/next.png +0 -0
- data/assets/icons/ui/right.png +0 -0
- data/assets/icons/ui/start.png +0 -0
- data/assets/icons/ui/up.png +0 -0
- data/assets/icons/x.svg +1 -0
- data/assets/icons/youtube.svg +1 -0
- data/assets/samples/placeholder.svg +9 -0
- data/assets/themes/standard/favicon.svg +6 -0
- data/bin/scriptorium +1511 -0
- data/doc/README.txt +6 -0
- data/doc/anti-amnesia/20250727-054000-scriptorium-overview.md +95 -0
- data/doc/anti-amnesia/20250727-060000-api-design-tui-planning.md +34 -0
- data/doc/anti-amnesia/20250727-061000-runeblog-tui-analysis.md +50 -0
- data/doc/anti-amnesia/20250727-123000-anti-amnesia-conventions.md +31 -0
- data/doc/anti-amnesia/20250727-154000-livetext-plugin-file-stats.md +73 -0
- data/doc/anti-amnesia/20250727-172600-cursor-rbenv-ruby-version-mystery.md +64 -0
- data/doc/anti-amnesia/20250727-172600-unified-minitest-framework.md +70 -0
- data/doc/anti-amnesia/20250727-172900-ai-cognitive-assessment-capabilities.md +40 -0
- data/doc/anti-amnesia/20250727-173000-widget-testing-achievement.md +110 -0
- data/doc/anti-amnesia/20250727-180000-post-id-num-refactoring.md +73 -0
- data/doc/anti-amnesia/20250728-124243-aaa-syntax-clarification.md +46 -0
- data/doc/anti-amnesia/20250728-124421-conversation-summary-concise.md +124 -0
- data/doc/anti-amnesia/20250729-190000-scriptorium-tui-testing-complete.md +46 -0
- data/doc/anti-amnesia/20250729-200000-scriptorium-tui-testing-edit-file-workflow.md +97 -0
- data/doc/anti-amnesia/20250729-210000-reddit-autopost-integration-complete.md +158 -0
- data/doc/anti-amnesia/20250729-211500-dependency-management-system.md +211 -0
- data/doc/anti-amnesia/20250729-213000-python-virtual-environment-setup.md +141 -0
- data/doc/anti-amnesia/20250729-214500-theme-management-commands.md +211 -0
- data/doc/anti-amnesia/20250729-215000-version-update-to-0.6.0.md +134 -0
- data/doc/anti-amnesia/20250729-220000-user-guide-complete.md +41 -0
- data/doc/anti-amnesia/20250804-190500-cognitive-loop-bug.md +45 -0
- data/doc/anti-amnesia/20250804-190700-anti-amnesia-timestamping-fix.md +30 -0
- data/doc/anti-amnesia/20250804-213700-publishing-test-fix.md +49 -0
- data/doc/anti-amnesia/20250804-214400-additional-test-fixes.md +46 -0
- data/doc/anti-amnesia/20250804-220000-asset-function-logic-clarification.md +41 -0
- data/doc/anti-amnesia/20250806-202032-asset-function-logic-clarification.md +41 -0
- data/doc/anti-amnesia/20250807-213025.md +116 -0
- data/doc/anti-amnesia/20250813-082428-syntax-highlighting-and-navigation-improvements.md +256 -0
- data/doc/banner_svg_config.md +114 -0
- data/doc/contrib.lt3 +8 -0
- data/doc/dependencies.md +281 -0
- data/doc/hacker.lt3 +5 -0
- data/doc/reddit_credentials_template.json +8 -0
- data/doc/reddit_integration.md +207 -0
- data/doc/user.lt3 +38 -0
- data/doc/user_guide_section_1.md +137 -0
- data/doc/user_guide_section_10.md +515 -0
- data/doc/user_guide_section_11.md +708 -0
- data/doc/user_guide_section_2.md +233 -0
- data/doc/user_guide_section_3.md +5 -0
- data/doc/user_guide_section_4.md +221 -0
- data/doc/user_guide_section_5.md +243 -0
- data/doc/user_guide_section_6.md +147 -0
- data/doc/user_guide_section_7.md +311 -0
- data/doc/user_guide_section_8.md +224 -0
- data/doc/user_guide_section_9.md +375 -0
- data/doc/userdoc-toc.txt +88 -0
- data/lib/rouge/lexers/livetext.rb +74 -0
- data/lib/scriptorium/api.rb +640 -0
- data/lib/scriptorium/banner_svg.rb +742 -0
- data/lib/scriptorium/contract.rb +33 -0
- data/lib/scriptorium/exceptions.rb +174 -0
- data/lib/scriptorium/helpers.rb +475 -0
- data/lib/scriptorium/post.rb +195 -0
- data/lib/scriptorium/reddit.rb +83 -0
- data/lib/scriptorium/repo.rb +624 -0
- data/lib/scriptorium/standard_files.rb +515 -0
- data/lib/scriptorium/syntax_highlighter.rb +234 -0
- data/lib/scriptorium/theme.rb +179 -0
- data/lib/scriptorium/version.rb +2 -2
- data/lib/scriptorium/view.rb +976 -0
- data/lib/scriptorium/widgets/featured_posts.rb +149 -0
- data/lib/scriptorium/widgets/links.rb +112 -0
- data/lib/scriptorium/widgets/pages.rb +133 -0
- data/lib/scriptorium/widgets/widget.rb +133 -0
- data/lib/scriptorium.rb +22 -9
- data/lib/skeleton.rb +11 -2
- data/scriptorium.gemspec +15 -4
- data/test/README.md +69 -0
- data/test/all +43 -0
- data/test/api_demo.rb +99 -0
- data/test/assets/imagenotfound.jpg +0 -0
- data/test/assets/images/.DS_Store +0 -0
- data/test/assets/images/README.md +27 -0
- data/test/assets/images/odd_aspect.png +0 -0
- data/test/assets/images/perfect.png +0 -0
- data/test/assets/images/small.png +0 -0
- data/test/assets/images/tall.png +0 -0
- data/test/assets/images/very_tall.png +0 -0
- data/test/assets/images/very_wide.png +0 -0
- data/test/assets/images/wide.png +0 -0
- data/test/assets/testbanner.jpg +0 -0
- data/test/banner_svg/simple_helpers.rb +13 -0
- data/test/banner_svg/unit.rb +768 -0
- data/test/ed_test.rb +204 -0
- data/test/integration/cursor_banner_combinations.rb +193 -0
- data/test/integration/cursor_banner_features.rb +374 -0
- data/test/integration/integration_test.rb +326 -0
- data/test/livetext_plugin_test.rb +229 -0
- data/test/manual/asset_mgmt.rb +67 -0
- data/test/manual/banner-tests/config.txt +3 -0
- data/test/manual/banner-tests/index.html +45 -0
- data/test/manual/banner-tests/test01.html +58 -0
- data/test/manual/banner-tests/test02.html +58 -0
- data/test/manual/banner-tests/test03.html +58 -0
- data/test/manual/banner-tests/test04.html +65 -0
- data/test/manual/banner-tests/test05.html +65 -0
- data/test/manual/banner-tests/test06.html +65 -0
- data/test/manual/banner-tests/test07.html +65 -0
- data/test/manual/banner-tests/test08.html +59 -0
- data/test/manual/banner-tests/test09.html +59 -0
- data/test/manual/banner-tests/test10.html +59 -0
- data/test/manual/banner-tests/test11.html +59 -0
- data/test/manual/banner-tests/test12.html +59 -0
- data/test/manual/banner-tests/test13.html +59 -0
- data/test/manual/banner-tests/test14.html +59 -0
- data/test/manual/banner-tests/test15.html +58 -0
- data/test/manual/banner-tests/test16.html +58 -0
- data/test/manual/banner-tests/test17.html +58 -0
- data/test/manual/banner-tests/test18.html +68 -0
- data/test/manual/banner-tests/test19.html +68 -0
- data/test/manual/banner-tests/test20.html +68 -0
- data/test/manual/banner-tests/test21.html +68 -0
- data/test/manual/banner-tests/test22.html +68 -0
- data/test/manual/banner-tests/test23.html +68 -0
- data/test/manual/banner-tests/test24.html +68 -0
- data/test/manual/banner-tests/test25.html +67 -0
- data/test/manual/banner_environment.rb +192 -0
- data/test/manual/deploy_symlink_demo.rb +142 -0
- data/test/manual/environment.rb +67 -0
- data/test/manual/make_banner.rb +153 -0
- data/test/manual/sample_banner_config.txt +12 -0
- data/test/manual/symlink_demo.rb +117 -0
- data/test/manual/test1.rb +47 -0
- data/test/manual/test2.rb +12 -0
- data/test/manual/test3.rb +38 -0
- data/test/manual/test4.rb +40 -0
- data/test/manual/test5.rb +24 -0
- data/test/manual/test6.rb +73 -0
- data/test/manual/test_banner_combinations.rb +120 -0
- data/test/manual/test_banner_features.rb +306 -0
- data/test/manual/test_banner_from_file.rb +150 -0
- data/test/manual/test_banner_in_header.rb +35 -0
- data/test/manual/test_code_highlighting.rb +68 -0
- data/test/manual/test_complex_header.rb +74 -0
- data/test/manual/test_empty_header.rb +32 -0
- data/test/manual/test_radial_custom.rb +58 -0
- data/test/manual/test_radial_large_radius.rb +52 -0
- data/test/manual/test_svg_debug.rb +47 -0
- data/test/manual/test_syntax_highlighting.rb +147 -0
- data/test/pages-demo/config/currentview.txt +1 -0
- data/test/pages-demo/views/demo/config/bootstrap_css.txt +5 -0
- data/test/pages-demo/views/demo/config/bootstrap_js.txt +4 -0
- data/test/pages-demo/views/demo/config/common.js +57 -0
- data/test/pages-demo/views/demo/config/footer.txt +1 -0
- data/test/pages-demo/views/demo/config/global-head.txt +8 -0
- data/test/pages-demo/views/demo/config/header.txt +1 -0
- data/test/pages-demo/views/demo/config/layout.txt +1 -0
- data/test/pages-demo/views/demo/config/left.txt +1 -0
- data/test/pages-demo/views/demo/config/main.txt +1 -0
- data/test/pages-demo/views/demo/config/right.txt +1 -0
- data/test/pages-demo/views/demo/config.txt +3 -0
- data/test/pages-demo/views/demo/output/panes/footer.html +1 -0
- data/test/pages-demo/views/demo/output/panes/header.html +1 -0
- data/test/pages-demo/views/demo/output/panes/left.html +1 -0
- data/test/pages-demo/views/demo/output/panes/main.html +1 -0
- data/test/pages-demo/views/demo/output/panes/right.html +1 -0
- data/test/rubytext/rubytext_comprehensive_test.rb +307 -0
- data/test/rubytext/rubytext_demo_test.rb +42 -0
- data/test/rubytext/rubytext_testing_guide.md +277 -0
- data/test/run_automated_tests.rb +45 -0
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_css.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_js.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/config/common.js +57 -0
- data/test/scriptorium-TEST-1754622690-146/config/currentview.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/config/global-head.txt +9 -0
- data/test/scriptorium-TEST-1754622690-146/config/last_post_num.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/config/os_helpers.rb +4 -0
- data/test/scriptorium-TEST-1754622690-146/config/widgets.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/posts/0001/meta.txt +8 -0
- data/test/scriptorium-TEST-1754622690-146/posts/0001/source.lt3 +6 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/README.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/config.txt +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/initial/post.lt3 +12 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/footer.txt +2 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/header.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/left.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/main.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/right.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/gen/text.css +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/layout.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index.lt3 +1 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index_entry.lt3 +14 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/post.lt3 +13 -0
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/widget.lt3 +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_css.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_js.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/common.js +57 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/deploy.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/footer.txt +2 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/global-head.txt +9 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/header.txt +4 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/layout.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/left.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/main.txt +5 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/reddit.txt +10 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/right.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/social.txt +7 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/status.txt +7 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/config.txt +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/footer.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/header.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/left.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/main.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/right.html +3 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/footer.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/header.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/left.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/main.html +1 -0
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/right.html +1 -0
- data/test/staging/.DS_Store +0 -0
- data/test/syntax_highlighting_test.lt3 +124 -0
- data/test/test_helpers.rb +230 -0
- data/test/tui_editor_integration_test.rb +296 -0
- data/test/tui_integration_test.rb +637 -0
- data/test/unit/api.rb +1056 -0
- data/test/unit/asset_management.rb +245 -0
- data/test/unit/clipboard_test.rb +60 -0
- data/test/unit/contract_test.rb +91 -0
- data/test/unit/core.rb +857 -0
- data/test/unit/deploy_test.rb +187 -0
- data/test/unit/gem_asset_management.rb +189 -0
- data/test/unit/livetext_basic.rb +69 -0
- data/test/unit/livetext_compatibility.rb +89 -0
- data/test/unit/post.rb +244 -0
- data/test/unit/read_commented_file_test.rb +276 -0
- data/test/unit/reddit_test.rb +235 -0
- data/test/unit/repo.rb +548 -0
- data/test/unit/social_test.rb +369 -0
- data/test/unit/symlink_test.rb +213 -0
- data/test/unit/view.rb +431 -0
- data/test/unit/widgets.rb +669 -0
- data/test/wizard_test.rb +123 -0
- data/ui/README.md +67 -0
- data/ui/common/lib/ui_common.rb +8 -0
- data/ui/rubytext/README.md +191 -0
- data/ui/rubytext/bin/scriptorium-rubytext +402 -0
- data/ui/rubytext/lib/rubytext_ui.rb +300 -0
- data/ui/tui/bin/scriptorium +1420 -0
- data/ui/tui/test/tui_test.rb +23 -0
- data/ui/web/app/app.rb +1378 -0
- data/ui/web/app/error_helpers.rb +150 -0
- data/ui/web/app/views/advanced_config.erb +190 -0
- data/ui/web/app/views/asset_management.erb +589 -0
- data/ui/web/app/views/banner_config.erb +200 -0
- data/ui/web/app/views/configure_view.erb +401 -0
- data/ui/web/app/views/dashboard.erb +162 -0
- data/ui/web/app/views/deploy_config.erb +146 -0
- data/ui/web/app/views/edit_pages.erb +195 -0
- data/ui/web/app/views/edit_post.erb +54 -0
- data/ui/web/app/views/error_page.erb +29 -0
- data/ui/web/app/views/header_config.erb +155 -0
- data/ui/web/app/views/layout_config.erb +147 -0
- data/ui/web/app/views/navbar_config.erb +411 -0
- data/ui/web/app/views/view_dashboard.erb +138 -0
- data/ui/web/bin/scriptorium-web +153 -0
- data/ui/web/test/web_basic_test.rb +38 -0
- data/ui/web/test_navbar.txt +7 -0
- data/ui/web/tmp/web_server.log +5 -0
- data/ui/web/tmp/web_server.pid +1 -0
- metadata +360 -5
data/README.md
CHANGED
@@ -1 +1,3155 @@
|
|
1
|
-
|
1
|
+
<b>Scriptorium</b> is a major refactoring (rewrite) of Runeblog, which had an unwieldy and
|
2
|
+
fragile code base. The plan now is to develop with more of a test-first approach (and
|
3
|
+
with AI support from ChatGPT and Gemini).
|
4
|
+
|
5
|
+
<hr>
|
6
|
+
|
7
|
+
<h2>Scriptorium User Guide</h2>
|
8
|
+
<i>In progress</i>
|
9
|
+
<p>
|
10
|
+
|
11
|
+
# 1. Core Concepts
|
12
|
+
|
13
|
+
## What is Scriptorium?
|
14
|
+
|
15
|
+
Scriptorium is a static site generator designed for creating and managing multiple blogs or content sites from a single installation. It combines the simplicity of static file generation with the power of a multi-view architecture, allowing you to maintain several distinct websites with shared infrastructure.
|
16
|
+
|
17
|
+
### Static Files Philosophy
|
18
|
+
|
19
|
+
Scriptorium generates static HTML, CSS, and JavaScript files. This approach offers several key benefits:
|
20
|
+
|
21
|
+
- **Performance**: Static files load quickly and can be served efficiently by any web server
|
22
|
+
- **Reliability**: No server-side processing means fewer points of failure
|
23
|
+
- **Security**: No dynamic code execution reduces attack vectors
|
24
|
+
- **Scalability**: Static files can be served by CDNs and cached effectively
|
25
|
+
- **Simplicity**: No database setup, server configuration, or runtime dependencies
|
26
|
+
|
27
|
+
When you publish content with Scriptorium, it generates a complete set of static files that can be deployed to any web hosting service - from simple file hosting to sophisticated CDN networks.
|
28
|
+
|
29
|
+
### Multi-View Architecture
|
30
|
+
|
31
|
+
Scriptorium's most distinctive feature is its **multi-view architecture**. Instead of managing separate installations for different blogs or websites, you can create multiple "views" within a single Scriptorium repository.
|
32
|
+
|
33
|
+
**What is a view?**
|
34
|
+
A view represents a complete, independent website or blog. Each view has its own:
|
35
|
+
- Configuration settings
|
36
|
+
- Theme and styling
|
37
|
+
- Content (posts, pages, widgets)
|
38
|
+
- Deployment settings
|
39
|
+
- URL structure
|
40
|
+
|
41
|
+
**Why use views?**
|
42
|
+
- **Efficiency**: Manage multiple sites from one installation
|
43
|
+
- **Consistency**: Share themes, templates, and infrastructure
|
44
|
+
- **Flexibility**: Each view can have completely different content and styling
|
45
|
+
- **Maintenance**: Update core functionality across all views at once
|
46
|
+
|
47
|
+
For example, you might have:
|
48
|
+
- A personal blog view
|
49
|
+
- A professional portfolio view
|
50
|
+
- A project documentation view
|
51
|
+
- A photo gallery view
|
52
|
+
|
53
|
+
All managed from the same Scriptorium installation, with shared themes and infrastructure but completely independent content.
|
54
|
+
|
55
|
+
### Repository Structure
|
56
|
+
|
57
|
+
A Scriptorium repository is a directory that contains everything needed to manage your views and generate your websites. The repository structure follows a logical organization:
|
58
|
+
|
59
|
+
```
|
60
|
+
scriptorium/
|
61
|
+
├── config/ # Global configuration files
|
62
|
+
├── views/ # Individual view directories
|
63
|
+
│ ├── personal/ # Personal blog view
|
64
|
+
│ ├── portfolio/ # Professional portfolio view
|
65
|
+
│ └── docs/ # Documentation view
|
66
|
+
├── drafts/ # Draft posts (global)
|
67
|
+
├── posts/ # Generated posts (global)
|
68
|
+
├── assets/ # Shared images and files
|
69
|
+
├── themes/ # Theme templates
|
70
|
+
└── scripts/ # Utility scripts
|
71
|
+
```
|
72
|
+
|
73
|
+
**Key Repository Concepts:**
|
74
|
+
- **Global vs View-specific**: Some content (like posts) is global and can be shared across views, while other content (like view configuration) is specific to each view
|
75
|
+
- **Separation of concerns**: Content, presentation, and configuration are clearly separated
|
76
|
+
- **Version control friendly**: The entire repository can be managed with Git or similar tools
|
77
|
+
|
78
|
+
### Deployment Overview
|
79
|
+
|
80
|
+
Scriptorium generates static files that can be deployed to virtually any web hosting service. The deployment process is straightforward:
|
81
|
+
|
82
|
+
1. **Generate content**: Scriptorium processes your content and generates static HTML files
|
83
|
+
2. **Upload files**: Transfer the generated files to your web server
|
84
|
+
3. **Serve content**: Your web server serves the static files to visitors
|
85
|
+
|
86
|
+
**Deployment options include:**
|
87
|
+
- Traditional web hosting (shared hosting, VPS, dedicated servers)
|
88
|
+
- Static hosting services (Netlify, Vercel, GitHub Pages)
|
89
|
+
- Content delivery networks (CDN) for global performance
|
90
|
+
- Cloud storage with web serving capabilities
|
91
|
+
|
92
|
+
The static nature of Scriptorium's output means you have maximum flexibility in choosing where and how to host your content. [Detailed deployment instructions are covered in Section 9.]
|
93
|
+
|
94
|
+
## What is LiveText?
|
95
|
+
|
96
|
+
LiveText is a templating and content processing system that powers Scriptorium's content generation. It provides a simple, powerful way to create dynamic content while maintaining the benefits of static file generation.
|
97
|
+
|
98
|
+
### Why LiveText?
|
99
|
+
|
100
|
+
Scriptorium could have used any number of templating systems (Markdown, Liquid, ERB, etc.), but LiveText was chosen for several key reasons:
|
101
|
+
|
102
|
+
- **Simplicity**: LiveText syntax is straightforward and easy to learn
|
103
|
+
- **Power**: Despite its simplicity, LiveText is capable of complex content processing
|
104
|
+
- **Integration**: LiveText integrates seamlessly with Ruby, allowing for custom functions and logic
|
105
|
+
- **Flexibility**: LiveText can handle both simple content formatting and complex dynamic generation
|
106
|
+
- **Consistency**: LiveText provides a unified approach to content, templates, and configuration
|
107
|
+
|
108
|
+
LiveText bridges the gap between static content and dynamic generation, allowing you to create sophisticated websites while maintaining the performance and reliability benefits of static files.
|
109
|
+
|
110
|
+
### LiveText Syntax in Brief
|
111
|
+
|
112
|
+
LiveText uses a simple but powerful syntax based on "dot commands" and inline formatting. Here's a quick overview:
|
113
|
+
|
114
|
+
**Inline formatting:**
|
115
|
+
```
|
116
|
+
This is *bold and this is _italic text.
|
117
|
+
This is *[multiple words boldfaced].
|
118
|
+
```
|
119
|
+
|
120
|
+
**Dot commands with parameters:**
|
121
|
+
```
|
122
|
+
.title My Blog Post
|
123
|
+
.date 2025-07-29
|
124
|
+
.tags ruby, programming, blog
|
125
|
+
|
126
|
+
.link https://example.com Visit Example
|
127
|
+
.image /images/photo.jpg My Photo
|
128
|
+
```
|
129
|
+
|
130
|
+
**Dot commands with body content:**
|
131
|
+
```
|
132
|
+
.quote
|
133
|
+
This is an inset quote.
|
134
|
+
Wherever you go,
|
135
|
+
there you are.
|
136
|
+
.end
|
137
|
+
```
|
138
|
+
|
139
|
+
**Variables and functions:**
|
140
|
+
```
|
141
|
+
This file is called $File (predefined var).
|
142
|
+
The current time is: $$time
|
143
|
+
This post has $$word_count words.
|
144
|
+
```
|
145
|
+
|
146
|
+
LiveText's syntax is designed to be readable and writable, making it easy to create content without getting bogged down in complex templating syntax. [Complete LiveText documentation is provided in Section 3.]
|
147
|
+
|
148
|
+
---
|
149
|
+
# 2. Getting Started
|
150
|
+
|
151
|
+
## Quick Installation
|
152
|
+
|
153
|
+
Scriptorium is distributed as a Ruby gem, making installation straightforward:
|
154
|
+
|
155
|
+
```bash
|
156
|
+
gem install scriptorium
|
157
|
+
```
|
158
|
+
|
159
|
+
**Prerequisites:**
|
160
|
+
- Ruby 2.7 or higher
|
161
|
+
|
162
|
+
After installation, you'll have access to the `scriptorium` command-line tool, which provides an interactive interface for managing your blogs and content.
|
163
|
+
|
164
|
+
## Interactive Setup
|
165
|
+
|
166
|
+
The easiest way to get started with Scriptorium is through the interactive setup process. Simply run:
|
167
|
+
|
168
|
+
```bash
|
169
|
+
scriptorium
|
170
|
+
```
|
171
|
+
|
172
|
+
This launches the interactive Scriptorium tool, which will guide you through the initial setup.
|
173
|
+
|
174
|
+
### Creating Your First Repository
|
175
|
+
|
176
|
+
When you first run Scriptorium, it will detect that no repository exists and offer to create one:
|
177
|
+
|
178
|
+
```
|
179
|
+
No repository found.
|
180
|
+
Create new repository? (y/n): y
|
181
|
+
```
|
182
|
+
|
183
|
+
The repository will be created in your home directory as `~/.scriptorium` by default. This directory will contain all your views, posts, themes, and configuration.
|
184
|
+
|
185
|
+
### Creating Your First View
|
186
|
+
|
187
|
+
After creating the repository, Scriptorium will offer to help you create your first view:
|
188
|
+
|
189
|
+
```
|
190
|
+
Do you want assistance in creating your first view? (y/n): y
|
191
|
+
```
|
192
|
+
|
193
|
+
A view represents a complete website or blog. You'll be prompted for:
|
194
|
+
- **View name**: A short identifier (e.g., "personal", "blog", "portfolio")
|
195
|
+
- **View title**: The full title that appears on your website
|
196
|
+
- **View subtitle**: An optional subtitle or description
|
197
|
+
|
198
|
+
For example:
|
199
|
+
```
|
200
|
+
View name: personal
|
201
|
+
View title: My Personal Blog
|
202
|
+
View subtitle: Thoughts on programming and life
|
203
|
+
```
|
204
|
+
|
205
|
+
### The Sample View
|
206
|
+
|
207
|
+
Scriptorium automatically creates a sample view to help you get started. This view includes:
|
208
|
+
- A basic theme with responsive design
|
209
|
+
- Sample configuration files
|
210
|
+
- Example posts and pages
|
211
|
+
- Widget configurations
|
212
|
+
|
213
|
+
You can explore the sample view to understand how Scriptorium works, then customize it or create new views for your specific needs.
|
214
|
+
|
215
|
+
### Basic Commands
|
216
|
+
|
217
|
+
Once your repository is set up, you can use these basic commands in the Scriptorium shell:
|
218
|
+
|
219
|
+
**View management:**
|
220
|
+
```
|
221
|
+
view # Show current view
|
222
|
+
list views # List all views
|
223
|
+
change view <name> # Switch to a different view
|
224
|
+
new view <name> <title> # Create a new view
|
225
|
+
```
|
226
|
+
|
227
|
+
**Content management:**
|
228
|
+
```
|
229
|
+
list posts # List posts in current view
|
230
|
+
list drafts # List draft posts
|
231
|
+
new post <title> # Create a new post
|
232
|
+
```
|
233
|
+
|
234
|
+
**Generation and deployment:**
|
235
|
+
```
|
236
|
+
generate # Regenerate current view
|
237
|
+
preview # Preview current view locally
|
238
|
+
deploy # Deploy current view to server
|
239
|
+
```
|
240
|
+
|
241
|
+
**Help and information:**
|
242
|
+
```
|
243
|
+
help # Show available commands
|
244
|
+
version # Show Scriptorium version
|
245
|
+
quit # Exit Scriptorium shell
|
246
|
+
```
|
247
|
+
|
248
|
+
## Basic Configuration
|
249
|
+
|
250
|
+
### Editor Setup
|
251
|
+
|
252
|
+
Scriptorium uses your preferred text editor for creating and editing content. For simplicity and lack of distraction, something like vim or emacs is recommended. (The ancient editor ed is mentioned here partly as a joke; but in fact, Scriptorium does use ed in automated testing.)
|
253
|
+
|
254
|
+
On first use, you'll be prompted to choose an editor:
|
255
|
+
|
256
|
+
```
|
257
|
+
Available editors:
|
258
|
+
1. nano
|
259
|
+
2. vim
|
260
|
+
3. emacs
|
261
|
+
4. ed
|
262
|
+
|
263
|
+
Choose editor (1-4): 1
|
264
|
+
```
|
265
|
+
|
266
|
+
Your choice is saved in `config/editor.txt` and will be used for all future editing sessions.
|
267
|
+
|
268
|
+
**Recommended editors:**
|
269
|
+
- **nano**: Simple and beginner-friendly
|
270
|
+
- **vim**: Powerful and efficient for experienced users
|
271
|
+
- **emacs**: Feature-rich with extensive customization
|
272
|
+
- **ed**: Minimal line editor for automation
|
273
|
+
|
274
|
+
### View Configuration
|
275
|
+
|
276
|
+
Each view has its own configuration file at `views/<viewname>/config.txt`. This file contains basic settings:
|
277
|
+
|
278
|
+
```
|
279
|
+
title My Personal Blog
|
280
|
+
subtitle Thoughts on programming and life
|
281
|
+
theme standard
|
282
|
+
```
|
283
|
+
|
284
|
+
**Key configuration options:**
|
285
|
+
- **title**: The main title of your website
|
286
|
+
- **subtitle**: A subtitle or description
|
287
|
+
- **theme**: The theme to use for this view
|
288
|
+
- **deploy_url**: The URL where this view is deployed (optional)
|
289
|
+
|
290
|
+
### Global Configuration
|
291
|
+
|
292
|
+
Global settings are stored in the `config/` directory:
|
293
|
+
|
294
|
+
- **editor.txt**: Your preferred text editor
|
295
|
+
- **last_post_num.txt**: Tracks the last post number used
|
296
|
+
- **currentview.txt**: Remembers which view was last active
|
297
|
+
|
298
|
+
Typically you would not change any of these manually. The last two especially are managed internally by Scriptorium.
|
299
|
+
|
300
|
+
## Checking Dependencies
|
301
|
+
|
302
|
+
Scriptorium includes a comprehensive dependency checker to ensure all required tools are available:
|
303
|
+
|
304
|
+
```bash
|
305
|
+
ruby scripts/check_dependencies.rb
|
306
|
+
```
|
307
|
+
|
308
|
+
This will check for:
|
309
|
+
- **Core dependencies**: Ruby (required for all features)
|
310
|
+
- **Feature dependencies**:
|
311
|
+
- Python 3 (for syntax highlighting and RSS validation)
|
312
|
+
- Redd gem (Ruby Reddit API wrapper for autoposting)
|
313
|
+
- LiveText (Scriptorium's templating system)
|
314
|
+
- ImageMagick (for image processing and thumbnails)
|
315
|
+
- Pygments (for code syntax highlighting)
|
316
|
+
- Feed Validator (for RSS feed validation)
|
317
|
+
- **Configuration requirements**: SSH keys (for deployment), Reddit API credentials
|
318
|
+
|
319
|
+
The checker provides specific installation instructions for any missing dependencies.
|
320
|
+
|
321
|
+
**Example output:**
|
322
|
+
```
|
323
|
+
🔍 Scriptorium Dependency Checker
|
324
|
+
==================================================
|
325
|
+
|
326
|
+
📊 Dependency Status
|
327
|
+
==================================================
|
328
|
+
|
329
|
+
Individual Dependencies:
|
330
|
+
------------------------------
|
331
|
+
Ruby ✅ Available
|
332
|
+
Python 3 ✅ Available
|
333
|
+
Redd gem (Reddit API) ❌ Missing
|
334
|
+
LiveText ✅ Available
|
335
|
+
ImageMagick ✅ Available
|
336
|
+
|
337
|
+
Feature Availability:
|
338
|
+
------------------------------
|
339
|
+
Core Blogging ✅ Ready
|
340
|
+
Reddit Button ✅ Ready
|
341
|
+
Reddit Autopost ❌ Missing Dependencies
|
342
|
+
Missing: redd
|
343
|
+
```
|
344
|
+
|
345
|
+
## The "Standard" Theme
|
346
|
+
|
347
|
+
Scriptorium comes with a single theme called "standard" that provides a clean, responsive design suitable for most blogs and websites.
|
348
|
+
|
349
|
+
The standard theme includes:
|
350
|
+
- **Responsive design**: Works well on desktop, tablet, and mobile
|
351
|
+
- **Clean typography**: Readable fonts and spacing
|
352
|
+
- **Flexible layout**: Header, footer, main content, and optional sidebars
|
353
|
+
- **Widget support**: Ready-to-use widgets for common content
|
354
|
+
- **Social integration**: Built-in support for social media features
|
355
|
+
|
356
|
+
Any future (or cloned) theme will have essentially the same structure. The standard theme is located in `themes/standard/` and includes:
|
357
|
+
|
358
|
+
```
|
359
|
+
themes/standard/
|
360
|
+
├── templates/ # LiveText templates
|
361
|
+
│ ├── post.lt3 # Individual post template
|
362
|
+
│ ├── index.lt3 # Front page template
|
363
|
+
│ └── widget.lt3 # Widget template
|
364
|
+
├── layout/ # Layout configuration
|
365
|
+
│ ├── layout.txt # Layout definition
|
366
|
+
│ ├── config/ # Layout components
|
367
|
+
│ └── gen/ # Generated CSS/HTML
|
368
|
+
└── assets/ # Theme assets (images, etc.)
|
369
|
+
```
|
370
|
+
|
371
|
+
### Customizing the Theme
|
372
|
+
|
373
|
+
You can customize the standard theme by:
|
374
|
+
1. **Cloning it**: `clone standard mytheme` (creates a copy to modify)
|
375
|
+
2. **Editing templates**: Modify the LiveText templates in `templates/`
|
376
|
+
3. **Adjusting layout**: Change the layout configuration in `layout/`
|
377
|
+
4. **Adding assets**: Include custom images, CSS, or JavaScript
|
378
|
+
|
379
|
+
Predefined themes are considered immutable. Of course, there is only one at this point. Later on, there should be a distinction between predefined and user-defined (or cloned) themes.
|
380
|
+
|
381
|
+
[Detailed theme customization is covered in Section 7.]
|
382
|
+
|
383
|
+
---
|
384
|
+
|
385
|
+
# 3. LiveText Basics
|
386
|
+
|
387
|
+
## What is LiveText?
|
388
|
+
|
389
|
+
**[TO BE DONE]
|
390
|
+
|
391
|
+
---
|
392
|
+
|
393
|
+
# 4. The Front Page
|
394
|
+
|
395
|
+
## Containers and Their Uses
|
396
|
+
|
397
|
+
The front page of your Scriptorium view is built using a container-based layout system. Each container serves a specific purpose and can be configured independently:
|
398
|
+
|
399
|
+
**Front page containers:**
|
400
|
+
- **Header**: Contains the banner, navigation, and site branding
|
401
|
+
- **Left**: Optional sidebar for widgets and additional content
|
402
|
+
- **Main**: The primary content area, typically showing post listings
|
403
|
+
- **Right**: Optional sidebar for widgets and additional content
|
404
|
+
- **Footer**: Site footer with links and information
|
405
|
+
|
406
|
+
```
|
407
|
+
+------------------------------------------+
|
408
|
+
| Header |
|
409
|
+
| (banner, title, subtitle, navigation) |
|
410
|
+
+------------------------------------------+
|
411
|
+
| | | |
|
412
|
+
| Left | Main | Right |
|
413
|
+
| Sidebar| (post index) | Sidebar |
|
414
|
+
| | | |
|
415
|
+
+------------------------------------------+
|
416
|
+
| Footer |
|
417
|
+
+------------------------------------------+
|
418
|
+
```
|
419
|
+
|
420
|
+
## Configuring Header
|
421
|
+
|
422
|
+
### Banner and Title
|
423
|
+
|
424
|
+
The header configuration is defined in `views/<viewname>/config/header.txt`. The header can include:
|
425
|
+
|
426
|
+
```
|
427
|
+
# Header configuration example
|
428
|
+
title
|
429
|
+
subtitle
|
430
|
+
banner svg
|
431
|
+
nav
|
432
|
+
```
|
433
|
+
|
434
|
+
**Header components:**
|
435
|
+
- **title**: Displays the view title as an H1 heading
|
436
|
+
- **subtitle**: Displays the view subtitle as a paragraph
|
437
|
+
- **banner svg**: Generates an SVG banner using the BannerSVG system
|
438
|
+
- **banner <filename>**: Uses an image file as the banner
|
439
|
+
- **nav**: Includes navigation using `navbar.txt`
|
440
|
+
- **nav <filename>**: Uses a custom navigation file
|
441
|
+
|
442
|
+
### Navigation Bar
|
443
|
+
|
444
|
+
Navigation is configured in `views/<viewname>/config/navbar.txt` using a simple syntax:
|
445
|
+
|
446
|
+
```
|
447
|
+
=About
|
448
|
+
Vision & Mission mission
|
449
|
+
Board of Directors board
|
450
|
+
Partners partners
|
451
|
+
How You Can Help howtohelp
|
452
|
+
-Social Media socmed
|
453
|
+
=Resources
|
454
|
+
Space links links
|
455
|
+
Space on Twitter twitter
|
456
|
+
Space on Instagram instagram
|
457
|
+
Space Newsfeeds rssnews
|
458
|
+
-Companion sites oursites
|
459
|
+
-Blog embed-blog
|
460
|
+
-Contact contact
|
461
|
+
```
|
462
|
+
|
463
|
+
**Navigation syntax:**
|
464
|
+
- **=** - Top-level menu item with children
|
465
|
+
- **space** - Child of previous "=" item
|
466
|
+
- **-** - Top-level menu item without children
|
467
|
+
- **Label** - The text displayed in the menu
|
468
|
+
- **Filename** - The HTML file to open (without .html extension)
|
469
|
+
|
470
|
+
The navigation generates a Bootstrap navbar with responsive design.
|
471
|
+
|
472
|
+
## Configuring Sidebars
|
473
|
+
|
474
|
+
Sidebars are optional containers that can appear on the left or right side of your main content. They're perfect for widgets and additional information.
|
475
|
+
|
476
|
+
**Sidebar configuration:**
|
477
|
+
Sidebars are configured through the layout system and can contain widgets. The layout determines whether sidebars appear and on which side.
|
478
|
+
|
479
|
+
## The Main Container: Post Index
|
480
|
+
|
481
|
+
The main container is where your primary content appears. On the front page, this typically shows a listing of your blog posts:
|
482
|
+
|
483
|
+
**Post listing features:**
|
484
|
+
- **Chronological order**: Posts appear newest first
|
485
|
+
- **Post entries**: Each post shows title, date, and excerpt
|
486
|
+
- **Pagination**: Automatically paginates when you have many posts
|
487
|
+
- **Read more links**: Links to the full post content
|
488
|
+
|
489
|
+
## Widgets
|
490
|
+
|
491
|
+
Widgets are reusable content components that can be placed in sidebars. Scriptorium includes several built-in widgets:
|
492
|
+
|
493
|
+
### Links Widget
|
494
|
+
|
495
|
+
The Links widget displays a list of external links. Configuration is in `config/widgets.txt`:
|
496
|
+
|
497
|
+
```
|
498
|
+
links
|
499
|
+
```
|
500
|
+
|
501
|
+
**Links widget data:**
|
502
|
+
Links are defined in `config/links.txt` with one link per line:
|
503
|
+
|
504
|
+
```
|
505
|
+
https://ruby-lang.org, Ruby Language
|
506
|
+
https://github.com, GitHub
|
507
|
+
https://stackoverflow.com, Stack Overflow
|
508
|
+
```
|
509
|
+
|
510
|
+
**Format:** `URL, Title`
|
511
|
+
|
512
|
+
**Links widget features:**
|
513
|
+
- **External links**: Link to any external website
|
514
|
+
- **Simple configuration**: One link per line in CSV format
|
515
|
+
- **Automatic generation**: Creates clickable links with titles
|
516
|
+
|
517
|
+
### Pages Widget
|
518
|
+
|
519
|
+
The Pages widget displays links to your static pages. Configuration is in `config/widgets.txt`:
|
520
|
+
|
521
|
+
```
|
522
|
+
pages
|
523
|
+
```
|
524
|
+
|
525
|
+
**Pages widget data:**
|
526
|
+
Pages are defined in `config/pages.txt` with one page per line:
|
527
|
+
|
528
|
+
```
|
529
|
+
about
|
530
|
+
contact
|
531
|
+
mission
|
532
|
+
board
|
533
|
+
```
|
534
|
+
|
535
|
+
**Format:** `filename` (without .html extension)
|
536
|
+
|
537
|
+
**Pages widget features:**
|
538
|
+
- **Automatic discovery**: Finds pages in your `pages/` directory
|
539
|
+
- **Title extraction**: Automatically extracts titles from page HTML
|
540
|
+
- **Simple configuration**: Just list the page filenames
|
541
|
+
|
542
|
+
### Featured Posts Widget
|
543
|
+
|
544
|
+
The Featured Posts widget highlights specific posts. Configuration is in `config/widgets.txt`:
|
545
|
+
|
546
|
+
```
|
547
|
+
featuredposts
|
548
|
+
```
|
549
|
+
|
550
|
+
**Featured posts data:**
|
551
|
+
Posts are defined in `config/featuredposts.txt` with one post per line:
|
552
|
+
|
553
|
+
```
|
554
|
+
my-first-post
|
555
|
+
important-announcement
|
556
|
+
tutorial-series-part-1
|
557
|
+
```
|
558
|
+
|
559
|
+
**Format:** `post_id` or `post_id Title` (title is optional)
|
560
|
+
|
561
|
+
**Featured posts features:**
|
562
|
+
- **Manual selection**: Choose which posts to feature
|
563
|
+
- **Title fallback**: Uses post metadata if no title specified
|
564
|
+
- **Error handling**: Shows error message if post doesn't exist
|
565
|
+
|
566
|
+
## Widget Placement
|
567
|
+
|
568
|
+
While in theory, a widget can be placed in any container, typically they will go in a sidebar (left or right). Putting a widget anywhere else has not been tested, and you will be on your own.
|
569
|
+
|
570
|
+
**Widget configuration example:**
|
571
|
+
```
|
572
|
+
# In config/widgets.txt
|
573
|
+
links
|
574
|
+
pages
|
575
|
+
featuredposts
|
576
|
+
```
|
577
|
+
|
578
|
+
This enables all three available widgets. The layout system determines where they appear.
|
579
|
+
|
580
|
+
## Widget Data Files
|
581
|
+
|
582
|
+
Each widget requires a corresponding data file in the `config/` directory:
|
583
|
+
|
584
|
+
- **links.txt** - External links for the Links widget
|
585
|
+
- **pages.txt** - Page filenames for the Pages widget
|
586
|
+
- **featuredposts.txt** - Post IDs for the Featured Posts widget
|
587
|
+
|
588
|
+
**Example data files:**
|
589
|
+
|
590
|
+
`config/links.txt`:
|
591
|
+
```
|
592
|
+
https://ruby-lang.org, Ruby Language
|
593
|
+
https://github.com, GitHub
|
594
|
+
```
|
595
|
+
|
596
|
+
`config/pages.txt`:
|
597
|
+
```
|
598
|
+
about
|
599
|
+
contact
|
600
|
+
mission
|
601
|
+
```
|
602
|
+
|
603
|
+
`config/featuredposts.txt`:
|
604
|
+
```
|
605
|
+
my-first-post
|
606
|
+
important-announcement
|
607
|
+
```
|
608
|
+
|
609
|
+
## Customizing Widget Appearance
|
610
|
+
|
611
|
+
Widgets generate HTML files in `widgets/<widgetname>/<widgetname>-card.html` that can be customized. Each widget uses Bootstrap styling and can be modified through CSS classes.
|
612
|
+
|
613
|
+
The front page layout system provides flexibility while maintaining consistency across your site. By combining different containers and widgets, you can create a front page that perfectly suits your content and audience.
|
614
|
+
|
615
|
+
---
|
616
|
+
|
617
|
+
# 5. Managing Posts
|
618
|
+
|
619
|
+
**[Errors here - fix later. HF]
|
620
|
+
|
621
|
+
## Creating Posts
|
622
|
+
|
623
|
+
Creating new posts is one of the most common tasks in Scriptorium. Posts are the core content of your blog or website.
|
624
|
+
|
625
|
+
### Using the Interactive Shell
|
626
|
+
|
627
|
+
The easiest way to create a post is through the Scriptorium interactive shell:
|
628
|
+
|
629
|
+
```
|
630
|
+
scriptorium
|
631
|
+
```
|
632
|
+
|
633
|
+
Once in the shell, you have two options for creating content:
|
634
|
+
|
635
|
+
**Create a draft:**
|
636
|
+
```
|
637
|
+
new draft My First Blog Post
|
638
|
+
```
|
639
|
+
|
640
|
+
**Create a post directly:**
|
641
|
+
```
|
642
|
+
new post My First Blog Post
|
643
|
+
```
|
644
|
+
|
645
|
+
### Drafts vs Posts
|
646
|
+
|
647
|
+
**Drafts** are temporary files for working on content:
|
648
|
+
- Stored in `drafts/` directory
|
649
|
+
- Filename format: `YYYYMMDD-HHMMSS-draft.lt3`
|
650
|
+
- Use `list drafts` to see all drafts
|
651
|
+
- Use `new draft` to create a draft
|
652
|
+
|
653
|
+
**Posts** are the final published content:
|
654
|
+
- Stored in `posts/` directory
|
655
|
+
- Directory format: `posts/0123/` (4-digit padded numbers)
|
656
|
+
- Use `list posts` to see all posts
|
657
|
+
- Use `new post` to create a post directly
|
658
|
+
|
659
|
+
### Post File Structure
|
660
|
+
|
661
|
+
Each post consists of a directory with the following structure:
|
662
|
+
|
663
|
+
**Post directory:** `posts/0123/`
|
664
|
+
- **source.lt3**: The post content in LiveText format
|
665
|
+
- **meta.txt**: Post metadata
|
666
|
+
- **body.html**: Generated HTML (created during generation)
|
667
|
+
- **assets/**: Directory for post-specific assets
|
668
|
+
|
669
|
+
**Post metadata file:** `posts/0123/meta.txt`
|
670
|
+
- Contains post metadata like title, date, author
|
671
|
+
- Automatically generated and updated by Scriptorium
|
672
|
+
|
673
|
+
### Post Content Format
|
674
|
+
|
675
|
+
Posts use LiveText format (see Section 3 for details). A typical post structure:
|
676
|
+
|
677
|
+
```
|
678
|
+
.h1 My First Blog Post
|
679
|
+
.h2 subtitle: Getting Started with Scriptorium
|
680
|
+
|
681
|
+
.p This is my first blog post using Scriptorium.
|
682
|
+
|
683
|
+
.h2 Why Scriptorium?
|
684
|
+
|
685
|
+
.p Scriptorium makes blogging simple and powerful.
|
686
|
+
|
687
|
+
.list
|
688
|
+
**Easy to use** - Simple command-line interface
|
689
|
+
**Flexible** - Multiple views and themes
|
690
|
+
**Fast** - Static site generation
|
691
|
+
**Customizable** - LiveText templating system
|
692
|
+
.end
|
693
|
+
|
694
|
+
.p That's it for my first post!
|
695
|
+
```
|
696
|
+
|
697
|
+
## Listing Content
|
698
|
+
|
699
|
+
### View All Posts
|
700
|
+
|
701
|
+
To see all posts in your current view:
|
702
|
+
|
703
|
+
```
|
704
|
+
list posts
|
705
|
+
```
|
706
|
+
|
707
|
+
This shows:
|
708
|
+
- Post title
|
709
|
+
- Post number
|
710
|
+
|
711
|
+
### View All Drafts
|
712
|
+
|
713
|
+
To see all drafts:
|
714
|
+
|
715
|
+
```
|
716
|
+
list drafts
|
717
|
+
```
|
718
|
+
|
719
|
+
This shows:
|
720
|
+
- Draft filename
|
721
|
+
- Draft title
|
722
|
+
|
723
|
+
## Editing Posts
|
724
|
+
|
725
|
+
### Opening a Post for Editing
|
726
|
+
|
727
|
+
To edit an existing post, you'll need to open the post file directly in your editor. Posts are stored in `posts/0123/source.lt3`.
|
728
|
+
|
729
|
+
### Post Numbering
|
730
|
+
|
731
|
+
Post numbers are sequential integers with 4-digit padding:
|
732
|
+
- **Format**: 4-digit padded numbers (0001, 0002, 0003, etc.)
|
733
|
+
- **Automatic**: Numbers are assigned when posts are created
|
734
|
+
- **Sequential**: Numbers increment automatically
|
735
|
+
|
736
|
+
### Finding Post Numbers
|
737
|
+
|
738
|
+
You can find post numbers by:
|
739
|
+
1. Using `list posts` to see all posts
|
740
|
+
2. Looking in the `posts/` directory
|
741
|
+
3. Checking the post metadata file
|
742
|
+
|
743
|
+
## Deleting Posts
|
744
|
+
|
745
|
+
### Marking Posts for Deletion
|
746
|
+
|
747
|
+
To delete a post, Scriptorium moves the post directory to a deleted state:
|
748
|
+
|
749
|
+
- **Normal post**: `posts/0001/`
|
750
|
+
- **Deleted post**: `posts/_0001/` (with underscore prefix)
|
751
|
+
|
752
|
+
### Restoring Deleted Posts
|
753
|
+
|
754
|
+
To restore a deleted post, move the directory back from `posts/_0001/` to `posts/0001/`.
|
755
|
+
|
756
|
+
### Post Status
|
757
|
+
|
758
|
+
Posts can be in different states:
|
759
|
+
- **Published**: Post is live and visible on your site
|
760
|
+
- **Deleted**: Post is marked for deletion (moved to `_0001/` directory)
|
761
|
+
|
762
|
+
## Linking Posts
|
763
|
+
|
764
|
+
### Internal Links
|
765
|
+
|
766
|
+
You can link between posts using their post numbers:
|
767
|
+
|
768
|
+
```
|
769
|
+
.p Check out my [previous post](posts/0001.html) for more information.
|
770
|
+
```
|
771
|
+
|
772
|
+
### Cross-View Links
|
773
|
+
|
774
|
+
To link to a post in a different view:
|
775
|
+
|
776
|
+
```
|
777
|
+
.p See my [technical blog post](../tech/posts/0005.html) for more details.
|
778
|
+
```
|
779
|
+
|
780
|
+
## Unlinking Posts
|
781
|
+
|
782
|
+
### Removing Posts from Views
|
783
|
+
|
784
|
+
The `unlink_post` command removes a post from the current view but doesn't delete the post itself. It has no other effect on the post.
|
785
|
+
|
786
|
+
## Featured Posts
|
787
|
+
|
788
|
+
### Marking Posts as Featured
|
789
|
+
|
790
|
+
Featured posts appear in the Featured Posts widget (see Section 4). To feature a post:
|
791
|
+
|
792
|
+
1. Edit `widgets/featuredposts/list.txt`
|
793
|
+
2. Add the post number on a new line:
|
794
|
+
|
795
|
+
```
|
796
|
+
1
|
797
|
+
5
|
798
|
+
10
|
799
|
+
```
|
800
|
+
|
801
|
+
### Featured Post Order
|
802
|
+
|
803
|
+
Posts appear in the Featured Posts widget in the order listed in `widgets/featuredposts/list.txt`.
|
804
|
+
|
805
|
+
### Removing Featured Status
|
806
|
+
|
807
|
+
To remove a post from featured status:
|
808
|
+
|
809
|
+
1. Edit `widgets/featuredposts/list.txt`
|
810
|
+
2. Remove the post number from the list
|
811
|
+
3. Regenerate the view
|
812
|
+
|
813
|
+
## Post Organization
|
814
|
+
|
815
|
+
### Post Numbering
|
816
|
+
|
817
|
+
Scriptorium automatically assigns sequential post numbers:
|
818
|
+
- **Automatic**: Post numbers are assigned when posts are created
|
819
|
+
- **Sequential**: Numbers increment automatically (1, 2, 3, etc.)
|
820
|
+
- **Padded**: Stored as 4-digit padded numbers (0001, 0002, etc.)
|
821
|
+
|
822
|
+
### Post Sorting
|
823
|
+
|
824
|
+
Posts are typically displayed in chronological order (newest first), but you can customize this through:
|
825
|
+
- **Featured posts**: Manual ordering in the Featured Posts widget
|
826
|
+
- **Theme customization**: Modify how posts are sorted in your theme
|
827
|
+
|
828
|
+
### Post Categories
|
829
|
+
|
830
|
+
While Scriptorium doesn't have built-in categories, you can organize posts by:
|
831
|
+
- **Views**: Different views for different types of content
|
832
|
+
- **Tags**: Using tags in post content (see Section 3)
|
833
|
+
- **Featured posts**: Highlighting important posts
|
834
|
+
|
835
|
+
## Post Workflow
|
836
|
+
|
837
|
+
### Typical Post Creation Workflow
|
838
|
+
|
839
|
+
1. **Create**: `new post "Post Title"`
|
840
|
+
2. **Write**: Edit the post content in LiveText format
|
841
|
+
3. **Generate**: Use `generate` to build the final site
|
842
|
+
4. **Deploy**: Use `deploy` to publish to your server
|
843
|
+
|
844
|
+
### Draft Workflow
|
845
|
+
|
846
|
+
1. **Create draft**: `new draft "Draft Title"`
|
847
|
+
2. **Work on content**: Edit and refine the draft
|
848
|
+
3. **Convert**: When ready, convert draft to post
|
849
|
+
|
850
|
+
### Post Maintenance
|
851
|
+
|
852
|
+
Regular post maintenance tasks:
|
853
|
+
- **Review posts**: Use `list posts` to see all posts
|
854
|
+
- **Review drafts**: Use `list drafts` to see all drafts
|
855
|
+
- **Check links**: Verify internal links are working
|
856
|
+
- **Update featured**: Keep featured posts current
|
857
|
+
- **Clean up**: Remove old deleted posts
|
858
|
+
|
859
|
+
Most of this is intuitive. If it's not, the software probably was written incorrectly.
|
860
|
+
|
861
|
+
---
|
862
|
+
|
863
|
+
# 6. Managing Pages
|
864
|
+
|
865
|
+
Pages in Scriptorium are static HTML files that provide additional content beyond your blog posts. They're perfect for creating "About" pages, contact information, documentation, or any other static content you want to make available on your site.
|
866
|
+
|
867
|
+
## Used in navbar
|
868
|
+
|
869
|
+
Pages can be linked directly in your site's navigation bar. This is typically configured in the header section of your view.
|
870
|
+
|
871
|
+
To add a page to your navbar:
|
872
|
+
|
873
|
+
1. **Create the page file** in your view's `pages/` directory:
|
874
|
+
```bash
|
875
|
+
scriptorium edit pages/about.html
|
876
|
+
```
|
877
|
+
|
878
|
+
2. **Configure the navbar** in your view's header configuration:
|
879
|
+
```bash
|
880
|
+
scriptorium edit config/header.txt
|
881
|
+
```
|
882
|
+
|
883
|
+
3. **Add navigation links** to your header configuration file. The exact format depends on your theme, but typically looks like:
|
884
|
+
```
|
885
|
+
# Navigation links
|
886
|
+
.nav-link "About" "pages/about.html"
|
887
|
+
.nav-link "Contact" "pages/contact.html"
|
888
|
+
```
|
889
|
+
|
890
|
+
The navbar will automatically include these links, making your pages easily accessible from any part of your site.
|
891
|
+
|
892
|
+
## Used in Pages widget
|
893
|
+
|
894
|
+
Pages can also be displayed using the Pages widget, which creates a sidebar or footer list of your pages. This is useful for organizing related content or providing quick access to important pages.
|
895
|
+
|
896
|
+
To set up the Pages widget:
|
897
|
+
|
898
|
+
1. **Create the widget configuration**:
|
899
|
+
```bash
|
900
|
+
scriptorium edit widgets/pages/list.txt
|
901
|
+
```
|
902
|
+
|
903
|
+
2. **Add page references** to the list file. Each line should contain the page filename (without the `.html` extension):
|
904
|
+
```
|
905
|
+
about
|
906
|
+
contact
|
907
|
+
documentation
|
908
|
+
```
|
909
|
+
|
910
|
+
3. **Generate the widget**:
|
911
|
+
```bash
|
912
|
+
scriptorium generate widget pages
|
913
|
+
```
|
914
|
+
|
915
|
+
The Pages widget will automatically:
|
916
|
+
- Extract titles from the HTML files (using `<title>` tags or `<h1>` tags)
|
917
|
+
- Create clickable links to each page
|
918
|
+
- Skip any pages that don't exist (with a warning)
|
919
|
+
|
920
|
+
## Internal links
|
921
|
+
|
922
|
+
Pages can link to each other and to blog posts using internal links. This creates a connected web of content within your site.
|
923
|
+
|
924
|
+
### Linking between pages
|
925
|
+
|
926
|
+
In your page HTML, use JavaScript-based links that work with Scriptorium's navigation system:
|
927
|
+
|
928
|
+
```html
|
929
|
+
<a href="javascript:void(0)" onclick="load_main('pages/other-page.html')">Link to Another Page</a>
|
930
|
+
```
|
931
|
+
|
932
|
+
### Linking from pages to posts
|
933
|
+
|
934
|
+
You can also link from pages to specific blog posts:
|
935
|
+
|
936
|
+
```html
|
937
|
+
<a href="javascript:void(0)" onclick="load_main('posts/post-slug.html')">Link to Blog Post</a>
|
938
|
+
```
|
939
|
+
|
940
|
+
### Linking from posts to pages
|
941
|
+
|
942
|
+
In your blog posts, you can link to pages using the same pattern:
|
943
|
+
|
944
|
+
```html
|
945
|
+
<a href="javascript:void(0)" onclick="load_main('pages/about.html')">About Us</a>
|
946
|
+
```
|
947
|
+
|
948
|
+
## Subdirectories under pages/
|
949
|
+
|
950
|
+
For better organization, you can create subdirectories under the `pages/` directory. This is useful for grouping related pages or creating more complex site structures.
|
951
|
+
|
952
|
+
### Creating subdirectories
|
953
|
+
|
954
|
+
```bash
|
955
|
+
# Create a subdirectory
|
956
|
+
mkdir pages/documentation
|
957
|
+
|
958
|
+
# Create pages within the subdirectory
|
959
|
+
scriptorium edit pages/documentation/getting-started.html
|
960
|
+
scriptorium edit pages/documentation/advanced-usage.html
|
961
|
+
```
|
962
|
+
|
963
|
+
### Linking to subdirectory pages
|
964
|
+
|
965
|
+
When linking to pages in subdirectories, include the full path:
|
966
|
+
|
967
|
+
```html
|
968
|
+
<a href="javascript:void(0)" onclick="load_main('pages/documentation/getting-started.html')">Getting Started</a>
|
969
|
+
```
|
970
|
+
|
971
|
+
### Using subdirectories in the Pages widget
|
972
|
+
|
973
|
+
In your `widgets/pages/list.txt` file, you can reference subdirectory pages using relative paths:
|
974
|
+
|
975
|
+
```
|
976
|
+
about
|
977
|
+
contact
|
978
|
+
documentation/getting-started
|
979
|
+
documentation/advanced-usage
|
980
|
+
```
|
981
|
+
|
982
|
+
### Best practices for page organization
|
983
|
+
|
984
|
+
- **Use descriptive filenames**: `about.html`, `contact.html`, `privacy-policy.html`
|
985
|
+
- **Group related content**: Use subdirectories for documentation, guides, or multi-part content
|
986
|
+
- **Keep navigation simple**: Don't create too many levels of subdirectories
|
987
|
+
- **Use consistent naming**: Stick to lowercase with hyphens for multi-word filenames
|
988
|
+
- **Include proper titles**: Always use `<title>` tags in your HTML for better widget integration
|
989
|
+
|
990
|
+
### Page templates and styling
|
991
|
+
|
992
|
+
Pages inherit the same styling as your main site, so they'll automatically match your theme. You can include additional CSS or JavaScript in individual pages if needed, but it's generally better to keep styling consistent across your site.
|
993
|
+
|
994
|
+
### Managing page content
|
995
|
+
|
996
|
+
Since pages are static HTML files, you can edit them using any text editor or HTML editor. Scriptorium provides convenient commands for common page operations:
|
997
|
+
|
998
|
+
```bash
|
999
|
+
# Create a new page
|
1000
|
+
scriptorium edit pages/new-page.html
|
1001
|
+
|
1002
|
+
# List all pages in a view
|
1003
|
+
ls views/your-view/pages/
|
1004
|
+
|
1005
|
+
# Generate all content (including pages)
|
1006
|
+
scriptorium generate
|
1007
|
+
```
|
1008
|
+
|
1009
|
+
Pages are a powerful way to extend your Scriptorium site beyond just blog posts, allowing you to create a complete website with multiple types of content.
|
1010
|
+
|
1011
|
+
---
|
1012
|
+
|
1013
|
+
# 7. Customization
|
1014
|
+
|
1015
|
+
Scriptorium is designed to be highly customizable while maintaining simplicity. You can modify themes, create custom templates, and extend functionality through widgets and features.
|
1016
|
+
|
1017
|
+
## Themes and Styling (cloning)
|
1018
|
+
|
1019
|
+
Themes in Scriptorium control the overall look and feel of your site. Currently, Scriptorium comes with a "standard" theme, but you can clone and customize it to create your own unique design.
|
1020
|
+
|
1021
|
+
### Understanding themes
|
1022
|
+
|
1023
|
+
A theme consists of several components:
|
1024
|
+
- **Layout templates**: HTML structure for different page types
|
1025
|
+
- **CSS styling**: Visual appearance and responsive design
|
1026
|
+
- **Configuration files**: Default settings and options
|
1027
|
+
- **Assets**: Images, fonts, and other static files
|
1028
|
+
|
1029
|
+
### Cloning the standard theme
|
1030
|
+
|
1031
|
+
To create your own theme:
|
1032
|
+
|
1033
|
+
1. **Navigate to the themes directory**:
|
1034
|
+
```bash
|
1035
|
+
cd themes
|
1036
|
+
```
|
1037
|
+
|
1038
|
+
2. **Clone the standard theme**:
|
1039
|
+
```bash
|
1040
|
+
cp -r standard my-custom-theme
|
1041
|
+
```
|
1042
|
+
|
1043
|
+
3. **Update your view to use the new theme**:
|
1044
|
+
```bash
|
1045
|
+
scriptorium edit config.txt
|
1046
|
+
```
|
1047
|
+
|
1048
|
+
Change the theme line to:
|
1049
|
+
```
|
1050
|
+
theme: my-custom-theme
|
1051
|
+
```
|
1052
|
+
|
1053
|
+
### Customizing CSS
|
1054
|
+
|
1055
|
+
The main styling is controlled by CSS files in your theme:
|
1056
|
+
|
1057
|
+
- **`layout.css`**: Overall layout and responsive design
|
1058
|
+
- **`text.css`**: Typography and text styling
|
1059
|
+
- **`bootstrap.css`**: Bootstrap framework (if used)
|
1060
|
+
|
1061
|
+
To modify the appearance:
|
1062
|
+
|
1063
|
+
1. **Edit the CSS files** in your theme directory:
|
1064
|
+
```bash
|
1065
|
+
scriptorium edit themes/my-custom-theme/layout/gen/layout.css
|
1066
|
+
scriptorium edit themes/my-custom-theme/layout/gen/text.css
|
1067
|
+
```
|
1068
|
+
|
1069
|
+
2. **Common customizations**:
|
1070
|
+
- Change colors and fonts
|
1071
|
+
- Modify spacing and layout
|
1072
|
+
- Add custom animations
|
1073
|
+
- Adjust responsive breakpoints
|
1074
|
+
|
1075
|
+
3. **Regenerate your site** to see changes:
|
1076
|
+
```bash
|
1077
|
+
scriptorium generate
|
1078
|
+
```
|
1079
|
+
|
1080
|
+
### Theme structure
|
1081
|
+
|
1082
|
+
Understanding the theme directory structure helps with customization:
|
1083
|
+
|
1084
|
+
```
|
1085
|
+
my-custom-theme/
|
1086
|
+
├── assets/ # Images, fonts, etc.
|
1087
|
+
├── config.txt # Theme configuration
|
1088
|
+
├── header/ # Header templates
|
1089
|
+
├── initial/ # Initial content templates
|
1090
|
+
├── layout/ # Layout templates and CSS
|
1091
|
+
│ ├── config/ # Layout configuration files
|
1092
|
+
│ ├── gen/ # Generated CSS files
|
1093
|
+
│ └── layout.txt # Layout structure
|
1094
|
+
└── templates/ # Main templates
|
1095
|
+
├── index.lt3 # Front page template
|
1096
|
+
├── post.lt3 # Individual post template
|
1097
|
+
└── widget.lt3 # Widget template
|
1098
|
+
```
|
1099
|
+
|
1100
|
+
### Responsive design
|
1101
|
+
|
1102
|
+
Scriptorium themes are designed to work on various screen sizes. When customizing:
|
1103
|
+
|
1104
|
+
- **Mobile-first approach**: Start with mobile styles and enhance for larger screens
|
1105
|
+
- **Flexible layouts**: Use CSS Grid and Flexbox for responsive layouts
|
1106
|
+
- **Test on multiple devices**: Ensure your customizations work across different screen sizes
|
1107
|
+
|
1108
|
+
## Templates
|
1109
|
+
|
1110
|
+
Templates control how your content is structured and displayed. Scriptorium uses LiveText templates (`.lt3` files) that combine HTML structure with dynamic content.
|
1111
|
+
|
1112
|
+
### Main templates
|
1113
|
+
|
1114
|
+
The core templates in your theme:
|
1115
|
+
|
1116
|
+
- **`templates/index.lt3`**: Front page layout
|
1117
|
+
- **`templates/post.lt3`**: Individual blog post layout
|
1118
|
+
- **`templates/widget.lt3`**: Widget container layout
|
1119
|
+
|
1120
|
+
### Customizing post templates
|
1121
|
+
|
1122
|
+
To modify how blog posts are displayed:
|
1123
|
+
|
1124
|
+
1. **Edit the post template**:
|
1125
|
+
```bash
|
1126
|
+
scriptorium edit themes/my-custom-theme/templates/post.lt3
|
1127
|
+
```
|
1128
|
+
|
1129
|
+
2. **Available variables** in post templates:
|
1130
|
+
- `%{post.title}`: Post title
|
1131
|
+
- `%{post.body}`: Post content
|
1132
|
+
- `%{post.pubdate}`: Publication date
|
1133
|
+
- `%{post.tags}`: Post tags
|
1134
|
+
- `%{post.blurb}`: Post excerpt
|
1135
|
+
|
1136
|
+
3. **Example template structure**:
|
1137
|
+
```
|
1138
|
+
<article class="post">
|
1139
|
+
<header>
|
1140
|
+
<h1>%{post.title}</h1>
|
1141
|
+
<time>%{post.pubdate}</time>
|
1142
|
+
</header>
|
1143
|
+
<div class="content">
|
1144
|
+
%{post.body}
|
1145
|
+
</div>
|
1146
|
+
<footer>
|
1147
|
+
<div class="tags">%{post.tags}</div>
|
1148
|
+
</footer>
|
1149
|
+
</article>
|
1150
|
+
```
|
1151
|
+
|
1152
|
+
### Customizing the front page
|
1153
|
+
|
1154
|
+
The front page template controls how your blog index is displayed:
|
1155
|
+
|
1156
|
+
1. **Edit the index template**:
|
1157
|
+
```bash
|
1158
|
+
scriptorium edit themes/my-custom-theme/templates/index.lt3
|
1159
|
+
```
|
1160
|
+
|
1161
|
+
2. **Common customizations**:
|
1162
|
+
- Change the post listing format
|
1163
|
+
- Add featured post sections
|
1164
|
+
- Modify pagination
|
1165
|
+
- Include custom widgets
|
1166
|
+
|
1167
|
+
### Template inheritance and overrides
|
1168
|
+
|
1169
|
+
You can override specific templates for individual views:
|
1170
|
+
|
1171
|
+
1. **Create a view-specific template**:
|
1172
|
+
```bash
|
1173
|
+
scriptorium edit views/my-view/templates/post.lt3
|
1174
|
+
```
|
1175
|
+
|
1176
|
+
2. **The view-specific template** will be used instead of the theme template for that view
|
1177
|
+
|
1178
|
+
### LiveText in templates
|
1179
|
+
|
1180
|
+
Templates use LiveText syntax for dynamic content:
|
1181
|
+
|
1182
|
+
- **Variables**: `%{variable_name}`
|
1183
|
+
- **Conditionals**: `.if condition` ... `.end`
|
1184
|
+
- **Loops**: `.each item` ... `.end`
|
1185
|
+
- **Includes**: `.include "file.lt3"`
|
1186
|
+
|
1187
|
+
## Widgets and Features
|
1188
|
+
|
1189
|
+
Widgets are modular components that add functionality to your site. Scriptorium comes with several built-in widgets, and you can create custom ones.
|
1190
|
+
|
1191
|
+
### Built-in widgets
|
1192
|
+
|
1193
|
+
#### Links widget
|
1194
|
+
|
1195
|
+
Displays a list of external links in a sidebar:
|
1196
|
+
|
1197
|
+
1. **Configure the widget**:
|
1198
|
+
```bash
|
1199
|
+
scriptorium edit widgets/links/list.txt
|
1200
|
+
```
|
1201
|
+
|
1202
|
+
2. **Add links** in the format `url, title`:
|
1203
|
+
```
|
1204
|
+
https://example.com, Example Site
|
1205
|
+
https://github.com, GitHub Profile
|
1206
|
+
```
|
1207
|
+
|
1208
|
+
3. **Generate the widget**:
|
1209
|
+
```bash
|
1210
|
+
scriptorium generate widget links
|
1211
|
+
```
|
1212
|
+
|
1213
|
+
#### Pages widget
|
1214
|
+
|
1215
|
+
Lists internal pages (see Section 6 for details):
|
1216
|
+
|
1217
|
+
1. **Configure the widget**:
|
1218
|
+
```bash
|
1219
|
+
scriptorium edit widgets/pages/list.txt
|
1220
|
+
```
|
1221
|
+
|
1222
|
+
2. **Add page references**:
|
1223
|
+
```
|
1224
|
+
about
|
1225
|
+
contact
|
1226
|
+
documentation
|
1227
|
+
```
|
1228
|
+
|
1229
|
+
#### Featured Posts widget
|
1230
|
+
|
1231
|
+
Highlights specific posts in a sidebar:
|
1232
|
+
|
1233
|
+
1. **Configure the widget**:
|
1234
|
+
```bash
|
1235
|
+
scriptorium edit widgets/featuredposts/list.txt
|
1236
|
+
```
|
1237
|
+
|
1238
|
+
2. **Add post references**:
|
1239
|
+
```
|
1240
|
+
001 My Important Post
|
1241
|
+
002 Another Featured Post
|
1242
|
+
```
|
1243
|
+
|
1244
|
+
### Adding widgets to your layout
|
1245
|
+
|
1246
|
+
To include widgets in your site:
|
1247
|
+
|
1248
|
+
1. **Edit your layout configuration**:
|
1249
|
+
```bash
|
1250
|
+
scriptorium edit config/layout.txt
|
1251
|
+
```
|
1252
|
+
|
1253
|
+
2. **Add widget containers** to your layout:
|
1254
|
+
```
|
1255
|
+
header
|
1256
|
+
left 20%
|
1257
|
+
main
|
1258
|
+
right 20%
|
1259
|
+
footer
|
1260
|
+
```
|
1261
|
+
|
1262
|
+
3. **Configure the sidebar** to include widgets:
|
1263
|
+
```bash
|
1264
|
+
scriptorium edit config/left.txt
|
1265
|
+
```
|
1266
|
+
|
1267
|
+
4. **Add widget references**:
|
1268
|
+
```
|
1269
|
+
.widget links
|
1270
|
+
.widget pages
|
1271
|
+
.widget featuredposts
|
1272
|
+
```
|
1273
|
+
|
1274
|
+
### Creating custom widgets
|
1275
|
+
|
1276
|
+
For advanced customization, you can create your own widgets:
|
1277
|
+
|
1278
|
+
1. **Create a widget directory**:
|
1279
|
+
```bash
|
1280
|
+
mkdir -p widgets/my-custom-widget
|
1281
|
+
```
|
1282
|
+
|
1283
|
+
2. **Create the widget configuration**:
|
1284
|
+
```bash
|
1285
|
+
scriptorium edit widgets/my-custom-widget/config.txt
|
1286
|
+
```
|
1287
|
+
|
1288
|
+
3. **Create the widget template**:
|
1289
|
+
```bash
|
1290
|
+
scriptorium edit widgets/my-custom-widget/template.lt3
|
1291
|
+
```
|
1292
|
+
|
1293
|
+
4. **Register the widget** in your view's configuration
|
1294
|
+
|
1295
|
+
### Widget styling
|
1296
|
+
|
1297
|
+
Widgets inherit styling from your theme, but you can add custom CSS:
|
1298
|
+
|
1299
|
+
1. **Create widget-specific CSS**:
|
1300
|
+
```bash
|
1301
|
+
scriptorium edit themes/my-custom-theme/assets/widgets.css
|
1302
|
+
```
|
1303
|
+
|
1304
|
+
2. **Include the CSS** in your layout templates
|
1305
|
+
|
1306
|
+
### Best practices for customization
|
1307
|
+
|
1308
|
+
- **Start small**: Make incremental changes and test frequently
|
1309
|
+
- **Keep backups**: Save copies of working configurations
|
1310
|
+
- **Use version control**: Track your customizations with git
|
1311
|
+
- **Test thoroughly**: Ensure changes work across different content types
|
1312
|
+
- **Document changes**: Keep notes on what you've customized
|
1313
|
+
|
1314
|
+
### Troubleshooting customizations
|
1315
|
+
|
1316
|
+
Common issues and solutions:
|
1317
|
+
|
1318
|
+
- **Changes not appearing**: Run `scriptorium generate` to rebuild
|
1319
|
+
- **Broken layout**: Check for syntax errors in templates
|
1320
|
+
- **Styling issues**: Verify CSS syntax and file paths
|
1321
|
+
- **Widget not working**: Check widget configuration and file permissions
|
1322
|
+
|
1323
|
+
Customization in Scriptorium strikes a balance between flexibility and simplicity, allowing you to create unique sites while maintaining the core functionality and reliability of the platform.
|
1324
|
+
---
|
1325
|
+
|
1326
|
+
# 8. Advanced Features
|
1327
|
+
|
1328
|
+
Scriptorium includes several advanced features that extend its functionality beyond basic blogging. These features help you integrate with external platforms and enhance your site's social presence.
|
1329
|
+
|
1330
|
+
## Reddit Integration
|
1331
|
+
|
1332
|
+
Scriptorium includes built-in Reddit integration that allows you to automatically share your blog posts to Reddit. This feature helps increase your content's visibility and drive traffic to your site.
|
1333
|
+
|
1334
|
+
### Setting up Reddit integration
|
1335
|
+
|
1336
|
+
Before you can use Reddit integration, you need to create a Reddit application and configure your credentials:
|
1337
|
+
|
1338
|
+
1. **Create a Reddit application**:
|
1339
|
+
- Go to https://www.reddit.com/prefs/apps
|
1340
|
+
- Click "Create App" or "Create Another App"
|
1341
|
+
- Choose "script" as the application type
|
1342
|
+
- Fill in the required fields (name, description, redirect URI)
|
1343
|
+
- Note your client ID and client secret
|
1344
|
+
|
1345
|
+
2. **Configure Reddit credentials**:
|
1346
|
+
```bash
|
1347
|
+
scriptorium edit config/reddit.json
|
1348
|
+
```
|
1349
|
+
|
1350
|
+
3. **Add your Reddit credentials** to the configuration file:
|
1351
|
+
```json
|
1352
|
+
{
|
1353
|
+
"client_id": "your_client_id_here",
|
1354
|
+
"client_secret": "your_client_secret_here",
|
1355
|
+
"username": "your_reddit_username",
|
1356
|
+
"password": "your_reddit_password",
|
1357
|
+
"user_agent": "scriptorium-bot/1.0"
|
1358
|
+
}
|
1359
|
+
```
|
1360
|
+
|
1361
|
+
4. **Set appropriate permissions** for the configuration file:
|
1362
|
+
```bash
|
1363
|
+
chmod 600 config/reddit.json
|
1364
|
+
```
|
1365
|
+
|
1366
|
+
### Using Reddit integration
|
1367
|
+
|
1368
|
+
Once configured, you can automatically post to Reddit when you publish blog posts:
|
1369
|
+
|
1370
|
+
1. **Add Reddit metadata** to your blog posts:
|
1371
|
+
```
|
1372
|
+
.title My Blog Post Title
|
1373
|
+
.reddit_subreddit programming
|
1374
|
+
.reddit_title My Blog Post Title
|
1375
|
+
.reddit_flair "Discussion"
|
1376
|
+
```
|
1377
|
+
|
1378
|
+
2. **Available Reddit metadata**:
|
1379
|
+
- `.reddit_subreddit`: Target subreddit (e.g., "programming", "webdev")
|
1380
|
+
- `.reddit_title`: Custom title for Reddit (optional, uses post title if not specified)
|
1381
|
+
- `.reddit_flair`: Post flair (optional)
|
1382
|
+
- `.reddit_nsfw`: Mark as NSFW (true/false)
|
1383
|
+
- `.reddit_spoiler`: Mark as spoiler (true/false)
|
1384
|
+
|
1385
|
+
3. **Publish your post**:
|
1386
|
+
```bash
|
1387
|
+
scriptorium publish 001
|
1388
|
+
```
|
1389
|
+
|
1390
|
+
4. **The post will automatically be shared** to Reddit with the specified metadata
|
1391
|
+
|
1392
|
+
### Reddit integration best practices
|
1393
|
+
|
1394
|
+
- **Choose appropriate subreddits**: Target subreddits relevant to your content
|
1395
|
+
- **Follow subreddit rules**: Ensure your content complies with each subreddit's guidelines
|
1396
|
+
- **Use descriptive titles**: Make your Reddit titles compelling and accurate
|
1397
|
+
- **Engage with comments**: Respond to comments on your Reddit posts
|
1398
|
+
- **Don't spam**: Avoid posting too frequently to the same subreddits
|
1399
|
+
- **Respect rate limits**: Reddit has API rate limits, so don't post too many times in quick succession
|
1400
|
+
|
1401
|
+
### Troubleshooting Reddit integration
|
1402
|
+
|
1403
|
+
Common issues and solutions:
|
1404
|
+
|
1405
|
+
- **Authentication errors**: Verify your credentials in `config/reddit.json`
|
1406
|
+
- **Rate limiting**: Wait before posting again if you hit rate limits
|
1407
|
+
- **Subreddit not found**: Check that the subreddit name is correct and exists
|
1408
|
+
- **Permission denied**: Ensure your Reddit account has permission to post to the target subreddit
|
1409
|
+
|
1410
|
+
## Social Media Features
|
1411
|
+
|
1412
|
+
Scriptorium includes several features to enhance your social media presence and make your content more shareable.
|
1413
|
+
|
1414
|
+
### Social media metadata
|
1415
|
+
|
1416
|
+
Add social media metadata to your posts to improve how they appear when shared:
|
1417
|
+
|
1418
|
+
```
|
1419
|
+
.title My Blog Post Title
|
1420
|
+
.og_title My Blog Post Title
|
1421
|
+
.og_description A compelling description of my blog post
|
1422
|
+
.og_image /assets/my-featured-image.jpg
|
1423
|
+
.twitter_card summary_large_image
|
1424
|
+
.twitter_title My Blog Post Title
|
1425
|
+
.twitter_description A compelling description for Twitter
|
1426
|
+
.twitter_image /assets/my-featured-image.jpg
|
1427
|
+
```
|
1428
|
+
|
1429
|
+
### Open Graph tags
|
1430
|
+
|
1431
|
+
Open Graph tags control how your content appears when shared on Facebook, LinkedIn, and other platforms:
|
1432
|
+
|
1433
|
+
- **`.og_title`**: Title for social media shares
|
1434
|
+
- **`.og_description`**: Description for social media shares
|
1435
|
+
- **`.og_image`**: Featured image for social media shares
|
1436
|
+
- **`.og_type`**: Content type (article, website, etc.)
|
1437
|
+
- **`.og_url`**: Canonical URL for the content
|
1438
|
+
|
1439
|
+
### Twitter Card tags
|
1440
|
+
|
1441
|
+
Twitter Card tags optimize your content for Twitter sharing:
|
1442
|
+
|
1443
|
+
- **`.twitter_card`**: Card type (summary, summary_large_image, app, player)
|
1444
|
+
- **`.twitter_title`**: Title for Twitter shares
|
1445
|
+
- **`.twitter_description`**: Description for Twitter shares
|
1446
|
+
- **`.twitter_image`**: Image for Twitter shares
|
1447
|
+
- **`.twitter_site`**: Your Twitter username
|
1448
|
+
- **`.twitter_creator`**: Content creator's Twitter username
|
1449
|
+
|
1450
|
+
### Social sharing buttons
|
1451
|
+
|
1452
|
+
Add social sharing buttons to your posts:
|
1453
|
+
|
1454
|
+
1. **Configure social sharing** in your theme:
|
1455
|
+
```bash
|
1456
|
+
scriptorium edit themes/my-theme/templates/post.lt3
|
1457
|
+
```
|
1458
|
+
|
1459
|
+
2. **Add sharing buttons** to your post template:
|
1460
|
+
```html
|
1461
|
+
<div class="social-share">
|
1462
|
+
<a href="https://twitter.com/intent/tweet?url=%{post.url}&text=%{post.title}" target="_blank">Share on Twitter</a>
|
1463
|
+
<a href="https://www.facebook.com/sharer/sharer.php?u=%{post.url}" target="_blank">Share on Facebook</a>
|
1464
|
+
<a href="https://www.linkedin.com/sharing/share-offsite/?url=%{post.url}" target="_blank">Share on LinkedIn</a>
|
1465
|
+
</div>
|
1466
|
+
```
|
1467
|
+
|
1468
|
+
### RSS feeds
|
1469
|
+
|
1470
|
+
Scriptorium automatically generates RSS feeds for your content:
|
1471
|
+
|
1472
|
+
- **Main RSS feed**: `your-site.com/feed.xml`
|
1473
|
+
- **Category-specific feeds**: `your-site.com/category/feed.xml`
|
1474
|
+
- **Tag-specific feeds**: `your-site.com/tag/feed.xml`
|
1475
|
+
|
1476
|
+
### Email subscriptions
|
1477
|
+
|
1478
|
+
Set up email subscriptions for your blog:
|
1479
|
+
|
1480
|
+
1. **Configure email settings**:
|
1481
|
+
```bash
|
1482
|
+
scriptorium edit config/email.txt
|
1483
|
+
```
|
1484
|
+
|
1485
|
+
2. **Add subscription form** to your site:
|
1486
|
+
```html
|
1487
|
+
<form action="/subscribe" method="post">
|
1488
|
+
<input type="email" name="email" placeholder="Enter your email">
|
1489
|
+
<button type="submit">Subscribe</button>
|
1490
|
+
</form>
|
1491
|
+
```
|
1492
|
+
|
1493
|
+
### Analytics integration
|
1494
|
+
|
1495
|
+
Track your site's performance with analytics:
|
1496
|
+
|
1497
|
+
1. **Google Analytics**:
|
1498
|
+
```bash
|
1499
|
+
scriptorium edit config/analytics.txt
|
1500
|
+
```
|
1501
|
+
|
1502
|
+
Add your Google Analytics tracking code:
|
1503
|
+
```
|
1504
|
+
GA_TRACKING_ID: UA-XXXXXXXXX-X
|
1505
|
+
```
|
1506
|
+
|
1507
|
+
2. **Other analytics services**:
|
1508
|
+
- Add tracking codes to your theme's header template
|
1509
|
+
- Configure privacy settings and cookie consent
|
1510
|
+
- Set up conversion tracking
|
1511
|
+
|
1512
|
+
### Social media automation
|
1513
|
+
|
1514
|
+
Automate your social media presence:
|
1515
|
+
|
1516
|
+
1. **Scheduled posting**: Set up automated posting to social platforms
|
1517
|
+
2. **Cross-platform sharing**: Share content across multiple platforms simultaneously
|
1518
|
+
3. **Content recycling**: Automatically reshare older content
|
1519
|
+
4. **Engagement tracking**: Monitor likes, shares, and comments
|
1520
|
+
|
1521
|
+
### Best practices for social media
|
1522
|
+
|
1523
|
+
- **Consistent branding**: Use consistent colors, fonts, and imagery across platforms
|
1524
|
+
- **Engage with your audience**: Respond to comments and messages
|
1525
|
+
- **Post regularly**: Maintain a consistent posting schedule
|
1526
|
+
- **Use hashtags strategically**: Research and use relevant hashtags
|
1527
|
+
- **Monitor performance**: Track which content performs best
|
1528
|
+
- **Optimize for each platform**: Tailor content for different social media platforms
|
1529
|
+
|
1530
|
+
### Privacy and security considerations
|
1531
|
+
|
1532
|
+
When using social media features:
|
1533
|
+
|
1534
|
+
- **Protect personal information**: Be careful with personal data in social media metadata
|
1535
|
+
- **Use HTTPS**: Ensure your site uses HTTPS for secure sharing
|
1536
|
+
- **Respect user privacy**: Implement appropriate privacy policies
|
1537
|
+
- **Secure API keys**: Keep social media API keys and credentials secure
|
1538
|
+
- **Monitor for abuse**: Watch for spam or inappropriate use of your social features
|
1539
|
+
|
1540
|
+
### Troubleshooting social media features
|
1541
|
+
|
1542
|
+
Common issues and solutions:
|
1543
|
+
|
1544
|
+
- **Images not appearing**: Check image paths and ensure images are publicly accessible
|
1545
|
+
- **Metadata not updating**: Clear social media cache or use debugging tools
|
1546
|
+
- **Sharing buttons not working**: Verify JavaScript is enabled and URLs are correct
|
1547
|
+
- **Analytics not tracking**: Check tracking code installation and ad blockers
|
1548
|
+
|
1549
|
+
Advanced features in Scriptorium help you extend your reach beyond your blog and engage with audiences across multiple platforms. These features are designed to work seamlessly with your existing content while providing powerful tools for social media management and audience growth.
|
1550
|
+
---
|
1551
|
+
|
1552
|
+
# 9. Deployment & Hosting
|
1553
|
+
|
1554
|
+
Once you've created your Scriptorium site, you'll want to deploy it to make it accessible on the web. This section covers various deployment options, from local development to production hosting.
|
1555
|
+
|
1556
|
+
## Local Development
|
1557
|
+
|
1558
|
+
Before deploying to a server, you'll typically want to test your site locally to ensure everything works correctly.
|
1559
|
+
|
1560
|
+
### Local development server
|
1561
|
+
|
1562
|
+
Scriptorium generates static files that can be served by any web server. For local development:
|
1563
|
+
|
1564
|
+
1. **Generate your site**:
|
1565
|
+
```bash
|
1566
|
+
scriptorium generate
|
1567
|
+
```
|
1568
|
+
|
1569
|
+
2. **Start a local web server**:
|
1570
|
+
```bash
|
1571
|
+
# Using Python (if available)
|
1572
|
+
cd output
|
1573
|
+
python -m http.server 8000
|
1574
|
+
|
1575
|
+
# Using Ruby (if available)
|
1576
|
+
cd output
|
1577
|
+
ruby -run -e httpd . -p 8000
|
1578
|
+
|
1579
|
+
# Using Node.js (if available)
|
1580
|
+
cd output
|
1581
|
+
npx serve -p 8000
|
1582
|
+
```
|
1583
|
+
|
1584
|
+
3. **Access your site** at `http://localhost:8000`
|
1585
|
+
|
1586
|
+
### Live reload development
|
1587
|
+
|
1588
|
+
For a better development experience with automatic reloading:
|
1589
|
+
|
1590
|
+
1. **Install a live reload server**:
|
1591
|
+
```bash
|
1592
|
+
# Using Node.js
|
1593
|
+
npm install -g live-server
|
1594
|
+
|
1595
|
+
# Or using Python
|
1596
|
+
pip install livereload
|
1597
|
+
```
|
1598
|
+
|
1599
|
+
2. **Start the development server**:
|
1600
|
+
```bash
|
1601
|
+
cd output
|
1602
|
+
live-server --port=8000
|
1603
|
+
```
|
1604
|
+
|
1605
|
+
3. **Your browser will automatically refresh** when you make changes to your site
|
1606
|
+
|
1607
|
+
### Testing different views
|
1608
|
+
|
1609
|
+
During development, you may want to test different views:
|
1610
|
+
|
1611
|
+
1. **Switch between views**:
|
1612
|
+
```bash
|
1613
|
+
scriptorium view view-name
|
1614
|
+
```
|
1615
|
+
|
1616
|
+
2. **Generate the specific view**:
|
1617
|
+
```bash
|
1618
|
+
scriptorium generate
|
1619
|
+
```
|
1620
|
+
|
1621
|
+
3. **Test the view** in your local development server
|
1622
|
+
|
1623
|
+
### Debugging local issues
|
1624
|
+
|
1625
|
+
Common local development issues and solutions:
|
1626
|
+
|
1627
|
+
- **Files not updating**: Ensure you're running `scriptorium generate` after changes
|
1628
|
+
- **CSS not loading**: Check file paths and ensure CSS files are in the correct location
|
1629
|
+
- **Images not displaying**: Verify image paths and file permissions
|
1630
|
+
- **JavaScript errors**: Check browser console for errors and verify script paths
|
1631
|
+
|
1632
|
+
## Server Deployment
|
1633
|
+
|
1634
|
+
When you're ready to deploy your site to production, you have several hosting options available.
|
1635
|
+
|
1636
|
+
### Static hosting services
|
1637
|
+
|
1638
|
+
Static hosting services are ideal for Scriptorium sites since they generate static HTML files:
|
1639
|
+
|
1640
|
+
#### GitHub Pages
|
1641
|
+
|
1642
|
+
1. **Create a GitHub repository** for your site
|
1643
|
+
2. **Push your Scriptorium repository** to GitHub:
|
1644
|
+
```bash
|
1645
|
+
git init
|
1646
|
+
git add .
|
1647
|
+
git commit -m "Initial commit"
|
1648
|
+
git remote add origin https://github.com/username/repository-name.git
|
1649
|
+
git push -u origin main
|
1650
|
+
```
|
1651
|
+
|
1652
|
+
3. **Enable GitHub Pages** in your repository settings
|
1653
|
+
4. **Configure GitHub Actions** for automatic deployment (optional)
|
1654
|
+
|
1655
|
+
#### Netlify
|
1656
|
+
|
1657
|
+
1. **Sign up for Netlify** and connect your Git repository
|
1658
|
+
2. **Configure build settings**:
|
1659
|
+
- Build command: `scriptorium generate`
|
1660
|
+
- Publish directory: `output`
|
1661
|
+
3. **Deploy automatically** on every push to your repository
|
1662
|
+
|
1663
|
+
#### Vercel
|
1664
|
+
|
1665
|
+
1. **Sign up for Vercel** and import your Git repository
|
1666
|
+
2. **Configure build settings**:
|
1667
|
+
- Build command: `scriptorium generate`
|
1668
|
+
- Output directory: `output`
|
1669
|
+
3. **Deploy with automatic updates**
|
1670
|
+
|
1671
|
+
### Traditional web hosting
|
1672
|
+
|
1673
|
+
For traditional web hosting providers:
|
1674
|
+
|
1675
|
+
1. **Generate your site**:
|
1676
|
+
```bash
|
1677
|
+
scriptorium generate
|
1678
|
+
```
|
1679
|
+
|
1680
|
+
2. **Upload files** to your web server:
|
1681
|
+
```bash
|
1682
|
+
# Using rsync (recommended)
|
1683
|
+
rsync -avz output/ user@your-server.com:/path/to/web/root/
|
1684
|
+
|
1685
|
+
# Using scp
|
1686
|
+
scp -r output/* user@your-server.com:/path/to/web/root/
|
1687
|
+
|
1688
|
+
# Using FTP/SFTP client
|
1689
|
+
# Upload all files from the output directory
|
1690
|
+
```
|
1691
|
+
|
1692
|
+
3. **Set proper permissions**:
|
1693
|
+
```bash
|
1694
|
+
chmod 644 output/*.html
|
1695
|
+
chmod 644 output/*.css
|
1696
|
+
chmod 644 output/*.js
|
1697
|
+
chmod 755 output/
|
1698
|
+
```
|
1699
|
+
|
1700
|
+
### VPS deployment
|
1701
|
+
|
1702
|
+
For more control, deploy to a Virtual Private Server:
|
1703
|
+
|
1704
|
+
1. **Set up your VPS** with a web server (Apache, Nginx, etc.)
|
1705
|
+
2. **Install required dependencies**:
|
1706
|
+
```bash
|
1707
|
+
# Ubuntu/Debian
|
1708
|
+
sudo apt update
|
1709
|
+
sudo apt install nginx ruby ruby-dev
|
1710
|
+
|
1711
|
+
# CentOS/RHEL
|
1712
|
+
sudo yum install nginx ruby ruby-devel
|
1713
|
+
```
|
1714
|
+
|
1715
|
+
3. **Configure your web server** to serve static files
|
1716
|
+
4. **Set up automatic deployment** with Git hooks or CI/CD
|
1717
|
+
|
1718
|
+
### Deployment automation
|
1719
|
+
|
1720
|
+
Automate your deployment process:
|
1721
|
+
|
1722
|
+
1. **Create a deployment script**:
|
1723
|
+
```bash
|
1724
|
+
#!/bin/bash
|
1725
|
+
# deploy.sh
|
1726
|
+
|
1727
|
+
# Generate the site
|
1728
|
+
scriptorium generate
|
1729
|
+
|
1730
|
+
# Upload to server
|
1731
|
+
rsync -avz --delete output/ user@your-server.com:/path/to/web/root/
|
1732
|
+
|
1733
|
+
# Clear cache (if using a CDN)
|
1734
|
+
# curl -X POST https://api.cloudflare.com/client/v4/zones/zone-id/purge_cache
|
1735
|
+
```
|
1736
|
+
|
1737
|
+
2. **Make it executable**:
|
1738
|
+
```bash
|
1739
|
+
chmod +x deploy.sh
|
1740
|
+
```
|
1741
|
+
|
1742
|
+
3. **Run deployment**:
|
1743
|
+
```bash
|
1744
|
+
./deploy.sh
|
1745
|
+
```
|
1746
|
+
|
1747
|
+
## Domain Configuration
|
1748
|
+
|
1749
|
+
Configure your domain name to point to your hosted site.
|
1750
|
+
|
1751
|
+
### DNS configuration
|
1752
|
+
|
1753
|
+
1. **Add DNS records** in your domain registrar's control panel:
|
1754
|
+
- **A record**: Point your domain to your server's IP address
|
1755
|
+
- **CNAME record**: Point `www` subdomain to your main domain
|
1756
|
+
- **MX records**: Configure email (if needed)
|
1757
|
+
|
1758
|
+
2. **Example DNS configuration**:
|
1759
|
+
```
|
1760
|
+
Type Name Value
|
1761
|
+
A @ 192.168.1.100
|
1762
|
+
CNAME www yourdomain.com
|
1763
|
+
```
|
1764
|
+
|
1765
|
+
### Subdomain setup
|
1766
|
+
|
1767
|
+
Set up subdomains for different sections of your site:
|
1768
|
+
|
1769
|
+
1. **Add subdomain DNS records**:
|
1770
|
+
```
|
1771
|
+
Type Name Value
|
1772
|
+
A blog 192.168.1.100
|
1773
|
+
A docs 192.168.1.100
|
1774
|
+
```
|
1775
|
+
|
1776
|
+
2. **Configure web server** to handle subdomains
|
1777
|
+
3. **Set up separate Scriptorium repositories** for each subdomain (if needed)
|
1778
|
+
|
1779
|
+
### Domain verification
|
1780
|
+
|
1781
|
+
Verify your domain is properly configured:
|
1782
|
+
|
1783
|
+
1. **Check DNS propagation**:
|
1784
|
+
```bash
|
1785
|
+
nslookup yourdomain.com
|
1786
|
+
dig yourdomain.com
|
1787
|
+
```
|
1788
|
+
|
1789
|
+
2. **Test website accessibility**:
|
1790
|
+
```bash
|
1791
|
+
curl -I http://yourdomain.com
|
1792
|
+
```
|
1793
|
+
|
1794
|
+
3. **Check for redirects** and ensure they're working correctly
|
1795
|
+
|
1796
|
+
## SSL Setup
|
1797
|
+
|
1798
|
+
Secure your site with HTTPS using SSL certificates.
|
1799
|
+
|
1800
|
+
### Let's Encrypt (free SSL)
|
1801
|
+
|
1802
|
+
1. **Install Certbot**:
|
1803
|
+
```bash
|
1804
|
+
# Ubuntu/Debian
|
1805
|
+
sudo apt install certbot python3-certbot-nginx
|
1806
|
+
|
1807
|
+
# CentOS/RHEL
|
1808
|
+
sudo yum install certbot python3-certbot-nginx
|
1809
|
+
```
|
1810
|
+
|
1811
|
+
2. **Obtain SSL certificate**:
|
1812
|
+
```bash
|
1813
|
+
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
|
1814
|
+
```
|
1815
|
+
|
1816
|
+
3. **Auto-renewal setup**:
|
1817
|
+
```bash
|
1818
|
+
sudo crontab -e
|
1819
|
+
# Add: 0 12 * * * /usr/bin/certbot renew --quiet
|
1820
|
+
```
|
1821
|
+
|
1822
|
+
### Manual SSL certificate
|
1823
|
+
|
1824
|
+
For paid SSL certificates:
|
1825
|
+
|
1826
|
+
1. **Generate CSR (Certificate Signing Request)**:
|
1827
|
+
```bash
|
1828
|
+
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
|
1829
|
+
```
|
1830
|
+
|
1831
|
+
2. **Submit CSR** to your certificate provider
|
1832
|
+
3. **Install the certificate** on your web server
|
1833
|
+
4. **Configure web server** to use SSL
|
1834
|
+
|
1835
|
+
### Web server SSL configuration
|
1836
|
+
|
1837
|
+
#### Nginx SSL configuration
|
1838
|
+
|
1839
|
+
```nginx
|
1840
|
+
server {
|
1841
|
+
listen 443 ssl http2;
|
1842
|
+
server_name yourdomain.com www.yourdomain.com;
|
1843
|
+
|
1844
|
+
ssl_certificate /path/to/certificate.crt;
|
1845
|
+
ssl_certificate_key /path/to/private.key;
|
1846
|
+
|
1847
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
1848
|
+
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512;
|
1849
|
+
ssl_prefer_server_ciphers off;
|
1850
|
+
|
1851
|
+
location / {
|
1852
|
+
root /path/to/your/site;
|
1853
|
+
index index.html;
|
1854
|
+
try_files $uri $uri/ =404;
|
1855
|
+
}
|
1856
|
+
}
|
1857
|
+
|
1858
|
+
# Redirect HTTP to HTTPS
|
1859
|
+
server {
|
1860
|
+
listen 80;
|
1861
|
+
server_name yourdomain.com www.yourdomain.com;
|
1862
|
+
return 301 https://$server_name$request_uri;
|
1863
|
+
}
|
1864
|
+
```
|
1865
|
+
|
1866
|
+
#### Apache SSL configuration
|
1867
|
+
|
1868
|
+
```apache
|
1869
|
+
<VirtualHost *:443>
|
1870
|
+
ServerName yourdomain.com
|
1871
|
+
ServerAlias www.yourdomain.com
|
1872
|
+
|
1873
|
+
SSLEngine on
|
1874
|
+
SSLCertificateFile /path/to/certificate.crt
|
1875
|
+
SSLCertificateKeyFile /path/to/private.key
|
1876
|
+
|
1877
|
+
DocumentRoot /path/to/your/site
|
1878
|
+
|
1879
|
+
<Directory /path/to/your/site>
|
1880
|
+
AllowOverride All
|
1881
|
+
Require all granted
|
1882
|
+
</Directory>
|
1883
|
+
</VirtualHost>
|
1884
|
+
|
1885
|
+
# Redirect HTTP to HTTPS
|
1886
|
+
<VirtualHost *:80>
|
1887
|
+
ServerName yourdomain.com
|
1888
|
+
ServerAlias www.yourdomain.com
|
1889
|
+
Redirect permanent / https://yourdomain.com/
|
1890
|
+
</VirtualHost>
|
1891
|
+
```
|
1892
|
+
|
1893
|
+
### SSL best practices
|
1894
|
+
|
1895
|
+
- **Use strong encryption**: Configure modern SSL protocols and ciphers
|
1896
|
+
- **Enable HSTS**: Add HTTP Strict Transport Security headers
|
1897
|
+
- **Regular renewal**: Set up automatic certificate renewal
|
1898
|
+
- **Monitor certificate expiration**: Use monitoring tools to track certificate status
|
1899
|
+
- **Backup certificates**: Keep secure backups of your SSL certificates and private keys
|
1900
|
+
|
1901
|
+
### Content Delivery Networks (CDN)
|
1902
|
+
|
1903
|
+
Improve site performance with a CDN:
|
1904
|
+
|
1905
|
+
1. **Choose a CDN provider** (Cloudflare, AWS CloudFront, etc.)
|
1906
|
+
2. **Configure DNS** to point to CDN
|
1907
|
+
3. **Set up caching rules** for static assets
|
1908
|
+
4. **Configure SSL** through the CDN provider
|
1909
|
+
5. **Monitor performance** and adjust settings as needed
|
1910
|
+
|
1911
|
+
### Deployment checklist
|
1912
|
+
|
1913
|
+
Before going live:
|
1914
|
+
|
1915
|
+
- [ ] Site generates without errors
|
1916
|
+
- [ ] All links work correctly
|
1917
|
+
- [ ] Images and assets load properly
|
1918
|
+
- [ ] SSL certificate is installed and working
|
1919
|
+
- [ ] Domain DNS is configured correctly
|
1920
|
+
- [ ] Web server is configured properly
|
1921
|
+
- [ ] Backup and recovery procedures are in place
|
1922
|
+
- [ ] Monitoring and analytics are set up
|
1923
|
+
- [ ] Error pages (404, 500) are configured
|
1924
|
+
- [ ] Site is tested across different browsers and devices
|
1925
|
+
|
1926
|
+
Deploying your Scriptorium site can be as simple as uploading static files or as complex as setting up a full CI/CD pipeline. Choose the approach that best fits your needs, technical expertise, and budget.
|
1927
|
+
---
|
1928
|
+
|
1929
|
+
# 10. Troubleshooting
|
1930
|
+
|
1931
|
+
Even with the best setup, you may encounter issues while using Scriptorium. This section covers common problems and their solutions, helping you quickly resolve issues and get back to creating content.
|
1932
|
+
|
1933
|
+
## Common Issues
|
1934
|
+
|
1935
|
+
### Site generation problems
|
1936
|
+
|
1937
|
+
#### Site won't generate
|
1938
|
+
|
1939
|
+
**Symptoms**: Running `scriptorium generate` fails or produces errors.
|
1940
|
+
|
1941
|
+
**Possible causes and solutions**:
|
1942
|
+
|
1943
|
+
1. **Missing dependencies**:
|
1944
|
+
```bash
|
1945
|
+
# Check if Ruby and required gems are installed
|
1946
|
+
ruby --version
|
1947
|
+
gem list
|
1948
|
+
|
1949
|
+
# Reinstall Scriptorium if needed
|
1950
|
+
gem uninstall scriptorium
|
1951
|
+
gem install scriptorium
|
1952
|
+
```
|
1953
|
+
|
1954
|
+
2. **Corrupted repository**:
|
1955
|
+
```bash
|
1956
|
+
# Check repository integrity
|
1957
|
+
scriptorium status
|
1958
|
+
|
1959
|
+
# If corrupted, restore from backup or recreate
|
1960
|
+
cp -r .scriptorium .scriptorium.backup
|
1961
|
+
scriptorium init
|
1962
|
+
```
|
1963
|
+
|
1964
|
+
3. **Permission issues**:
|
1965
|
+
```bash
|
1966
|
+
# Check file permissions
|
1967
|
+
ls -la
|
1968
|
+
|
1969
|
+
# Fix permissions if needed
|
1970
|
+
chmod 755 .
|
1971
|
+
chmod 644 *.txt *.md *.lt3
|
1972
|
+
```
|
1973
|
+
|
1974
|
+
#### Posts not appearing
|
1975
|
+
|
1976
|
+
**Symptoms**: Posts exist but don't show up on the site.
|
1977
|
+
|
1978
|
+
**Solutions**:
|
1979
|
+
|
1980
|
+
1. **Check post status**:
|
1981
|
+
```bash
|
1982
|
+
scriptorium list posts
|
1983
|
+
```
|
1984
|
+
|
1985
|
+
2. **Verify post is linked to current view**:
|
1986
|
+
```bash
|
1987
|
+
scriptorium post 001
|
1988
|
+
# Check the "views" field
|
1989
|
+
```
|
1990
|
+
|
1991
|
+
3. **Link post to view if needed**:
|
1992
|
+
```bash
|
1993
|
+
scriptorium link 001
|
1994
|
+
```
|
1995
|
+
|
1996
|
+
4. **Regenerate the site**:
|
1997
|
+
```bash
|
1998
|
+
scriptorium generate
|
1999
|
+
```
|
2000
|
+
|
2001
|
+
#### Images not displaying
|
2002
|
+
|
2003
|
+
**Symptoms**: Images appear broken or don't load.
|
2004
|
+
|
2005
|
+
**Solutions**:
|
2006
|
+
|
2007
|
+
1. **Check image paths**:
|
2008
|
+
```bash
|
2009
|
+
# Verify image exists
|
2010
|
+
ls -la assets/images/
|
2011
|
+
|
2012
|
+
# Check path in post
|
2013
|
+
scriptorium edit posts/001.lt3
|
2014
|
+
```
|
2015
|
+
|
2016
|
+
2. **Correct image references**:
|
2017
|
+
```
|
2018
|
+
# Use relative paths from the post
|
2019
|
+

|
2020
|
+
|
2021
|
+
# Or absolute paths from site root
|
2022
|
+

|
2023
|
+
```
|
2024
|
+
|
2025
|
+
3. **Ensure images are in the correct directory**:
|
2026
|
+
```bash
|
2027
|
+
# Move images to assets directory
|
2028
|
+
mv my-image.jpg assets/images/
|
2029
|
+
```
|
2030
|
+
|
2031
|
+
### Widget issues
|
2032
|
+
|
2033
|
+
#### Widget not appearing
|
2034
|
+
|
2035
|
+
**Symptoms**: Widget is configured but doesn't show on the site.
|
2036
|
+
|
2037
|
+
**Solutions**:
|
2038
|
+
|
2039
|
+
1. **Check widget configuration**:
|
2040
|
+
```bash
|
2041
|
+
scriptorium edit widgets/links/list.txt
|
2042
|
+
# Verify the file exists and has content
|
2043
|
+
```
|
2044
|
+
|
2045
|
+
2. **Generate the widget**:
|
2046
|
+
```bash
|
2047
|
+
scriptorium generate widget links
|
2048
|
+
```
|
2049
|
+
|
2050
|
+
3. **Check layout configuration**:
|
2051
|
+
```bash
|
2052
|
+
scriptorium edit config/layout.txt
|
2053
|
+
# Ensure sidebar containers are defined
|
2054
|
+
|
2055
|
+
scriptorium edit config/left.txt
|
2056
|
+
# Ensure widget is referenced
|
2057
|
+
```
|
2058
|
+
|
2059
|
+
4. **Regenerate the entire site**:
|
2060
|
+
```bash
|
2061
|
+
scriptorium generate
|
2062
|
+
```
|
2063
|
+
|
2064
|
+
#### Widget content not updating
|
2065
|
+
|
2066
|
+
**Symptoms**: Changes to widget configuration don't appear on the site.
|
2067
|
+
|
2068
|
+
**Solutions**:
|
2069
|
+
|
2070
|
+
1. **Regenerate the specific widget**:
|
2071
|
+
```bash
|
2072
|
+
scriptorium generate widget widget-name
|
2073
|
+
```
|
2074
|
+
|
2075
|
+
2. **Clear any caching**:
|
2076
|
+
```bash
|
2077
|
+
# Remove generated files
|
2078
|
+
rm -rf output/
|
2079
|
+
scriptorium generate
|
2080
|
+
```
|
2081
|
+
|
2082
|
+
### Theme and styling issues
|
2083
|
+
|
2084
|
+
#### Theme not applying
|
2085
|
+
|
2086
|
+
**Symptoms**: Site doesn't use the expected theme.
|
2087
|
+
|
2088
|
+
**Solutions**:
|
2089
|
+
|
2090
|
+
1. **Check theme configuration**:
|
2091
|
+
```bash
|
2092
|
+
scriptorium edit config.txt
|
2093
|
+
# Verify theme: theme-name is set correctly
|
2094
|
+
```
|
2095
|
+
|
2096
|
+
2. **Verify theme exists**:
|
2097
|
+
```bash
|
2098
|
+
ls -la themes/
|
2099
|
+
# Ensure the theme directory exists
|
2100
|
+
```
|
2101
|
+
|
2102
|
+
3. **Apply theme explicitly**:
|
2103
|
+
```bash
|
2104
|
+
scriptorium theme theme-name
|
2105
|
+
```
|
2106
|
+
|
2107
|
+
#### CSS not loading
|
2108
|
+
|
2109
|
+
**Symptoms**: Site appears unstyled or with broken styling.
|
2110
|
+
|
2111
|
+
**Solutions**:
|
2112
|
+
|
2113
|
+
1. **Check CSS file paths**:
|
2114
|
+
```bash
|
2115
|
+
ls -la themes/standard/layout/gen/
|
2116
|
+
# Verify CSS files exist
|
2117
|
+
```
|
2118
|
+
|
2119
|
+
2. **Regenerate theme**:
|
2120
|
+
```bash
|
2121
|
+
scriptorium generate
|
2122
|
+
# This should regenerate CSS files
|
2123
|
+
```
|
2124
|
+
|
2125
|
+
3. **Check browser cache**:
|
2126
|
+
- Hard refresh (Ctrl+F5 or Cmd+Shift+R)
|
2127
|
+
- Clear browser cache
|
2128
|
+
- Try incognito/private browsing mode
|
2129
|
+
|
2130
|
+
## Dependency Management
|
2131
|
+
|
2132
|
+
### Ruby version issues
|
2133
|
+
|
2134
|
+
**Symptoms**: Scriptorium fails to run or has compatibility issues.
|
2135
|
+
|
2136
|
+
**Solutions**:
|
2137
|
+
|
2138
|
+
1. **Check Ruby version**:
|
2139
|
+
```bash
|
2140
|
+
ruby --version
|
2141
|
+
# Scriptorium requires Ruby 2.7 or higher
|
2142
|
+
```
|
2143
|
+
|
2144
|
+
2. **Update Ruby if needed**:
|
2145
|
+
```bash
|
2146
|
+
# Using rbenv
|
2147
|
+
rbenv install 3.2.0
|
2148
|
+
rbenv global 3.2.0
|
2149
|
+
|
2150
|
+
# Using rvm
|
2151
|
+
rvm install 3.2.0
|
2152
|
+
rvm use 3.2.0 --default
|
2153
|
+
```
|
2154
|
+
|
2155
|
+
3. **Reinstall gems**:
|
2156
|
+
```bash
|
2157
|
+
gem update
|
2158
|
+
gem install scriptorium
|
2159
|
+
```
|
2160
|
+
|
2161
|
+
### Gem conflicts
|
2162
|
+
|
2163
|
+
**Symptoms**: Scriptorium conflicts with other Ruby gems.
|
2164
|
+
|
2165
|
+
**Solutions**:
|
2166
|
+
|
2167
|
+
1. **Use bundler**:
|
2168
|
+
```bash
|
2169
|
+
# Create Gemfile
|
2170
|
+
echo 'gem "scriptorium"' > Gemfile
|
2171
|
+
|
2172
|
+
# Install with bundler
|
2173
|
+
bundle install
|
2174
|
+
bundle exec scriptorium
|
2175
|
+
```
|
2176
|
+
|
2177
|
+
2. **Use gem isolation**:
|
2178
|
+
```bash
|
2179
|
+
# Install in user directory
|
2180
|
+
gem install --user-install scriptorium
|
2181
|
+
```
|
2182
|
+
|
2183
|
+
3. **Check gem environment**:
|
2184
|
+
```bash
|
2185
|
+
gem env
|
2186
|
+
# Verify gem paths and versions
|
2187
|
+
```
|
2188
|
+
|
2189
|
+
### System dependencies
|
2190
|
+
|
2191
|
+
**Symptoms**: Scriptorium fails due to missing system libraries.
|
2192
|
+
|
2193
|
+
**Solutions**:
|
2194
|
+
|
2195
|
+
1. **Install development tools**:
|
2196
|
+
```bash
|
2197
|
+
# Ubuntu/Debian
|
2198
|
+
sudo apt install build-essential
|
2199
|
+
|
2200
|
+
# macOS
|
2201
|
+
xcode-select --install
|
2202
|
+
|
2203
|
+
# CentOS/RHEL
|
2204
|
+
sudo yum groupinstall "Development Tools"
|
2205
|
+
```
|
2206
|
+
|
2207
|
+
2. **Install specific libraries**:
|
2208
|
+
```bash
|
2209
|
+
# Ubuntu/Debian
|
2210
|
+
sudo apt install libssl-dev libreadline-dev zlib1g-dev
|
2211
|
+
|
2212
|
+
# CentOS/RHEL
|
2213
|
+
sudo yum install openssl-devel readline-devel zlib-devel
|
2214
|
+
```
|
2215
|
+
|
2216
|
+
## Error Messages
|
2217
|
+
|
2218
|
+
### Common error messages and solutions
|
2219
|
+
|
2220
|
+
#### "Cannot read file: file not found"
|
2221
|
+
|
2222
|
+
**Cause**: Scriptorium can't find a required file.
|
2223
|
+
|
2224
|
+
**Solution**:
|
2225
|
+
```bash
|
2226
|
+
# Check if file exists
|
2227
|
+
ls -la path/to/file
|
2228
|
+
|
2229
|
+
# Create missing file if needed
|
2230
|
+
touch path/to/file
|
2231
|
+
|
2232
|
+
# Check file permissions
|
2233
|
+
chmod 644 path/to/file
|
2234
|
+
```
|
2235
|
+
|
2236
|
+
#### "Cannot build widget: name invalid"
|
2237
|
+
|
2238
|
+
**Cause**: Widget name contains invalid characters.
|
2239
|
+
|
2240
|
+
**Solution**:
|
2241
|
+
```bash
|
2242
|
+
# Use only lowercase letters, numbers, and hyphens
|
2243
|
+
# Good: my-widget, links, pages
|
2244
|
+
# Bad: My_Widget, links!, pages@
|
2245
|
+
```
|
2246
|
+
|
2247
|
+
#### "Layout has unknown tag"
|
2248
|
+
|
2249
|
+
**Cause**: Layout file contains unrecognized container names.
|
2250
|
+
|
2251
|
+
**Solution**:
|
2252
|
+
```bash
|
2253
|
+
# Check layout file
|
2254
|
+
scriptorium edit config/layout.txt
|
2255
|
+
|
2256
|
+
# Valid containers: header, main, left, right, footer
|
2257
|
+
# Remove or correct invalid container names
|
2258
|
+
```
|
2259
|
+
|
2260
|
+
#### "Theme doesn't exist"
|
2261
|
+
|
2262
|
+
**Cause**: Referenced theme is not found.
|
2263
|
+
|
2264
|
+
**Solution**:
|
2265
|
+
```bash
|
2266
|
+
# List available themes
|
2267
|
+
ls -la themes/
|
2268
|
+
|
2269
|
+
# Check theme configuration
|
2270
|
+
scriptorium edit config.txt
|
2271
|
+
|
2272
|
+
# Use existing theme or create new one
|
2273
|
+
scriptorium theme standard
|
2274
|
+
```
|
2275
|
+
|
2276
|
+
#### "Post not found"
|
2277
|
+
|
2278
|
+
**Cause**: Referenced post ID doesn't exist.
|
2279
|
+
|
2280
|
+
**Solution**:
|
2281
|
+
```bash
|
2282
|
+
# List all posts
|
2283
|
+
scriptorium list posts
|
2284
|
+
|
2285
|
+
# Check post ID format
|
2286
|
+
# Posts should be numbered: 001, 002, etc.
|
2287
|
+
|
2288
|
+
# Create post if needed
|
2289
|
+
scriptorium new post "Post Title"
|
2290
|
+
```
|
2291
|
+
|
2292
|
+
### Debugging techniques
|
2293
|
+
|
2294
|
+
#### Enable verbose output
|
2295
|
+
|
2296
|
+
```bash
|
2297
|
+
# Run commands with verbose output
|
2298
|
+
scriptorium generate --verbose
|
2299
|
+
|
2300
|
+
# Check for detailed error messages
|
2301
|
+
scriptorium status --verbose
|
2302
|
+
```
|
2303
|
+
|
2304
|
+
#### Check log files
|
2305
|
+
|
2306
|
+
```bash
|
2307
|
+
# Look for error logs
|
2308
|
+
find . -name "*.log" -exec cat {} \;
|
2309
|
+
|
2310
|
+
# Check system logs
|
2311
|
+
tail -f /var/log/syslog # Linux
|
2312
|
+
tail -f /var/log/system.log # macOS
|
2313
|
+
```
|
2314
|
+
|
2315
|
+
#### Test individual components
|
2316
|
+
|
2317
|
+
```bash
|
2318
|
+
# Test post generation
|
2319
|
+
scriptorium generate post 001
|
2320
|
+
|
2321
|
+
# Test widget generation
|
2322
|
+
scriptorium generate widget links
|
2323
|
+
|
2324
|
+
# Test theme application
|
2325
|
+
scriptorium theme standard
|
2326
|
+
```
|
2327
|
+
|
2328
|
+
## Getting Help
|
2329
|
+
|
2330
|
+
### Self-help resources
|
2331
|
+
|
2332
|
+
1. **Check the documentation**:
|
2333
|
+
- Review relevant sections of this user guide
|
2334
|
+
- Check the README file in your Scriptorium installation
|
2335
|
+
- Look for examples in the test directory
|
2336
|
+
|
2337
|
+
2. **Use built-in help**:
|
2338
|
+
```bash
|
2339
|
+
scriptorium --help
|
2340
|
+
scriptorium help command-name
|
2341
|
+
```
|
2342
|
+
|
2343
|
+
3. **Check the source code**:
|
2344
|
+
```bash
|
2345
|
+
# Find Scriptorium installation
|
2346
|
+
gem which scriptorium
|
2347
|
+
|
2348
|
+
# Explore the source
|
2349
|
+
ls -la $(gem which scriptorium | sed 's/lib\/scriptorium.rb//')
|
2350
|
+
```
|
2351
|
+
|
2352
|
+
### Community resources
|
2353
|
+
|
2354
|
+
1. **GitHub repository**:
|
2355
|
+
- Check issues for similar problems
|
2356
|
+
- Review recent commits for fixes
|
2357
|
+
- Submit new issues for bugs
|
2358
|
+
|
2359
|
+
2. **Documentation**:
|
2360
|
+
- Check the project wiki
|
2361
|
+
- Review example configurations
|
2362
|
+
- Look for community-contributed guides
|
2363
|
+
|
2364
|
+
3. **Forums and discussions**:
|
2365
|
+
- Search for Scriptorium discussions
|
2366
|
+
- Ask questions in relevant communities
|
2367
|
+
- Share solutions with others
|
2368
|
+
|
2369
|
+
### Reporting bugs
|
2370
|
+
|
2371
|
+
When reporting bugs, include:
|
2372
|
+
|
2373
|
+
1. **System information**:
|
2374
|
+
```bash
|
2375
|
+
ruby --version
|
2376
|
+
gem list scriptorium
|
2377
|
+
uname -a
|
2378
|
+
```
|
2379
|
+
|
2380
|
+
2. **Steps to reproduce**:
|
2381
|
+
- Exact commands run
|
2382
|
+
- Expected vs. actual behavior
|
2383
|
+
- Any error messages
|
2384
|
+
|
2385
|
+
3. **Configuration details**:
|
2386
|
+
- Relevant configuration files
|
2387
|
+
- Post content (if relevant)
|
2388
|
+
- Theme and widget setup
|
2389
|
+
|
2390
|
+
4. **Error logs**:
|
2391
|
+
- Full error messages
|
2392
|
+
- Stack traces
|
2393
|
+
- Debug output
|
2394
|
+
|
2395
|
+
### Getting support
|
2396
|
+
|
2397
|
+
1. **Before asking for help**:
|
2398
|
+
- Try the solutions in this section
|
2399
|
+
- Search for similar issues
|
2400
|
+
- Check if the problem is user error
|
2401
|
+
|
2402
|
+
2. **When asking for help**:
|
2403
|
+
- Be specific about the problem
|
2404
|
+
- Include relevant error messages
|
2405
|
+
- Provide system and configuration details
|
2406
|
+
- Explain what you've already tried
|
2407
|
+
|
2408
|
+
3. **Follow up**:
|
2409
|
+
- Let people know if their suggestions worked
|
2410
|
+
- Share solutions that worked for you
|
2411
|
+
- Help others with similar problems
|
2412
|
+
|
2413
|
+
### Prevention tips
|
2414
|
+
|
2415
|
+
1. **Regular backups**:
|
2416
|
+
```bash
|
2417
|
+
# Backup your Scriptorium repository
|
2418
|
+
tar -czf scriptorium-backup-$(date +%Y%m%d).tar.gz .
|
2419
|
+
```
|
2420
|
+
|
2421
|
+
2. **Version control**:
|
2422
|
+
```bash
|
2423
|
+
# Use git for version control
|
2424
|
+
git init
|
2425
|
+
git add .
|
2426
|
+
git commit -m "Initial commit"
|
2427
|
+
```
|
2428
|
+
|
2429
|
+
3. **Test changes**:
|
2430
|
+
```bash
|
2431
|
+
# Test changes before applying
|
2432
|
+
scriptorium generate --dry-run
|
2433
|
+
|
2434
|
+
# Keep a test environment
|
2435
|
+
cp -r . test-environment
|
2436
|
+
```
|
2437
|
+
|
2438
|
+
4. **Document your setup**:
|
2439
|
+
- Keep notes on your configuration
|
2440
|
+
- Document customizations
|
2441
|
+
- Record solutions to problems
|
2442
|
+
|
2443
|
+
By following these troubleshooting steps and best practices, you can quickly resolve most issues and maintain a stable Scriptorium installation.
|
2444
|
+
|
2445
|
+
---
|
2446
|
+
|
2447
|
+
# 11. Reference
|
2448
|
+
|
2449
|
+
This section provides comprehensive reference information for Scriptorium, including command syntax, configuration options, and technical details.
|
2450
|
+
|
2451
|
+
## Command Reference
|
2452
|
+
|
2453
|
+
### Core commands
|
2454
|
+
|
2455
|
+
#### `scriptorium init [path]`
|
2456
|
+
Initialize a new Scriptorium repository.
|
2457
|
+
|
2458
|
+
**Options:**
|
2459
|
+
- `path`: Directory to initialize (default: current directory)
|
2460
|
+
|
2461
|
+
**Examples:**
|
2462
|
+
```bash
|
2463
|
+
scriptorium init # Initialize in current directory
|
2464
|
+
scriptorium init my-blog # Initialize in my-blog directory
|
2465
|
+
```
|
2466
|
+
|
2467
|
+
#### `scriptorium new post "title"`
|
2468
|
+
Create a new blog post.
|
2469
|
+
|
2470
|
+
**Options:**
|
2471
|
+
- `title`: Post title (required)
|
2472
|
+
|
2473
|
+
**Examples:**
|
2474
|
+
```bash
|
2475
|
+
scriptorium new post "My First Post"
|
2476
|
+
scriptorium new post "Getting Started with Scriptorium"
|
2477
|
+
```
|
2478
|
+
|
2479
|
+
#### `scriptorium edit [file]`
|
2480
|
+
Edit a file using the configured editor.
|
2481
|
+
|
2482
|
+
**Options:**
|
2483
|
+
- `file`: File path to edit
|
2484
|
+
|
2485
|
+
**Examples:**
|
2486
|
+
```bash
|
2487
|
+
scriptorium edit posts/001.lt3
|
2488
|
+
scriptorium edit config.txt
|
2489
|
+
scriptorium edit widgets/links/list.txt
|
2490
|
+
```
|
2491
|
+
|
2492
|
+
#### `scriptorium generate [target]`
|
2493
|
+
Generate the site or specific components.
|
2494
|
+
|
2495
|
+
**Options:**
|
2496
|
+
- `target`: Specific component to generate (optional)
|
2497
|
+
- `post <id>`: Generate specific post
|
2498
|
+
- `widget <name>`: Generate specific widget
|
2499
|
+
- `view <name>`: Generate specific view
|
2500
|
+
|
2501
|
+
**Examples:**
|
2502
|
+
```bash
|
2503
|
+
scriptorium generate # Generate entire site
|
2504
|
+
scriptorium generate post 001 # Generate specific post
|
2505
|
+
scriptorium generate widget links # Generate links widget
|
2506
|
+
```
|
2507
|
+
|
2508
|
+
#### `scriptorium publish <id>`
|
2509
|
+
Publish a draft post.
|
2510
|
+
|
2511
|
+
**Options:**
|
2512
|
+
- `id`: Post ID to publish
|
2513
|
+
|
2514
|
+
**Examples:**
|
2515
|
+
```bash
|
2516
|
+
scriptorium publish 001
|
2517
|
+
scriptorium publish 002
|
2518
|
+
```
|
2519
|
+
|
2520
|
+
#### `scriptorium list [type]`
|
2521
|
+
List posts, views, or other content.
|
2522
|
+
|
2523
|
+
**Options:**
|
2524
|
+
- `type`: Type of content to list
|
2525
|
+
- `posts`: List all posts
|
2526
|
+
- `views`: List all views
|
2527
|
+
- `drafts`: List draft posts
|
2528
|
+
|
2529
|
+
**Examples:**
|
2530
|
+
```bash
|
2531
|
+
scriptorium list posts
|
2532
|
+
scriptorium list views
|
2533
|
+
scriptorium list drafts
|
2534
|
+
```
|
2535
|
+
|
2536
|
+
### View management commands
|
2537
|
+
|
2538
|
+
#### `scriptorium view <name>`
|
2539
|
+
Switch to a different view.
|
2540
|
+
|
2541
|
+
**Options:**
|
2542
|
+
- `name`: View name to switch to
|
2543
|
+
|
2544
|
+
**Examples:**
|
2545
|
+
```bash
|
2546
|
+
scriptorium view sample
|
2547
|
+
scriptorium view blog
|
2548
|
+
```
|
2549
|
+
|
2550
|
+
#### `scriptorium create view <name> <title> [subtitle]`
|
2551
|
+
Create a new view.
|
2552
|
+
|
2553
|
+
**Options:**
|
2554
|
+
- `name`: View name
|
2555
|
+
- `title`: View title
|
2556
|
+
- `subtitle`: View subtitle (optional)
|
2557
|
+
|
2558
|
+
**Examples:**
|
2559
|
+
```bash
|
2560
|
+
scriptorium create view blog "My Blog" "Personal thoughts and ideas"
|
2561
|
+
scriptorium create view docs "Documentation"
|
2562
|
+
```
|
2563
|
+
|
2564
|
+
### Post management commands
|
2565
|
+
|
2566
|
+
#### `scriptorium link <id> [view]`
|
2567
|
+
Link a post to a view.
|
2568
|
+
|
2569
|
+
**Options:**
|
2570
|
+
- `id`: Post ID
|
2571
|
+
- `view`: View name (default: current view)
|
2572
|
+
|
2573
|
+
**Examples:**
|
2574
|
+
```bash
|
2575
|
+
scriptorium link 001
|
2576
|
+
scriptorium link 002 blog
|
2577
|
+
```
|
2578
|
+
|
2579
|
+
#### `scriptorium unlink <id> [view]`
|
2580
|
+
Unlink a post from a view.
|
2581
|
+
|
2582
|
+
**Options:**
|
2583
|
+
- `id`: Post ID
|
2584
|
+
- `view`: View name (default: current view)
|
2585
|
+
|
2586
|
+
**Examples:**
|
2587
|
+
```bash
|
2588
|
+
scriptorium unlink 001
|
2589
|
+
scriptorium unlink 002 blog
|
2590
|
+
```
|
2591
|
+
|
2592
|
+
#### `scriptorium delete <id>`
|
2593
|
+
Delete a post.
|
2594
|
+
|
2595
|
+
**Options:**
|
2596
|
+
- `id`: Post ID to delete
|
2597
|
+
|
2598
|
+
**Examples:**
|
2599
|
+
```bash
|
2600
|
+
scriptorium delete 001
|
2601
|
+
```
|
2602
|
+
|
2603
|
+
### Widget commands
|
2604
|
+
|
2605
|
+
#### `scriptorium generate widget <name>`
|
2606
|
+
Generate a specific widget.
|
2607
|
+
|
2608
|
+
**Options:**
|
2609
|
+
- `name`: Widget name (links, pages, featuredposts)
|
2610
|
+
|
2611
|
+
**Examples:**
|
2612
|
+
```bash
|
2613
|
+
scriptorium generate widget links
|
2614
|
+
scriptorium generate widget pages
|
2615
|
+
```
|
2616
|
+
|
2617
|
+
### Theme commands
|
2618
|
+
|
2619
|
+
#### `scriptorium theme <name>`
|
2620
|
+
Apply a theme to the current view.
|
2621
|
+
|
2622
|
+
**Options:**
|
2623
|
+
- `name`: Theme name
|
2624
|
+
|
2625
|
+
**Examples:**
|
2626
|
+
```bash
|
2627
|
+
scriptorium theme standard
|
2628
|
+
scriptorium theme custom
|
2629
|
+
```
|
2630
|
+
|
2631
|
+
### Utility commands
|
2632
|
+
|
2633
|
+
#### `scriptorium status`
|
2634
|
+
Show repository status.
|
2635
|
+
|
2636
|
+
**Examples:**
|
2637
|
+
```bash
|
2638
|
+
scriptorium status
|
2639
|
+
```
|
2640
|
+
|
2641
|
+
#### `scriptorium help [command]`
|
2642
|
+
Show help information.
|
2643
|
+
|
2644
|
+
**Options:**
|
2645
|
+
- `command`: Specific command to get help for
|
2646
|
+
|
2647
|
+
**Examples:**
|
2648
|
+
```bash
|
2649
|
+
scriptorium help
|
2650
|
+
scriptorium help generate
|
2651
|
+
```
|
2652
|
+
|
2653
|
+
## Configuration Files
|
2654
|
+
|
2655
|
+
### Repository configuration
|
2656
|
+
|
2657
|
+
#### `config/repo.txt`
|
2658
|
+
Main repository configuration file.
|
2659
|
+
|
2660
|
+
**Example:**
|
2661
|
+
```
|
2662
|
+
title: My Scriptorium Site
|
2663
|
+
description: A personal blog and website
|
2664
|
+
author: Your Name
|
2665
|
+
email: your.email@example.com
|
2666
|
+
url: https://example.com
|
2667
|
+
```
|
2668
|
+
|
2669
|
+
### View configuration
|
2670
|
+
|
2671
|
+
#### `config.txt`
|
2672
|
+
View-specific configuration.
|
2673
|
+
|
2674
|
+
**Example:**
|
2675
|
+
```
|
2676
|
+
title: My Blog
|
2677
|
+
subtitle: Personal thoughts and ideas
|
2678
|
+
theme: standard
|
2679
|
+
layout: default
|
2680
|
+
```
|
2681
|
+
|
2682
|
+
#### `config/layout.txt`
|
2683
|
+
Layout configuration defining page structure.
|
2684
|
+
|
2685
|
+
**Example:**
|
2686
|
+
```
|
2687
|
+
header
|
2688
|
+
left 20%
|
2689
|
+
main
|
2690
|
+
right 20%
|
2691
|
+
footer
|
2692
|
+
```
|
2693
|
+
|
2694
|
+
#### `config/header.txt`
|
2695
|
+
Header configuration including navigation.
|
2696
|
+
|
2697
|
+
**Example:**
|
2698
|
+
```
|
2699
|
+
# Site title
|
2700
|
+
.title My Blog
|
2701
|
+
|
2702
|
+
# Navigation links
|
2703
|
+
.nav-link "Home" "/"
|
2704
|
+
.nav-link "About" "pages/about.html"
|
2705
|
+
.nav-link "Contact" "pages/contact.html"
|
2706
|
+
```
|
2707
|
+
|
2708
|
+
### Widget configuration
|
2709
|
+
|
2710
|
+
#### `widgets/links/list.txt`
|
2711
|
+
Links widget configuration.
|
2712
|
+
|
2713
|
+
**Format:**
|
2714
|
+
```
|
2715
|
+
url, title
|
2716
|
+
url, title
|
2717
|
+
```
|
2718
|
+
|
2719
|
+
**Example:**
|
2720
|
+
```
|
2721
|
+
https://example.com, Example Site
|
2722
|
+
https://github.com, GitHub Profile
|
2723
|
+
```
|
2724
|
+
|
2725
|
+
#### `widgets/pages/list.txt`
|
2726
|
+
Pages widget configuration.
|
2727
|
+
|
2728
|
+
**Format:**
|
2729
|
+
```
|
2730
|
+
page-name
|
2731
|
+
page-name
|
2732
|
+
```
|
2733
|
+
|
2734
|
+
**Example:**
|
2735
|
+
```
|
2736
|
+
about
|
2737
|
+
contact
|
2738
|
+
documentation
|
2739
|
+
```
|
2740
|
+
|
2741
|
+
#### `widgets/featuredposts/list.txt`
|
2742
|
+
Featured posts widget configuration.
|
2743
|
+
|
2744
|
+
**Format:**
|
2745
|
+
```
|
2746
|
+
id title
|
2747
|
+
id
|
2748
|
+
```
|
2749
|
+
|
2750
|
+
**Example:**
|
2751
|
+
```
|
2752
|
+
001 My Important Post
|
2753
|
+
002 Another Featured Post
|
2754
|
+
003
|
2755
|
+
```
|
2756
|
+
|
2757
|
+
### Theme configuration
|
2758
|
+
|
2759
|
+
#### `themes/standard/config.txt`
|
2760
|
+
Theme configuration file.
|
2761
|
+
|
2762
|
+
**Example:**
|
2763
|
+
```
|
2764
|
+
name: Standard Theme
|
2765
|
+
version: 1.0
|
2766
|
+
description: Default Scriptorium theme
|
2767
|
+
author: Scriptorium Team
|
2768
|
+
```
|
2769
|
+
|
2770
|
+
## LiveText Reference
|
2771
|
+
|
2772
|
+
### Basic syntax
|
2773
|
+
|
2774
|
+
#### Inline formatting
|
2775
|
+
```
|
2776
|
+
**bold text**
|
2777
|
+
*italic text*
|
2778
|
+
`code text`
|
2779
|
+
[link text](url)
|
2780
|
+

|
2781
|
+
```
|
2782
|
+
|
2783
|
+
#### Dot commands
|
2784
|
+
```
|
2785
|
+
.command
|
2786
|
+
.command parameter
|
2787
|
+
.command "parameter with spaces"
|
2788
|
+
```
|
2789
|
+
|
2790
|
+
#### Dot commands with body
|
2791
|
+
```
|
2792
|
+
.command
|
2793
|
+
content here
|
2794
|
+
.end
|
2795
|
+
```
|
2796
|
+
|
2797
|
+
### Post metadata
|
2798
|
+
|
2799
|
+
#### Required metadata
|
2800
|
+
```
|
2801
|
+
.title Post Title
|
2802
|
+
```
|
2803
|
+
|
2804
|
+
#### Optional metadata
|
2805
|
+
```
|
2806
|
+
.subtitle Post Subtitle
|
2807
|
+
.tags tag1, tag2, tag3
|
2808
|
+
.blurb Post excerpt for summaries
|
2809
|
+
.views view1, view2
|
2810
|
+
.pubdate 2024-01-15
|
2811
|
+
```
|
2812
|
+
|
2813
|
+
#### Social media metadata
|
2814
|
+
```
|
2815
|
+
.og_title Title for social media
|
2816
|
+
.og_description Description for social media
|
2817
|
+
.og_image /path/to/image.jpg
|
2818
|
+
.twitter_card summary_large_image
|
2819
|
+
.twitter_title Twitter title
|
2820
|
+
.twitter_description Twitter description
|
2821
|
+
```
|
2822
|
+
|
2823
|
+
#### Reddit integration metadata
|
2824
|
+
```
|
2825
|
+
.reddit_subreddit programming
|
2826
|
+
.reddit_title Custom Reddit title
|
2827
|
+
.reddit_flair "Discussion"
|
2828
|
+
.reddit_nsfw false
|
2829
|
+
.reddit_spoiler false
|
2830
|
+
```
|
2831
|
+
|
2832
|
+
### Template variables
|
2833
|
+
|
2834
|
+
#### Post variables
|
2835
|
+
```
|
2836
|
+
%{post.title} # Post title
|
2837
|
+
%{post.body} # Post content
|
2838
|
+
%{post.pubdate} # Publication date
|
2839
|
+
%{post.tags} # Post tags
|
2840
|
+
%{post.blurb} # Post excerpt
|
2841
|
+
%{post.url} # Post URL
|
2842
|
+
%{post.slug} # Post slug
|
2843
|
+
```
|
2844
|
+
|
2845
|
+
#### Site variables
|
2846
|
+
```
|
2847
|
+
%{site.title} # Site title
|
2848
|
+
%{site.description} # Site description
|
2849
|
+
%{site.url} # Site URL
|
2850
|
+
%{site.author} # Site author
|
2851
|
+
```
|
2852
|
+
|
2853
|
+
#### View variables
|
2854
|
+
```
|
2855
|
+
%{view.name} # View name
|
2856
|
+
%{view.title} # View title
|
2857
|
+
%{view.subtitle} # View subtitle
|
2858
|
+
```
|
2859
|
+
|
2860
|
+
### Control structures
|
2861
|
+
|
2862
|
+
#### Conditionals
|
2863
|
+
```
|
2864
|
+
.if condition
|
2865
|
+
content
|
2866
|
+
.end
|
2867
|
+
|
2868
|
+
.if post.tags.include?("featured")
|
2869
|
+
This is a featured post!
|
2870
|
+
.end
|
2871
|
+
```
|
2872
|
+
|
2873
|
+
#### Loops
|
2874
|
+
```
|
2875
|
+
.each item in collection
|
2876
|
+
content
|
2877
|
+
.end
|
2878
|
+
|
2879
|
+
.each post in posts
|
2880
|
+
%{post.title}
|
2881
|
+
.end
|
2882
|
+
```
|
2883
|
+
|
2884
|
+
#### Includes
|
2885
|
+
```
|
2886
|
+
.include "file.lt3"
|
2887
|
+
.include "templates/header.lt3"
|
2888
|
+
```
|
2889
|
+
|
2890
|
+
## API Reference
|
2891
|
+
|
2892
|
+
### Core classes
|
2893
|
+
|
2894
|
+
#### Scriptorium::Repo
|
2895
|
+
Main repository class for managing Scriptorium sites.
|
2896
|
+
|
2897
|
+
**Methods:**
|
2898
|
+
```ruby
|
2899
|
+
# Initialize repository
|
2900
|
+
repo = Scriptorium::Repo.open(path)
|
2901
|
+
|
2902
|
+
# Create new repository
|
2903
|
+
repo = Scriptorium::Repo.create(path, title, description)
|
2904
|
+
|
2905
|
+
# Get current view
|
2906
|
+
view = repo.current_view
|
2907
|
+
|
2908
|
+
# List all views
|
2909
|
+
views = repo.views
|
2910
|
+
|
2911
|
+
# Create post
|
2912
|
+
post = repo.create_post(title: "Title", body: "Content")
|
2913
|
+
|
2914
|
+
# Get post by ID
|
2915
|
+
post = repo.post(id)
|
2916
|
+
|
2917
|
+
# List all posts
|
2918
|
+
posts = repo.all_posts
|
2919
|
+
```
|
2920
|
+
|
2921
|
+
#### Scriptorium::View
|
2922
|
+
Represents a view within a repository.
|
2923
|
+
|
2924
|
+
**Methods:**
|
2925
|
+
```ruby
|
2926
|
+
# Get view name
|
2927
|
+
name = view.name
|
2928
|
+
|
2929
|
+
# Get view title
|
2930
|
+
title = view.title
|
2931
|
+
|
2932
|
+
# Get view directory
|
2933
|
+
dir = view.dir
|
2934
|
+
|
2935
|
+
# Generate view
|
2936
|
+
view.generate
|
2937
|
+
|
2938
|
+
# Apply theme
|
2939
|
+
view.apply_theme(theme_name)
|
2940
|
+
```
|
2941
|
+
|
2942
|
+
#### Scriptorium::Post
|
2943
|
+
Represents a blog post.
|
2944
|
+
|
2945
|
+
**Methods:**
|
2946
|
+
```ruby
|
2947
|
+
# Get post title
|
2948
|
+
title = post.title
|
2949
|
+
|
2950
|
+
# Get post body
|
2951
|
+
body = post.body
|
2952
|
+
|
2953
|
+
# Get post tags
|
2954
|
+
tags = post.tags
|
2955
|
+
|
2956
|
+
# Get post views
|
2957
|
+
views = post.views
|
2958
|
+
|
2959
|
+
# Update post
|
2960
|
+
post.update(fields)
|
2961
|
+
|
2962
|
+
# Delete post
|
2963
|
+
post.delete
|
2964
|
+
```
|
2965
|
+
|
2966
|
+
### Widget classes
|
2967
|
+
|
2968
|
+
#### Scriptorium::Widget::Links
|
2969
|
+
Links widget for displaying external links.
|
2970
|
+
|
2971
|
+
**Methods:**
|
2972
|
+
```ruby
|
2973
|
+
# Get list of links
|
2974
|
+
links = widget.get_list
|
2975
|
+
|
2976
|
+
# Generate widget
|
2977
|
+
widget.generate
|
2978
|
+
|
2979
|
+
# Get widget card content
|
2980
|
+
card = widget.card
|
2981
|
+
```
|
2982
|
+
|
2983
|
+
#### Scriptorium::Widget::Pages
|
2984
|
+
Pages widget for displaying internal pages.
|
2985
|
+
|
2986
|
+
**Methods:**
|
2987
|
+
```ruby
|
2988
|
+
# Generate widget
|
2989
|
+
widget.generate
|
2990
|
+
|
2991
|
+
# Get widget card content
|
2992
|
+
card = widget.card
|
2993
|
+
```
|
2994
|
+
|
2995
|
+
#### Scriptorium::Widget::FeaturedPosts
|
2996
|
+
Featured posts widget for highlighting specific posts.
|
2997
|
+
|
2998
|
+
**Methods:**
|
2999
|
+
```ruby
|
3000
|
+
# Parse featured line
|
3001
|
+
post_id, title = widget.parse_featured_line(line)
|
3002
|
+
|
3003
|
+
# Get post title
|
3004
|
+
title = widget.get_post_title(post_id)
|
3005
|
+
|
3006
|
+
# Generate widget
|
3007
|
+
widget.generate
|
3008
|
+
```
|
3009
|
+
|
3010
|
+
### Helper methods
|
3011
|
+
|
3012
|
+
#### File operations
|
3013
|
+
```ruby
|
3014
|
+
# Read file
|
3015
|
+
content = read_file(path)
|
3016
|
+
|
3017
|
+
# Write file
|
3018
|
+
write_file(path, content)
|
3019
|
+
|
3020
|
+
# Check if file exists
|
3021
|
+
exists = file_exist?(path)
|
3022
|
+
|
3023
|
+
# Make directory
|
3024
|
+
make_dir(path)
|
3025
|
+
```
|
3026
|
+
|
3027
|
+
#### HTML generation
|
3028
|
+
```ruby
|
3029
|
+
# Generate HTML card
|
3030
|
+
html = html_card(title, tag, content)
|
3031
|
+
|
3032
|
+
# Generate HTML container
|
3033
|
+
html = html_container(content)
|
3034
|
+
|
3035
|
+
# Generate HTML body
|
3036
|
+
html = html_body(css) { content }
|
3037
|
+
```
|
3038
|
+
|
3039
|
+
## View Tree Structure
|
3040
|
+
|
3041
|
+
### Repository structure
|
3042
|
+
```
|
3043
|
+
repository/
|
3044
|
+
├── config/
|
3045
|
+
│ ├── repo.txt # Repository configuration
|
3046
|
+
│ ├── deploy.txt # Deployment configuration
|
3047
|
+
│ └── widgets.txt # Available widgets
|
3048
|
+
├── views/
|
3049
|
+
│ ├── sample/ # Sample view
|
3050
|
+
│ │ ├── config.txt # View configuration
|
3051
|
+
│ │ ├── config/ # View-specific config
|
3052
|
+
│ │ ├── posts/ # Post files
|
3053
|
+
│ │ ├── pages/ # Page files
|
3054
|
+
│ │ ├── widgets/ # Widget configurations
|
3055
|
+
│ │ ├── themes/ # View-specific themes
|
3056
|
+
│ │ ├── layout/ # Layout files
|
3057
|
+
│ │ ├── output/ # Generated output
|
3058
|
+
│ │ └── staging/ # Staging area
|
3059
|
+
│ └── other-view/ # Additional views
|
3060
|
+
├── themes/
|
3061
|
+
│ └── standard/ # Standard theme
|
3062
|
+
│ ├── config.txt # Theme configuration
|
3063
|
+
│ ├── assets/ # Theme assets
|
3064
|
+
│ ├── templates/ # Theme templates
|
3065
|
+
│ └── layout/ # Theme layout
|
3066
|
+
├── posts/ # Global posts
|
3067
|
+
├── drafts/ # Draft posts
|
3068
|
+
└── .scriptorium # Repository metadata
|
3069
|
+
```
|
3070
|
+
|
3071
|
+
### View structure
|
3072
|
+
```
|
3073
|
+
view/
|
3074
|
+
├── config.txt # View configuration
|
3075
|
+
├── config/ # Configuration files
|
3076
|
+
│ ├── layout.txt # Layout configuration
|
3077
|
+
│ ├── header.txt # Header configuration
|
3078
|
+
│ ├── left.txt # Left sidebar configuration
|
3079
|
+
│ ├── right.txt # Right sidebar configuration
|
3080
|
+
│ ├── main.txt # Main content configuration
|
3081
|
+
│ └── footer.txt # Footer configuration
|
3082
|
+
├── posts/ # Post files
|
3083
|
+
│ ├── 001.lt3 # Post 001
|
3084
|
+
│ ├── 002.lt3 # Post 002
|
3085
|
+
│ └── ... # Additional posts
|
3086
|
+
├── pages/ # Page files
|
3087
|
+
│ ├── about.html # About page
|
3088
|
+
│ ├── contact.html # Contact page
|
3089
|
+
│ └── ... # Additional pages
|
3090
|
+
├── widgets/ # Widget configurations
|
3091
|
+
│ ├── links/ # Links widget
|
3092
|
+
│ │ └── list.txt # Links list
|
3093
|
+
│ ├── pages/ # Pages widget
|
3094
|
+
│ │ └── list.txt # Pages list
|
3095
|
+
│ └── featuredposts/ # Featured posts widget
|
3096
|
+
│ └── list.txt # Featured posts list
|
3097
|
+
├── themes/ # View-specific themes
|
3098
|
+
├── layout/ # Layout files
|
3099
|
+
│ ├── header.html # Header template
|
3100
|
+
│ ├── footer.html # Footer template
|
3101
|
+
│ └── ... # Additional layout files
|
3102
|
+
├── output/ # Generated output
|
3103
|
+
│ ├── index.html # Front page
|
3104
|
+
│ ├── posts/ # Generated post pages
|
3105
|
+
│ ├── pages/ # Generated page files
|
3106
|
+
│ ├── assets/ # Assets (CSS, JS, images)
|
3107
|
+
│ └── widgets/ # Generated widget files
|
3108
|
+
└── staging/ # Staging area
|
3109
|
+
```
|
3110
|
+
|
3111
|
+
### Theme structure
|
3112
|
+
```
|
3113
|
+
theme/
|
3114
|
+
├── config.txt # Theme configuration
|
3115
|
+
├── assets/ # Theme assets
|
3116
|
+
│ ├── images/ # Theme images
|
3117
|
+
│ ├── fonts/ # Theme fonts
|
3118
|
+
│ └── ... # Additional assets
|
3119
|
+
├── templates/ # Theme templates
|
3120
|
+
│ ├── index.lt3 # Front page template
|
3121
|
+
│ ├── post.lt3 # Post template
|
3122
|
+
│ └── widget.lt3 # Widget template
|
3123
|
+
├── layout/ # Theme layout
|
3124
|
+
│ ├── config/ # Layout configuration
|
3125
|
+
│ ├── gen/ # Generated files
|
3126
|
+
│ └── layout.txt # Layout structure
|
3127
|
+
├── header/ # Header templates
|
3128
|
+
├── initial/ # Initial content
|
3129
|
+
└── ... # Additional theme files
|
3130
|
+
```
|
3131
|
+
|
3132
|
+
### File naming conventions
|
3133
|
+
|
3134
|
+
#### Posts
|
3135
|
+
- Format: `NNN-title.lt3` (e.g., `001-my-first-post.lt3`)
|
3136
|
+
- ID must be three-digit number
|
3137
|
+
- Title should be lowercase with hyphens
|
3138
|
+
|
3139
|
+
#### Pages
|
3140
|
+
- Format: `name.html` (e.g., `about.html`, `contact.html`)
|
3141
|
+
- Use descriptive, lowercase names
|
3142
|
+
- Avoid spaces and special characters
|
3143
|
+
|
3144
|
+
#### Widgets
|
3145
|
+
- Directory names: lowercase with hyphens
|
3146
|
+
- Configuration files: `list.txt` or `config.txt`
|
3147
|
+
- Generated files: `widget-name-card.html`
|
3148
|
+
|
3149
|
+
#### Themes
|
3150
|
+
- Directory names: lowercase with hyphens
|
3151
|
+
- Configuration: `config.txt`
|
3152
|
+
- Templates: `.lt3` extension
|
3153
|
+
|
3154
|
+
This reference section provides the technical details needed for advanced Scriptorium usage and development. For more specific information about certain areas, consult the relevant sections of this user guide or the Scriptorium source code.
|
3155
|
+
|