opentwig 1.0.5 โ 1.1.0
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.
- package/AGENTS.md +323 -0
- package/API.md +582 -0
- package/CODE_OF_CONDUCT.md +91 -0
- package/CONTRIBUTING.md +312 -0
- package/README.md +171 -7
- package/SECURITY.md +56 -0
- package/THEME_DEVELOPMENT.md +388 -0
- package/package.json +19 -3
- package/src/constants.js +14 -2
- package/src/index.js +14 -2
- package/src/live-ui/editor.js +173 -0
- package/src/live-ui/preview.js +77 -0
- package/src/live-ui/sidebar.js +523 -0
- package/src/utils/escapeHTML.js +10 -0
- package/src/utils/generateOGImage.js +51 -10
- package/src/utils/parseArgs.js +33 -2
- package/src/utils/readImageAsBase64.js +16 -4
- package/src/utils/setupWatcher.js +69 -0
- package/src/utils/showHelp.js +15 -2
- package/src/utils/startLiveServer.js +218 -0
- package/src/utils/websocketServer.js +53 -0
- package/test-og.js +40 -0
- package/theme/dark/style.css +1 -0
- package/theme/default/index.js +10 -8
- package/validateConfig.js +59 -0
- package/vitest.config.js +11 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Contributing to OpenTwig ๐ฟ
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to OpenTwig! This guide will help you get started as a contributor to our open source project.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## ๐ Table of Contents
|
|
7
|
+
|
|
8
|
+
- [Getting Started](#getting-started)
|
|
9
|
+
- [Development Setup](#development-setup)
|
|
10
|
+
- [How to Contribute](#how-to-contribute)
|
|
11
|
+
- [Project Structure](#project-structure)
|
|
12
|
+
- [Code Style Guide](#code-style-guide)
|
|
13
|
+
- [Testing](#testing)
|
|
14
|
+
- [Pull Request Process](#pull-request-process)
|
|
15
|
+
- [Reporting Bugs](#reporting-bugs)
|
|
16
|
+
- [Suggesting Features](#suggesting-features)
|
|
17
|
+
- [Community Guidelines](#community-guidelines)
|
|
18
|
+
|
|
19
|
+
## ๐ Getting Started
|
|
20
|
+
|
|
21
|
+
1. **Fork the repository** on GitHub
|
|
22
|
+
2. **Clone your fork** locally:
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/YOUR_USERNAME/opentwig.git
|
|
25
|
+
cd opentwig
|
|
26
|
+
```
|
|
27
|
+
3. **Add upstream remote**:
|
|
28
|
+
```bash
|
|
29
|
+
git remote add upstream https://github.com/tufantunc/opentwig.git
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## ๐ ๏ธ Development Setup
|
|
33
|
+
|
|
34
|
+
### Prerequisites
|
|
35
|
+
- Node.js (v14 or higher)
|
|
36
|
+
- npm or yarn
|
|
37
|
+
- Git
|
|
38
|
+
|
|
39
|
+
### Installation
|
|
40
|
+
1. Install dependencies:
|
|
41
|
+
```bash
|
|
42
|
+
npm install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
2. Test the CLI tool:
|
|
46
|
+
```bash
|
|
47
|
+
npm start -- --help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
3. Create a test config and try building:
|
|
51
|
+
```bash
|
|
52
|
+
npm start -- --init
|
|
53
|
+
npm start
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## ๐ค How to Contribute
|
|
57
|
+
|
|
58
|
+
### Types of Contributions
|
|
59
|
+
|
|
60
|
+
We welcome various types of contributions:
|
|
61
|
+
|
|
62
|
+
#### ๐ **Bug Fixes**
|
|
63
|
+
- Fix issues labeled `bug`
|
|
64
|
+
- Improve error handling
|
|
65
|
+
- Fix typos in documentation
|
|
66
|
+
|
|
67
|
+
#### โจ **New Features**
|
|
68
|
+
- Add new themes
|
|
69
|
+
- Implement new CLI commands
|
|
70
|
+
- Add support for new image formats
|
|
71
|
+
- Enhance existing functionality
|
|
72
|
+
|
|
73
|
+
#### ๐ **Documentation**
|
|
74
|
+
- Improve README sections
|
|
75
|
+
- Add code comments
|
|
76
|
+
- Create tutorials or guides
|
|
77
|
+
- Translate documentation
|
|
78
|
+
|
|
79
|
+
#### ๐จ **Themes & Styling**
|
|
80
|
+
- Create new themes
|
|
81
|
+
- Improve existing theme designs
|
|
82
|
+
- Add responsive improvements
|
|
83
|
+
- Fix accessibility issues
|
|
84
|
+
|
|
85
|
+
#### ๐ง **Development Experience**
|
|
86
|
+
- Add tests
|
|
87
|
+
- Improve build process
|
|
88
|
+
- Add linting/formatting
|
|
89
|
+
- Update dependencies
|
|
90
|
+
|
|
91
|
+
### Good First Issues
|
|
92
|
+
|
|
93
|
+
Look for issues with these labels:
|
|
94
|
+
- `good first issue` - Perfect for newcomers
|
|
95
|
+
- `documentation` - Documentation improvements
|
|
96
|
+
- `theme` - Theme-related work
|
|
97
|
+
|
|
98
|
+
## ๐ Project Structure
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
opentwig/
|
|
102
|
+
โโโ src/
|
|
103
|
+
โ โโโ index.js # Main CLI entry point
|
|
104
|
+
โ โโโ constants.js # App constants
|
|
105
|
+
โ โโโ utils/ # Core utilities
|
|
106
|
+
โ โโโ buildPage.js # Page building logic
|
|
107
|
+
โ โโโ generateHTML.js # HTML generation
|
|
108
|
+
โ โโโ generateOGImage.js # Open Graph images
|
|
109
|
+
โ โโโ generateQR.js # QR code generation
|
|
110
|
+
โ โโโ processCSS.js # CSS processing
|
|
111
|
+
โ โโโ ...
|
|
112
|
+
โโโ theme/
|
|
113
|
+
โ โโโ default/ # Default theme
|
|
114
|
+
โ โ โโโ index.js # Theme template
|
|
115
|
+
โ โ โโโ style.css # Theme styles
|
|
116
|
+
โ โ โโโ components/ # Reusable components
|
|
117
|
+
โ โโโ dark/ # Dark theme
|
|
118
|
+
โ โโโ minimal/ # Minimal theme
|
|
119
|
+
โ โโโ colorful/ # Colorful theme
|
|
120
|
+
โ โโโ azure/ # Azure theme
|
|
121
|
+
โโโ dist/ # Generated output (gitignored)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Key Files Explained
|
|
125
|
+
|
|
126
|
+
- **`src/index.js`**: Main CLI entry point, handles argument parsing
|
|
127
|
+
- **`src/utils/buildPage.js`**: Orchestrates the page building process
|
|
128
|
+
- **`theme/*/index.js`**: Theme-specific HTML templates
|
|
129
|
+
- **`theme/*/style.css`**: Theme-specific CSS styles
|
|
130
|
+
- **`theme/*/components/`**: Reusable component templates
|
|
131
|
+
|
|
132
|
+
## ๐ป Code Style Guide
|
|
133
|
+
|
|
134
|
+
### JavaScript
|
|
135
|
+
- Use ES6+ features where appropriate
|
|
136
|
+
- Follow camelCase for variables and functions
|
|
137
|
+
- Use meaningful variable names
|
|
138
|
+
- Add JSDoc comments for functions
|
|
139
|
+
- Keep functions small and focused
|
|
140
|
+
|
|
141
|
+
### CSS
|
|
142
|
+
- Use consistent indentation (2 spaces)
|
|
143
|
+
- Use semantic class names
|
|
144
|
+
- Follow mobile-first responsive design
|
|
145
|
+
- Use CSS custom properties for theming
|
|
146
|
+
- Optimize for performance
|
|
147
|
+
|
|
148
|
+
### File Organization
|
|
149
|
+
- One function per file when possible
|
|
150
|
+
- Keep utility files focused
|
|
151
|
+
- Use clear, descriptive filenames
|
|
152
|
+
|
|
153
|
+
### Example Code Style
|
|
154
|
+
|
|
155
|
+
```javascript
|
|
156
|
+
/**
|
|
157
|
+
* Generates QR code for the given URL
|
|
158
|
+
* @param {string} url - The URL to encode
|
|
159
|
+
* @returns {string} SVG QR code string
|
|
160
|
+
*/
|
|
161
|
+
function generateQRCode(url) {
|
|
162
|
+
const qrOptions = {
|
|
163
|
+
type: 'svg',
|
|
164
|
+
width: 200,
|
|
165
|
+
margin: 2
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
return QrCode.generate(url, qrOptions);
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## ๐งช Testing
|
|
173
|
+
|
|
174
|
+
Before submitting a pull request:
|
|
175
|
+
|
|
176
|
+
1. **Test CLI functionality**:
|
|
177
|
+
```bash
|
|
178
|
+
npm start -- --init
|
|
179
|
+
npm start
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
2. **Test different themes**:
|
|
183
|
+
```bash
|
|
184
|
+
# Edit config.json to test different themes
|
|
185
|
+
npm start
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
3. **Check output files**:
|
|
189
|
+
- Verify HTML is valid
|
|
190
|
+
- Check CSS renders correctly
|
|
191
|
+
- Ensure images are processed properly
|
|
192
|
+
|
|
193
|
+
4. **Test edge cases**:
|
|
194
|
+
- Empty config
|
|
195
|
+
- Missing avatar
|
|
196
|
+
- Long text content
|
|
197
|
+
- Various image formats
|
|
198
|
+
|
|
199
|
+
## ๐ Pull Request Process
|
|
200
|
+
|
|
201
|
+
1. **Create a branch** from main:
|
|
202
|
+
```bash
|
|
203
|
+
git checkout -b feature/your-feature-name
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
2. **Make your changes**
|
|
207
|
+
|
|
208
|
+
3. **Test thoroughly**
|
|
209
|
+
|
|
210
|
+
4. **Commit with clear messages**:
|
|
211
|
+
```bash
|
|
212
|
+
git commit -m "feat: add new theme for better UX"
|
|
213
|
+
git commit -m "docs: improve setup instructions"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
5. **Push to your fork**:
|
|
217
|
+
```bash
|
|
218
|
+
git push origin feature/your-feature-name
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
6. **Open a Pull Request**
|
|
222
|
+
|
|
223
|
+
### PR Guidelines
|
|
224
|
+
|
|
225
|
+
- Use descriptive titles
|
|
226
|
+
- Link related issues
|
|
227
|
+
- Add screenshots for UI changes
|
|
228
|
+
- Describe testing performed
|
|
229
|
+
- Keep PRs focused and small when possible
|
|
230
|
+
|
|
231
|
+
### PR Title Format
|
|
232
|
+
- `feat:` New features
|
|
233
|
+
- `fix:` Bug fixes
|
|
234
|
+
- `docs:` Documentation changes
|
|
235
|
+
- `style:` Code style changes
|
|
236
|
+
- `refactor:` Code refactoring
|
|
237
|
+
- `test:` Adding or updating tests
|
|
238
|
+
- `chore:` Maintenance tasks
|
|
239
|
+
|
|
240
|
+
## ๐ Reporting Bugs
|
|
241
|
+
|
|
242
|
+
Found a bug? Help us fix it!
|
|
243
|
+
|
|
244
|
+
### Before Reporting
|
|
245
|
+
1. Check existing issues
|
|
246
|
+
2. Test with latest version
|
|
247
|
+
3. Try to reproduce consistently
|
|
248
|
+
|
|
249
|
+
### Bug Report Template
|
|
250
|
+
```markdown
|
|
251
|
+
**Bug Description**
|
|
252
|
+
Brief description of the bug
|
|
253
|
+
|
|
254
|
+
**Steps to Reproduce**
|
|
255
|
+
1. Run `npx opentwig --init`
|
|
256
|
+
2. Edit config.json with...
|
|
257
|
+
3. Run `npx opentwig`
|
|
258
|
+
4. See error...
|
|
259
|
+
|
|
260
|
+
**Expected Behavior**
|
|
261
|
+
What should happen instead
|
|
262
|
+
|
|
263
|
+
**Environment**
|
|
264
|
+
- Node.js version:
|
|
265
|
+
- Operating System:
|
|
266
|
+
- npm version:
|
|
267
|
+
|
|
268
|
+
**Additional Context**
|
|
269
|
+
Screenshots, error messages, etc.
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## ๐ก Suggesting Features
|
|
273
|
+
|
|
274
|
+
We love feature suggestions!
|
|
275
|
+
|
|
276
|
+
### Enhancement Guidelines
|
|
277
|
+
1. Check existing issues first
|
|
278
|
+
2. Describe the use case clearly
|
|
279
|
+
3. Consider backward compatibility
|
|
280
|
+
4. Think about implementation complexity
|
|
281
|
+
|
|
282
|
+
## ๐ Community Guidelines
|
|
283
|
+
|
|
284
|
+
### Code of Conduct
|
|
285
|
+
|
|
286
|
+
- Be respectful and inclusive
|
|
287
|
+
- Welcome newcomers and different skill levels
|
|
288
|
+
- Focus on constructive feedback
|
|
289
|
+
- Respect different opinions and approaches
|
|
290
|
+
|
|
291
|
+
### Getting Help
|
|
292
|
+
|
|
293
|
+
- Use GitHub Discussions for questions
|
|
294
|
+
- Check existing issues and PRs
|
|
295
|
+
- Read documentation thoroughly
|
|
296
|
+
- Be patient for responses
|
|
297
|
+
|
|
298
|
+
## ๐ Recognition
|
|
299
|
+
|
|
300
|
+
Contributors will be:
|
|
301
|
+
- Listed in the project README (if desired)
|
|
302
|
+
- Mentioned in release notes for significant contributions
|
|
303
|
+
- Given priority in code reviews and feedback
|
|
304
|
+
|
|
305
|
+
## ๐ Contact
|
|
306
|
+
|
|
307
|
+
Questions? Feel free to:
|
|
308
|
+
- Open an issue
|
|
309
|
+
- Start a discussion
|
|
310
|
+
- Contact maintainers
|
|
311
|
+
|
|
312
|
+
Thank you for contributing to OpenTwig! ๐
|
package/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# OpenTwig ๐ฟ
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/opentwig)
|
|
4
|
+
[](https://www.npmjs.com/package/opentwig)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://github.com/tufantunc/opentwig/stargazers)
|
|
8
|
+
[](https://github.com/tufantunc/opentwig/issues)
|
|
9
|
+
[]()
|
|
10
|
+
|
|
3
11
|
OpenTwig is an open source personal link page generator that creates beautiful, customizable "link in bio" pages. Instead of relying on third-party services, users can define their configuration and instantly create a fully functional static site they own and control.
|
|
4
12
|
|
|
5
13
|
## โจ Features
|
|
@@ -27,6 +35,9 @@ npx opentwig --init
|
|
|
27
35
|
# Edit the generated config.json with your information
|
|
28
36
|
# Then generate your page
|
|
29
37
|
npx opentwig
|
|
38
|
+
|
|
39
|
+
# Or use live preview with interactive editor
|
|
40
|
+
npx opentwig --live
|
|
30
41
|
```
|
|
31
42
|
|
|
32
43
|
### Prerequisites
|
|
@@ -34,6 +45,38 @@ npx opentwig
|
|
|
34
45
|
- Node.js (v14 or higher)
|
|
35
46
|
- npm or yarn
|
|
36
47
|
|
|
48
|
+
## ๐ฅ Live Preview Mode (NEW!)
|
|
49
|
+
|
|
50
|
+
OpenTwig now includes a powerful live preview mode with an interactive configuration editor!
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Start live preview with config editor
|
|
54
|
+
npx opentwig --live
|
|
55
|
+
|
|
56
|
+
# Or using npm script
|
|
57
|
+
npm run live
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Features:**
|
|
61
|
+
- ๐จ **Interactive Sidebar Editor** - Edit all config options in a beautiful UI
|
|
62
|
+
- ๐ **Real-time Preview** - See changes instantly as you edit
|
|
63
|
+
- ๐พ **Auto-save** - Changes automatically save to config.json
|
|
64
|
+
- ๐ฑ **Responsive Layout** - Preview on the left, editor on the right
|
|
65
|
+
- ๐ผ๏ธ **Avatar Upload** - Upload and preview avatar images directly
|
|
66
|
+
- ๐ญ **Theme Switcher** - Switch between themes instantly
|
|
67
|
+
- ๐ **Drag & Drop Links** - Easily manage your links
|
|
68
|
+
- ๐ **Status Indicator** - Connection status and auto-save status
|
|
69
|
+
- ๐ฅ **Export Config** - Download your config as JSON
|
|
70
|
+
|
|
71
|
+
**How it works:**
|
|
72
|
+
1. Run `npx opentwig --live` to start the development server
|
|
73
|
+
2. The browser opens automatically showing your page preview
|
|
74
|
+
3. Use the sidebar editor to modify configuration
|
|
75
|
+
4. Changes are auto-saved to `config.json`
|
|
76
|
+
5. Preview updates in real-time
|
|
77
|
+
6. Press `Ctrl+C` to stop the server
|
|
78
|
+
7. Your `dist/` folder is ready for deployment!
|
|
79
|
+
|
|
37
80
|
## ๐ Configuration
|
|
38
81
|
|
|
39
82
|
OpenTwig uses a simple JSON configuration file (`config.json`) to define your page. Here's the complete configuration structure:
|
|
@@ -135,6 +178,7 @@ The avatar feature is completely optional. If you don't include the `avatar` obj
|
|
|
135
178
|
- PNG
|
|
136
179
|
- JPG/JPEG
|
|
137
180
|
- WebP
|
|
181
|
+
- SVG
|
|
138
182
|
|
|
139
183
|
**Avatar processing:**
|
|
140
184
|
- Images are automatically optimized and resized
|
|
@@ -158,9 +202,9 @@ The avatar feature is completely optional. If you don't include the `avatar` obj
|
|
|
158
202
|
OpenTwig includes 4 beautiful themes:
|
|
159
203
|
|
|
160
204
|
- **Default**: Clean, modern design with subtle shadows and rounded corners
|
|
161
|
-
- **Dark**: Dark mode variant of the default theme
|
|
162
|
-
- **Minimal**: Simplified, minimalist design
|
|
163
|
-
- **Colorful**: Vibrant color scheme
|
|
205
|
+
- **Dark**: Dark mode variant of the default theme with gradient backgrounds and glassmorphism effects
|
|
206
|
+
- **Minimal**: Simplified, minimalist design with flat styling
|
|
207
|
+
- **Colorful**: Vibrant color scheme with animated gradients and shimmer effects
|
|
164
208
|
|
|
165
209
|
All themes are mobile-responsive and include:
|
|
166
210
|
- Optional custom avatar display
|
|
@@ -180,6 +224,12 @@ npx opentwig --init
|
|
|
180
224
|
|
|
181
225
|
# Generate page from config.json
|
|
182
226
|
npx opentwig
|
|
227
|
+
|
|
228
|
+
# Start live preview with config editor
|
|
229
|
+
npx opentwig --live
|
|
230
|
+
|
|
231
|
+
# Validate config.json
|
|
232
|
+
npx opentwig --validate-config
|
|
183
233
|
```
|
|
184
234
|
|
|
185
235
|
## ๐ Output Files
|
|
@@ -194,19 +244,53 @@ OpenTwig generates the following files in the `dist/` directory:
|
|
|
194
244
|
|
|
195
245
|
## ๐ง Development
|
|
196
246
|
|
|
247
|
+
### Development Setup
|
|
248
|
+
|
|
249
|
+
If you want to contribute to OpenTwig or customize it locally:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Clone the repository
|
|
253
|
+
git clone https://github.com/tufantunc/opentwig.git
|
|
254
|
+
cd opentwig
|
|
255
|
+
|
|
256
|
+
# Install dependencies
|
|
257
|
+
npm install
|
|
258
|
+
|
|
259
|
+
# Test the CLI
|
|
260
|
+
npm start -- --help
|
|
261
|
+
|
|
262
|
+
# Create a sample config for testing
|
|
263
|
+
npm start -- --init
|
|
264
|
+
|
|
265
|
+
# Test the build process
|
|
266
|
+
npm start
|
|
267
|
+
|
|
268
|
+
# Start live preview mode
|
|
269
|
+
npm run live
|
|
270
|
+
```
|
|
271
|
+
|
|
197
272
|
### Project Structure
|
|
198
273
|
|
|
199
274
|
```
|
|
200
275
|
opentwig/
|
|
201
276
|
โโโ src/
|
|
202
|
-
โ โโโ index.js # Main entry point
|
|
277
|
+
โ โโโ index.js # Main CLI entry point
|
|
203
278
|
โ โโโ constants.js # Application constants
|
|
204
|
-
โ
|
|
279
|
+
โ โโโ live-ui/ # Live preview UI
|
|
280
|
+
โ โ โโโ index.html # Live editor page
|
|
281
|
+
โ โ โโโ styles.css # Live editor styles
|
|
282
|
+
โ โ โโโ preview.js # Preview management
|
|
283
|
+
โ โ โโโ editor.js # Config editor logic
|
|
284
|
+
โ โ โโโ sidebar.js # Sidebar components
|
|
285
|
+
โ โโโ utils/ # Core utilities
|
|
205
286
|
โ โโโ buildPage.js # Page building logic
|
|
206
287
|
โ โโโ generateHTML.js # HTML generation
|
|
207
288
|
โ โโโ generateOGImage.js # Open Graph image creation
|
|
208
289
|
โ โโโ generateQR.js # QR code generation
|
|
209
290
|
โ โโโ processCSS.js # CSS processing and optimization
|
|
291
|
+
โ โโโ startLiveServer.js # Live preview server
|
|
292
|
+
โ โโโ websocketServer.js # WebSocket handling
|
|
293
|
+
โ โโโ setupWatcher.js # Config file watcher
|
|
210
294
|
โ โโโ ...
|
|
211
295
|
โโโ theme/
|
|
212
296
|
โ โโโ default/ # Default theme
|
|
@@ -216,7 +300,10 @@ opentwig/
|
|
|
216
300
|
โ โโโ dark/ # Dark theme
|
|
217
301
|
โ โโโ minimal/ # Minimal theme
|
|
218
302
|
โ โโโ colorful/ # Colorful theme
|
|
219
|
-
|
|
303
|
+
โโโ .github/ # GitHub templates
|
|
304
|
+
โ โโโ ISSUE_TEMPLATE/ # Issue templates
|
|
305
|
+
โ โโโ pull_request_template.md # PR template
|
|
306
|
+
โโโ dist/ # Generated output (gitignored)
|
|
220
307
|
```
|
|
221
308
|
|
|
222
309
|
### Key Features Implementation
|
|
@@ -237,15 +324,92 @@ Since OpenTwig generates static files, you can deploy to any static hosting serv
|
|
|
237
324
|
- **AWS S3**: Upload files to an S3 bucket
|
|
238
325
|
- **Any web server**: Upload the `dist/` folder to your server
|
|
239
326
|
|
|
327
|
+
## ๐ Showcase
|
|
328
|
+
|
|
329
|
+
Check out these amazing websites created with OpenTwig! These examples showcase sites made with OpenTwig:
|
|
330
|
+
|
|
331
|
+
### Featured Sites
|
|
332
|
+
|
|
333
|
+
- **[Tufan Tunรง - My Social Links](https://links.tufantunc.com)** - My social links, used default theme with avatar
|
|
334
|
+
|
|
335
|
+
### Submit Your Site
|
|
336
|
+
|
|
337
|
+
Have you created a website with OpenTwig? We'd love to showcase it! You can add your site to our showcase in two ways:
|
|
338
|
+
|
|
339
|
+
1. **Create an Issue** - Use our [showcase submission template](.github/ISSUE_TEMPLATE/showcase_submission.md)
|
|
340
|
+
2. **Submit a Pull Request** - Add your site directly to the showcase section in this README
|
|
341
|
+
|
|
342
|
+
#### Guidelines for Showcase Submissions
|
|
343
|
+
|
|
344
|
+
- โ
Your site must be live and accessible
|
|
345
|
+
- โ
Use OpenTwig to generate the site
|
|
346
|
+
- โ
Keep descriptions concise (1-2 sentences max)
|
|
347
|
+
|
|
348
|
+
#### What We Look For
|
|
349
|
+
|
|
350
|
+
- Creative use of themes and customization
|
|
351
|
+
- Different use cases (personal, business, portfolio, etc.)
|
|
352
|
+
- Good examples of various configuration options
|
|
353
|
+
- Sites that inspire other users
|
|
354
|
+
|
|
240
355
|
## ๐ License
|
|
241
356
|
|
|
242
357
|
MIT License - see [LICENSE](LICENSE) file for details
|
|
243
358
|
|
|
244
359
|
## ๐ค Contributing
|
|
245
360
|
|
|
246
|
-
|
|
361
|
+
OpenTwig is open source and welcomes contributions from the community! ๐
|
|
362
|
+
|
|
363
|
+
### Ways to Contribute
|
|
364
|
+
|
|
365
|
+
- ๐ **Report bugs** using our [bug report template](.github/ISSUE_TEMPLATE/bug_report.md)
|
|
366
|
+
- โจ **Suggest features** through our [feature request template](.github/ISSUE_TEMPLATE/feature_request.md)
|
|
367
|
+
- ๐ **Improve documentation** using our [documentation improvement template](.github/ISSUE_TEMPLATE/documentation_improvement.md)
|
|
368
|
+
- ๐ **Submit to showcase** using our [showcase submission template](.github/ISSUE_TEMPLATE/showcase_submission.md)
|
|
369
|
+
- ๐จ **Create themes** - add new visual styles and layouts
|
|
370
|
+
- ๐ง **Fix issues** - tackle open issues and improve the codebase
|
|
371
|
+
- ๐ **Translate** - help translate documentation and content
|
|
372
|
+
|
|
373
|
+
### Getting Started
|
|
374
|
+
|
|
375
|
+
1. **Read our [Contributing Guide](CONTRIBUTING.md)** - Complete guide for contributors
|
|
376
|
+
2. **Check our [Code of Conduct](CODE_OF_CONDUCT.md)** - Community guidelines
|
|
377
|
+
3. **Look for `good first issue` labels** - Perfect for newcomers
|
|
378
|
+
4. **Fork, code, and submit a PR** - Standard open source workflow
|
|
379
|
+
|
|
380
|
+
### Hacktoberfest 2025
|
|
381
|
+
|
|
382
|
+
๐ This repository participates in **Hacktoberfest 2025**!
|
|
383
|
+
|
|
384
|
+
- Look for issues with `hacktoberfest` and `good first issue` labels
|
|
385
|
+
- Follow our issue and PR templates
|
|
386
|
+
- Make meaningful contributions that benefit the project
|
|
387
|
+
- Review our [Contributing Guide](CONTRIBUTING.md) before starting
|
|
388
|
+
|
|
389
|
+
### Contributors
|
|
390
|
+
|
|
391
|
+
We appreciate all contributors! Contributors will be:
|
|
392
|
+
- Listed here (if desired)
|
|
393
|
+
- Mentioned in release notes for significant contributions
|
|
394
|
+
- Given priority for code reviews and feedback
|
|
247
395
|
|
|
248
396
|
## ๐ Links
|
|
249
397
|
|
|
250
398
|
- [GitHub Repository](https://github.com/tufantunc/opentwig)
|
|
251
399
|
- [NPM Package](https://www.npmjs.com/package/opentwig)
|
|
400
|
+
- [Issues](https://github.com/tufantunc/opentwig/issues)
|
|
401
|
+
- [Discussions](https://github.com/tufantunc/opentwig/discussions)
|
|
402
|
+
|
|
403
|
+
## ๐ง Config.json Validation
|
|
404
|
+
|
|
405
|
+
You can validate your configuration file using the CLI option:
|
|
406
|
+
```bash
|
|
407
|
+
npx opentwig --validate-config
|
|
408
|
+
```
|
|
409
|
+
### Available Commands
|
|
410
|
+
- `--help` - Show usage information
|
|
411
|
+
- `--init` - Create a sample config.json
|
|
412
|
+
- `--validate-config` - Validate the config.json file
|
|
413
|
+
- `build` - Compile the project files
|
|
414
|
+
- `start` - Run the project
|
|
415
|
+
- `test` - Execute the project tests
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Use this section to tell people about which versions of your project are
|
|
6
|
+
currently being supported with security updates.
|
|
7
|
+
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
| ------- | ------------------ |
|
|
10
|
+
| 1.0.x | :white_check_mark: |
|
|
11
|
+
| < 1.0 | :x: |
|
|
12
|
+
|
|
13
|
+
## Reporting a Vulnerability
|
|
14
|
+
|
|
15
|
+
We take the security of OpenTwig seriously. If you discover a security vulnerability, please report it to us responsibly.
|
|
16
|
+
|
|
17
|
+
### How to Report
|
|
18
|
+
|
|
19
|
+
Please **do not** create a public GitHub issue for security vulnerabilities. Instead:
|
|
20
|
+
|
|
21
|
+
1. **Email us directly**: [tufan@tufantunc.com](mailto:tufan@tufantunc.com)
|
|
22
|
+
2. **Subject line**: Include "SECURITY" in the subject
|
|
23
|
+
3. **Include details**:
|
|
24
|
+
- Description of the vulnerability
|
|
25
|
+
- Steps to reproduce
|
|
26
|
+
- Potential impact
|
|
27
|
+
- Suggested fixes (if any)
|
|
28
|
+
|
|
29
|
+
### What to Expect
|
|
30
|
+
|
|
31
|
+
- **Acknowledgement**: We'll acknowledge your report within 48 hours
|
|
32
|
+
- **Assessment**: We'll investigate and assess the vulnerability
|
|
33
|
+
- **Resolution**: We'll work on a fix and keep you updated
|
|
34
|
+
- **Disclosure**: After fixing, we'll coordinate disclosure timing with you
|
|
35
|
+
|
|
36
|
+
### Security Best Practices
|
|
37
|
+
|
|
38
|
+
When reporting security issues:
|
|
39
|
+
|
|
40
|
+
1. **Don't exploit**: Don't attempt to exploit the vulnerability on production systems
|
|
41
|
+
2. **Be responsible**: Give us reasonable time to fix before public disclosure
|
|
42
|
+
3. **Be detailed**: Provide as much detail as possible about the issue
|
|
43
|
+
4. **Be patient**: Complex security issues may take time to properly address
|
|
44
|
+
|
|
45
|
+
## Security Considerations
|
|
46
|
+
|
|
47
|
+
OpenTwig is a static site generator, which reduces many security risks. However, please note:
|
|
48
|
+
|
|
49
|
+
- **Static files**: OpenTwig generates static HTML/CSS files with no server-side processing
|
|
50
|
+
- **Dependencies**: Keep dependencies updated via regular updates
|
|
51
|
+
- **Configuration**: Review configuration files for sensitive information
|
|
52
|
+
- **Assets**: Ensure uploaded images and content don't contain malicious code
|
|
53
|
+
|
|
54
|
+
## Thank You
|
|
55
|
+
|
|
56
|
+
We appreciate security researchers helping keep OpenTwig secure. Contributors who report valid security vulnerabilities will be acknowledged in our security advisories (unless they prefer to remain anonymous).
|