mirror of
https://github.com/Dvorinka/bizoni.git
synced 2026-06-05 03:02:57 +00:00
Compare commits
18 Commits
516161c1b3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a89d6e1a63 | |||
| 60a4b82931 | |||
| efa35518ab | |||
| cc6841e723 | |||
| 4c904a1546 | |||
| 76c447a395 | |||
| a6b47de1a4 | |||
| 2f65bc03e6 | |||
| ac9930767e | |||
| 4f3164956a | |||
| f8a6abf391 | |||
| 45facf7aa0 | |||
| c9c322ff95 | |||
| 3a7c1bbcba | |||
| 03b9abd32d | |||
| 21574a8b30 | |||
| 4773e4cab1 | |||
| 362f55e28a |
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
# Remote Blog Management - Complete Guide
|
||||
|
||||
## 🎯 Goal
|
||||
Remove local blog files and work exclusively with remote server blogs.
|
||||
|
||||
## 📋 Options Available
|
||||
|
||||
### Option 1: Quick Remove Local Blogs
|
||||
```bash
|
||||
# Run this in your bizoni directory
|
||||
./remove-local-blogs.sh
|
||||
```
|
||||
|
||||
### Option 2: Ubuntu Server Management Script
|
||||
```bash
|
||||
# Upload to your Ubuntu server and run
|
||||
./ubuntu-remote-blogs.sh migrate
|
||||
```
|
||||
|
||||
### Option 3: Backend Configuration (Recommended)
|
||||
Update backend to work with remote blogs only.
|
||||
|
||||
## 🚀 Recommended Deployment Steps
|
||||
|
||||
### Step 1: Remove Local Blogs
|
||||
```bash
|
||||
cd /home/tdvorak/Desktop/HTML_Projekty/bizoni
|
||||
./remove-local-blogs.sh
|
||||
```
|
||||
|
||||
### Step 2: Update Backend Configuration
|
||||
The backend is now configured to work with remote blogs at `/var/www/bizoni/blog`.
|
||||
|
||||
You can set the remote path with environment variable:
|
||||
```bash
|
||||
export REMOTE_BLOG_DIR="/var/www/bizoni/blog"
|
||||
```
|
||||
|
||||
### Step 3: Deploy Backend to Server
|
||||
1. Build the updated backend
|
||||
2. Deploy to your server
|
||||
3. Set REMOTE_BLOG_DIR environment variable
|
||||
|
||||
### Step 4: Run Migration on Server
|
||||
```bash
|
||||
# On your Ubuntu server
|
||||
./ubuntu-remote-blogs.sh migrate
|
||||
```
|
||||
|
||||
## 📁 File Structure After Changes
|
||||
|
||||
### Local (Development)
|
||||
```
|
||||
bizoni/
|
||||
├── backend/main.go # Updated for remote blogs
|
||||
├── admin/new.html # Updated with new fields
|
||||
├── js/admin-auth.js # Login persistence
|
||||
├── tools/migrate_slugs.go # Migration tool
|
||||
├── remove-local-blogs.sh # Local cleanup script
|
||||
└── ubuntu-remote-blogs.sh # Server management script
|
||||
```
|
||||
|
||||
### Server (Production)
|
||||
```
|
||||
/var/www/bizoni/
|
||||
├── blog/
|
||||
│ ├── 0000.html # Original numeric files
|
||||
│ ├── 0001.html
|
||||
│ ├── jdeme-do-finale.html # New slug files
|
||||
│ └── 1-zapas-final-score.html
|
||||
├── img/blog/
|
||||
│ ├── 0000.png
|
||||
│ └── 0001.png
|
||||
└── backend # Updated backend
|
||||
```
|
||||
|
||||
## 🔧 Ubuntu Server Script Usage
|
||||
|
||||
### List All Blogs
|
||||
```bash
|
||||
./ubuntu-remote-blogs.sh list
|
||||
```
|
||||
|
||||
### Migrate All Blogs to Slugs
|
||||
```bash
|
||||
./ubuntu-remote-blogs.sh migrate
|
||||
```
|
||||
|
||||
### Show Blog Info
|
||||
```bash
|
||||
./ubuntu-remote-blogs.sh info 0030
|
||||
```
|
||||
|
||||
### Add Slug to Specific Blog
|
||||
```bash
|
||||
./ubuntu-remote-blogs.sh add-slug 0030
|
||||
```
|
||||
|
||||
### Create Backup
|
||||
```bash
|
||||
./ubuntu-remote-blogs.sh backup
|
||||
```
|
||||
|
||||
## 🌐 URL Structure After Migration
|
||||
|
||||
### Before
|
||||
- `/blog/0030.html`
|
||||
- `/blog/0001.html`
|
||||
|
||||
### After
|
||||
- `/blog/jdeme-do-finale` (clean URL)
|
||||
- `/blog/1-zapas-final-score`
|
||||
- `/blog/0030.html` (still works for backward compatibility)
|
||||
|
||||
## ⚠️ Important Notes
|
||||
|
||||
1. **Backup First**: Always create backup before migration
|
||||
2. **Test Locally**: Test backend with REMOTE_BLOG_DIR set to local copy
|
||||
3. **Deploy Gradually**: Deploy backend first, then run migration
|
||||
4. **Environment Variables**: Use REMOTE_BLOG_DIR for flexibility
|
||||
|
||||
## 🔄 Environment Variables
|
||||
|
||||
Set these on your server:
|
||||
|
||||
```bash
|
||||
# Path to remote blog directory
|
||||
export REMOTE_BLOG_DIR="/var/www/bizoni/blog"
|
||||
|
||||
# Port for backend (if needed)
|
||||
export PORT="8080"
|
||||
|
||||
# Static files path
|
||||
export STATIC_PATH="/var/www/bizoni"
|
||||
```
|
||||
|
||||
## 🚨 Troubleshooting
|
||||
|
||||
### Backend Can't Find Blogs
|
||||
```bash
|
||||
# Check if directory exists
|
||||
ls -la /var/www/bizoni/blog
|
||||
|
||||
# Set correct path
|
||||
export REMOTE_BLOG_DIR="/correct/path/to/blogs"
|
||||
```
|
||||
|
||||
### Migration Script Fails
|
||||
```bash
|
||||
# Make script executable
|
||||
chmod +x ubuntu-remote-blogs.sh
|
||||
|
||||
# Update paths in script
|
||||
nano ubuntu-remote-blogs.sh
|
||||
```
|
||||
|
||||
### Permission Issues
|
||||
```bash
|
||||
# Fix permissions on server
|
||||
sudo chown -R www-data:www-data /var/www/bizoni/blog
|
||||
sudo chmod -R 755 /var/www/bizoni/blog
|
||||
```
|
||||
|
||||
## 📞 Next Steps
|
||||
|
||||
1. **Choose your option** (1, 2, or 3)
|
||||
2. **Remove local blogs** with the provided script
|
||||
3. **Deploy updated backend** to server
|
||||
4. **Run migration** on server
|
||||
5. **Test new URLs** and admin interface
|
||||
|
||||
Your blog system will then work entirely with remote server blogs! 🎉
|
||||
@@ -40,6 +40,7 @@
|
||||
.kpi .it { background:#f3f4f6; border:1px solid var(--border); border-radius:8px; padding:10px; text-align:center; }
|
||||
small.code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; background:#f3f4f6; border:1px solid var(--border); border-radius:6px; padding:2px 6px; }
|
||||
</style>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="admin-with-sidenav">
|
||||
<aside class="admin-sidenav">
|
||||
@@ -233,7 +234,13 @@
|
||||
s.textContent = 'Načítám…';
|
||||
const res = await fetch('/api/blog/latest?limit=12');
|
||||
if (!res.ok) throw new Error('HTTP '+res.status);
|
||||
const items = await res.json();
|
||||
let items = await res.json();
|
||||
// Defensive sort: numeric ID descending ensures newest first regardless of API ordering
|
||||
items.sort((a,b)=>{
|
||||
const ai = parseInt(a.id,10); const bi = parseInt(b.id,10);
|
||||
if (!isNaN(ai) && !isNaN(bi)) return bi-ai;
|
||||
return (b.id||'').localeCompare(a.id||'');
|
||||
});
|
||||
grid.innerHTML='';
|
||||
if (!Array.isArray(items) || items.length === 0) {
|
||||
grid.innerHTML = '<div class="muted">Žádné příspěvky.</div>';
|
||||
|
||||
+8
-1
@@ -18,6 +18,7 @@
|
||||
header { display:flex; justify-content: space-between; align-items:center; margin-bottom: 16px; }
|
||||
.badge { background: #111827; color: #fff; padding: 6px 10px; border-radius: 999px; font-size: 12px; }
|
||||
</style>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="admin-with-sidenav">
|
||||
<aside class="admin-sidenav">
|
||||
@@ -52,7 +53,13 @@
|
||||
try {
|
||||
const res = await fetch('/api/blog/latest?limit=12');
|
||||
if (!res.ok) throw new Error('HTTP '+res.status);
|
||||
const items = await res.json();
|
||||
let items = await res.json();
|
||||
// Defensive sort: numeric ID descending ensures newest first regardless of API ordering
|
||||
items.sort((a,b)=>{
|
||||
const ai = parseInt(a.id,10); const bi = parseInt(b.id,10);
|
||||
if (!isNaN(ai) && !isNaN(bi)) return bi-ai;
|
||||
return (b.id||'').localeCompare(a.id||'');
|
||||
});
|
||||
status.textContent = `Nalezeno: ${items.length}`;
|
||||
mount.innerHTML = '';
|
||||
if (!Array.isArray(items) || items.length === 0) {
|
||||
|
||||
+112
-2
@@ -32,6 +32,7 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.snow.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.min.js"></script>
|
||||
<script src="../js/admin-auth.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="admin-with-sidenav">
|
||||
<aside class="admin-sidenav">
|
||||
@@ -62,6 +63,23 @@
|
||||
<label for="title">Titulek</label>
|
||||
<input type="text" id="title" name="title" placeholder="Např. FC Bizoni vyhráli finále" required />
|
||||
</div>
|
||||
<div>
|
||||
<label for="slug">URL slug (použije se v adrese)</label>
|
||||
<input type="text" id="slug" name="slug" placeholder="napr-fc-bizoni-vyhrali-finale" pattern="[a-z0-9-]+" title="Pouze malá písmena, číslice a pomlčky" />
|
||||
<div class="muted" style="margin-top:6px">Automaticky se vygeneruje z titulku, pokud nezadáte vlastní.</div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="annotation">Anotace (krátký popis pro SEO a sociální sítě)</label>
|
||||
<input type="text" id="annotation" name="annotation" placeholder="Krátký popis článku (150-300 znaků)" maxlength="300" />
|
||||
<div class="muted" style="margin-top:6px">Použije se pro SEO description a při sdílení na sociálních sítích.</div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="content-mode">Způsob zadávání obsahu</label>
|
||||
<select id="content-mode" name="content-mode" style="width: 100%; padding: 10px; border:1px solid #d1d5db; border-radius: 8px; font-size: 14px;">
|
||||
<option value="visual">Vizuální editor (Quill)</option>
|
||||
<option value="html">HTML kód</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="categories">Kategorie (oddělené čárkou)</label>
|
||||
<input type="text" id="categories" name="categories" placeholder="Zápasy, O nás" />
|
||||
@@ -87,7 +105,12 @@
|
||||
</div>
|
||||
<div>
|
||||
<label for="editor">Obsah (vizuální editor)</label>
|
||||
<div id="visual-editor-wrapper">
|
||||
<div id="editor"></div>
|
||||
</div>
|
||||
<div id="html-editor-wrapper" style="display: none;">
|
||||
<textarea id="html-content" name="html-content" rows="12" placeholder="Zadejte HTML kód obsahu..." style="width: 100%; padding: 10px; border:1px solid #d1d5db; border-radius: 8px; font-size: 14px; font-family: 'Courier New', monospace;"></textarea>
|
||||
</div>
|
||||
<!-- Hidden textarea to submit HTML (kept focusable-safe by moving offscreen) -->
|
||||
<textarea id="content" name="content" rows="12" style="position:absolute; left:-10000px; width:1px; height:1px; overflow:hidden;"></textarea>
|
||||
<div class="muted">Obsah bude vložen do sekce <code><div class="text lte-text-page clearfix">...</div></code> podle šablony <code>blog/0030.html</code>.</div>
|
||||
@@ -140,6 +163,60 @@
|
||||
const inputId = document.getElementById('post-id');
|
||||
const inputTitle = document.getElementById('title');
|
||||
const inputCats = document.getElementById('categories');
|
||||
const inputSlug = document.getElementById('slug');
|
||||
const inputAnnotation = document.getElementById('annotation');
|
||||
const contentModeSelect = document.getElementById('content-mode');
|
||||
const visualEditorWrapper = document.getElementById('visual-editor-wrapper');
|
||||
const htmlEditorWrapper = document.getElementById('html-editor-wrapper');
|
||||
const htmlContentTextarea = document.getElementById('html-content');
|
||||
|
||||
// Content mode switching
|
||||
contentModeSelect.addEventListener('change', () => {
|
||||
const mode = contentModeSelect.value;
|
||||
if (mode === 'visual') {
|
||||
visualEditorWrapper.style.display = 'block';
|
||||
htmlEditorWrapper.style.display = 'none';
|
||||
} else {
|
||||
visualEditorWrapper.style.display = 'none';
|
||||
htmlEditorWrapper.style.display = 'block';
|
||||
// Sync current content to HTML textarea
|
||||
const currentContent = quill.root.innerHTML;
|
||||
htmlContentTextarea.value = currentContent;
|
||||
}
|
||||
});
|
||||
|
||||
// Sync content from HTML to visual when switching back
|
||||
contentModeSelect.addEventListener('change', () => {
|
||||
if (contentModeSelect.value === 'visual') {
|
||||
const htmlContent = htmlContentTextarea.value;
|
||||
if (htmlContent.trim()) {
|
||||
quill.root.innerHTML = htmlContent;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Auto-generate slug from title
|
||||
function generateSlug(text) {
|
||||
return text
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.replace(/[^\w\s-]/g, '') // Remove special characters
|
||||
.replace(/[\s_-]+/g, '-') // Replace spaces and underscores with hyphen
|
||||
.replace(/^-+|-+$/g, ''); // Remove leading/trailing hyphens
|
||||
}
|
||||
|
||||
// Update slug when title changes (if slug is empty)
|
||||
inputTitle.addEventListener('input', () => {
|
||||
if (!inputSlug.value || inputSlug.dataset.autoGenerated === 'true') {
|
||||
inputSlug.value = generateSlug(inputTitle.value);
|
||||
inputSlug.dataset.autoGenerated = 'true';
|
||||
}
|
||||
});
|
||||
|
||||
// Mark slug as manually edited when user types in it
|
||||
inputSlug.addEventListener('input', () => {
|
||||
inputSlug.dataset.autoGenerated = 'false';
|
||||
});
|
||||
|
||||
let pastedBlob = null; // holds clipboard/fetched blob if provided
|
||||
|
||||
@@ -209,8 +286,21 @@
|
||||
const data = await res.json();
|
||||
inputId.value = data.id || id;
|
||||
inputTitle.value = data.title || '';
|
||||
inputSlug.value = data.slug || '';
|
||||
inputAnnotation.value = data.annotation || '';
|
||||
inputCats.value = Array.isArray(data.categories) ? data.categories.join(', ') : '';
|
||||
|
||||
// Set content mode and load content
|
||||
if (data.content_mode === 'html') {
|
||||
contentModeSelect.value = 'html';
|
||||
htmlContentTextarea.value = data.content_html || '';
|
||||
visualEditorWrapper.style.display = 'none';
|
||||
htmlEditorWrapper.style.display = 'block';
|
||||
} else {
|
||||
contentModeSelect.value = 'visual';
|
||||
quill.root.innerHTML = data.content_html || '';
|
||||
}
|
||||
|
||||
// show current image preview
|
||||
preview.style.display = 'flex';
|
||||
previewImg.src = '/img/blog/' + (data.id || id) + '.png';
|
||||
@@ -245,10 +335,22 @@
|
||||
// Move Quill HTML into the hidden textarea
|
||||
// Merge category checkboxes into text input
|
||||
reconcileCategories();
|
||||
const html = quill.root.innerHTML;
|
||||
|
||||
// Get content based on mode
|
||||
let html;
|
||||
if (contentModeSelect.value === 'html') {
|
||||
html = htmlContentTextarea.value.trim();
|
||||
} else {
|
||||
html = quill.root.innerHTML;
|
||||
}
|
||||
|
||||
document.getElementById('content').value = html;
|
||||
|
||||
// Validate content is not empty (avoid browser required on hidden field)
|
||||
const plain = quill.getText().trim();
|
||||
const plain = contentModeSelect.value === 'html' ?
|
||||
html.replace(/<[^>]*>/g, '').trim() : // Strip HTML for validation
|
||||
quill.getText().trim();
|
||||
|
||||
if (!plain) {
|
||||
result.textContent = 'Vyplňte obsah článku.';
|
||||
result.classList.add('err');
|
||||
@@ -256,6 +358,10 @@
|
||||
return;
|
||||
}
|
||||
const fd = new FormData(form);
|
||||
// Add annotation and content mode to form data
|
||||
fd.set('annotation', inputAnnotation.value);
|
||||
fd.set('content_mode', contentModeSelect.value);
|
||||
|
||||
// Prefer pasted/fetched blob if present when no file was chosen
|
||||
if (pastedBlob && !(imageInput.files && imageInput.files[0])) {
|
||||
const ext = (pastedBlob.type === 'image/jpeg') ? 'jpg' : 'png';
|
||||
@@ -300,6 +406,10 @@
|
||||
result.appendChild(a);
|
||||
form.reset(); preview.style.display = 'none';
|
||||
quill.setContents([]);
|
||||
htmlContentTextarea.value = '';
|
||||
contentModeSelect.value = 'visual';
|
||||
visualEditorWrapper.style.display = 'block';
|
||||
htmlEditorWrapper.style.display = 'none';
|
||||
}
|
||||
} catch (err) {
|
||||
result.textContent = 'Chyba: ' + (err.message || err);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
.search { border:1px solid #d1d5db; padding: 6px 10px; border-radius: 8px; min-width: 260px; }
|
||||
.status { margin: 12px 0; color: #6b7280; }
|
||||
</style>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="admin-with-sidenav">
|
||||
<aside class="admin-sidenav">
|
||||
|
||||
+602
-53
@@ -6,6 +6,11 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/draw"
|
||||
_ "image/jpeg"
|
||||
"image/png"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -19,17 +24,15 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/draw"
|
||||
"image/png"
|
||||
_ "image/jpeg"
|
||||
)
|
||||
|
||||
const (
|
||||
clubID = "441d3783-06aa-436a-b438-359300ee0371"
|
||||
clubType = "futsal"
|
||||
baseURL = "https://facr.tdvorak.dev"
|
||||
fallbackBaseURL = "https://flashscore.tdvorak.dev"
|
||||
fallbackClubID = "xzS3gX3T"
|
||||
fallbackSlug = "uherske-hradiste"
|
||||
)
|
||||
|
||||
// Paths
|
||||
@@ -51,47 +54,63 @@ const (
|
||||
// avgLuma computes average luminance of an image (0..255)
|
||||
func avgLuma(img image.Image) float64 {
|
||||
b := img.Bounds()
|
||||
if b.Empty() { return 0 }
|
||||
if b.Empty() {
|
||||
return 0
|
||||
}
|
||||
var sum uint64
|
||||
var n uint64
|
||||
for y := b.Min.Y; y < b.Max.Y; y += 4 { // sample every 4th row for speed
|
||||
for x := b.Min.X; x < b.Max.X; x += 4 { // sample every 4th column
|
||||
r,g,bv,_ := img.At(x,y).RGBA()
|
||||
r8 := float64(r>>8)
|
||||
g8 := float64(g>>8)
|
||||
b8 := float64(bv>>8)
|
||||
r, g, bv, _ := img.At(x, y).RGBA()
|
||||
r8 := float64(r >> 8)
|
||||
g8 := float64(g >> 8)
|
||||
b8 := float64(bv >> 8)
|
||||
// Rec. 601 approximate luma
|
||||
l := 0.299*r8 + 0.587*g8 + 0.114*b8
|
||||
if l < 0 { l = 0 }
|
||||
if l > 255 { l = 255 }
|
||||
if l < 0 {
|
||||
l = 0
|
||||
}
|
||||
if l > 255 {
|
||||
l = 255
|
||||
}
|
||||
sum += uint64(l)
|
||||
n++
|
||||
}
|
||||
}
|
||||
if n == 0 { return 0 }
|
||||
return float64(sum)/float64(n)
|
||||
if n == 0 {
|
||||
return 0
|
||||
}
|
||||
return float64(sum) / float64(n)
|
||||
}
|
||||
|
||||
// fitWithin returns destination size that fits source into max size, without upscaling
|
||||
func fitWithin(sw, sh, mw, mh int) (int, int) {
|
||||
if sw <= 0 || sh <= 0 { return 0, 0 }
|
||||
if sw <= 0 || sh <= 0 {
|
||||
return 0, 0
|
||||
}
|
||||
if sw <= mw && sh <= mh {
|
||||
return sw, sh
|
||||
}
|
||||
wr := float64(mw) / float64(sw)
|
||||
hr := float64(mh) / float64(sh)
|
||||
r := wr
|
||||
if hr < wr { r = hr }
|
||||
if hr < wr {
|
||||
r = hr
|
||||
}
|
||||
dw := int(float64(sw) * r)
|
||||
dh := int(float64(sh) * r)
|
||||
if dw < 1 { dw = 1 }
|
||||
if dh < 1 { dh = 1 }
|
||||
if dw < 1 {
|
||||
dw = 1
|
||||
}
|
||||
if dh < 1 {
|
||||
dh = 1
|
||||
}
|
||||
return dw, dh
|
||||
}
|
||||
|
||||
// scaleNearest performs nearest-neighbor downscaling from src to a new RGBA of size (dw, dh)
|
||||
func scaleNearest(src image.Image, dw, dh int) *image.RGBA {
|
||||
dst := image.NewRGBA(image.Rect(0,0,dw,dh))
|
||||
dst := image.NewRGBA(image.Rect(0, 0, dw, dh))
|
||||
sb := src.Bounds()
|
||||
sw := sb.Dx()
|
||||
sh := sb.Dy()
|
||||
@@ -127,23 +146,31 @@ func normalizeBlogImage(r io.Reader, outPath string) error {
|
||||
scaled = scaleNearest(img, dw, dh)
|
||||
}
|
||||
// Compose centered on canvas
|
||||
canvas := image.NewRGBA(image.Rect(0,0,blogImgW,blogImgH))
|
||||
draw.Draw(canvas, canvas.Bounds(), &image.Uniform{C:bg}, image.Point{}, draw.Src)
|
||||
canvas := image.NewRGBA(image.Rect(0, 0, blogImgW, blogImgH))
|
||||
draw.Draw(canvas, canvas.Bounds(), &image.Uniform{C: bg}, image.Point{}, draw.Src)
|
||||
offX := (blogImgW - dw) / 2
|
||||
offY := (blogImgH - dh) / 2
|
||||
draw.Draw(canvas, image.Rect(offX, offY, offX+dw, offY+dh), scaled, scaled.Bounds().Min, draw.Over)
|
||||
// Write PNG atomically
|
||||
if err := os.MkdirAll(filepath.Dir(outPath), 0755); err != nil { return err }
|
||||
if err := os.MkdirAll(filepath.Dir(outPath), 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
tmp := outPath + ".tmp"
|
||||
f, err := os.Create(tmp)
|
||||
if err != nil { return err }
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
enc := png.Encoder{CompressionLevel: png.BestSpeed}
|
||||
if err := enc.Encode(f, canvas); err != nil {
|
||||
f.Close(); _ = os.Remove(tmp); return fmt.Errorf("encode png: %w", err)
|
||||
f.Close()
|
||||
_ = os.Remove(tmp)
|
||||
return fmt.Errorf("encode png: %w", err)
|
||||
}
|
||||
f.Close()
|
||||
_ = os.Remove(outPath)
|
||||
if err := os.Rename(tmp, outPath); err != nil { return err }
|
||||
if err := os.Rename(tmp, outPath); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -306,6 +333,14 @@ func refreshVideos(ctx context.Context) error {
|
||||
return fmt.Errorf("yt get: %w", err)
|
||||
}
|
||||
items := resp.Videos
|
||||
if len(items) == 0 {
|
||||
// API returned empty data; keep existing local videos as fallback
|
||||
vc.mu.RLock()
|
||||
existingCount := len(vc.data.Items)
|
||||
vc.mu.RUnlock()
|
||||
log.Printf("warn: yt api returned 0 videos; keeping %d existing videos", existingCount)
|
||||
return nil
|
||||
}
|
||||
if len(items) > 5 {
|
||||
items = items[:5]
|
||||
}
|
||||
@@ -373,6 +408,28 @@ func writeVideosJSON() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func loadVideosJSON() error {
|
||||
path := videosPath()
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("read videos json: %w", err)
|
||||
}
|
||||
var payload struct {
|
||||
FetchedAt time.Time `json:"fetched_at"`
|
||||
Channel string `json:"channel"`
|
||||
Items []YTVideo `json:"items"`
|
||||
}
|
||||
if err := json.Unmarshal(b, &payload); err != nil {
|
||||
return fmt.Errorf("unmarshal videos json: %w", err)
|
||||
}
|
||||
vc.mu.Lock()
|
||||
vc.data.FetchedAt = payload.FetchedAt
|
||||
vc.data.Channel = payload.Channel
|
||||
vc.data.Items = payload.Items
|
||||
vc.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
func videosPath() string {
|
||||
if p := os.Getenv("VIDEOS_PATH"); p != "" {
|
||||
return p
|
||||
@@ -393,12 +450,72 @@ func ytChannel() string {
|
||||
type BlogItem struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Slug string `json:"slug"`
|
||||
Link string `json:"link"`
|
||||
Image string `json:"image"`
|
||||
MTime time.Time `json:"mtime"`
|
||||
Categories []string `json:"categories,omitempty"`
|
||||
}
|
||||
|
||||
// generateSlug creates a URL-friendly slug from a title
|
||||
func generateSlug(title string) string {
|
||||
slug := strings.ToLower(title)
|
||||
// Replace Czech characters with their ASCII equivalents
|
||||
replacements := map[string]string{
|
||||
"á": "a", "ä": "a", "č": "c", "ď": "d", "é": "e", "ě": "e", "í": "i", "ľ": "l",
|
||||
"ň": "n", "ó": "o", "ö": "o", "ô": "o", "ř": "r", "š": "s", "ť": "t", "ú": "u",
|
||||
"ů": "u", "ý": "y", "ž": "z",
|
||||
"Á": "a", "Ä": "a", "Č": "c", "Ď": "d", "É": "e", "Ě": "e", "Í": "i", "Ľ": "l",
|
||||
"Ň": "n", "Ó": "o", "Ö": "o", "Ô": "o", "Ř": "r", "Š": "s", "Ť": "t", "Ú": "u",
|
||||
"Ů": "u", "Ý": "y", "Ž": "z",
|
||||
}
|
||||
for czech, ascii := range replacements {
|
||||
slug = strings.ReplaceAll(slug, czech, ascii)
|
||||
}
|
||||
// Remove any character that isn't alphanumeric, space, or hyphen
|
||||
re := regexp.MustCompile(`[^a-z0-9\s-]`)
|
||||
slug = re.ReplaceAllString(slug, "")
|
||||
// Replace spaces and multiple hyphens with a single hyphen
|
||||
re = regexp.MustCompile(`[\s-]+`)
|
||||
slug = re.ReplaceAllString(slug, "-")
|
||||
// Remove leading and trailing hyphens
|
||||
slug = strings.Trim(slug, "-")
|
||||
return slug
|
||||
}
|
||||
|
||||
// ensureUniqueSlug ensures the slug is unique by appending a number if needed
|
||||
func ensureUniqueSlug(siteRoot, baseSlug string) string {
|
||||
blogDir := filepath.Join(siteRoot, "blog")
|
||||
entries, err := os.ReadDir(blogDir)
|
||||
if err != nil {
|
||||
return baseSlug
|
||||
}
|
||||
existingSlugs := make(map[string]bool)
|
||||
for _, e := range entries {
|
||||
if !strings.HasSuffix(e.Name(), ".html") {
|
||||
continue
|
||||
}
|
||||
// Extract slug from filename if it follows the new pattern
|
||||
name := strings.TrimSuffix(e.Name(), ".html")
|
||||
// Check if it's a slug-based filename (contains letters, not just numbers)
|
||||
if regexp.MustCompile(`[a-z]`).MatchString(name) {
|
||||
existingSlugs[name] = true
|
||||
}
|
||||
}
|
||||
if !existingSlugs[baseSlug] {
|
||||
return baseSlug
|
||||
}
|
||||
// Try baseSlug-2, baseSlug-3, etc.
|
||||
for i := 2; i < 100; i++ {
|
||||
testSlug := fmt.Sprintf("%s-%d", baseSlug, i)
|
||||
if !existingSlugs[testSlug] {
|
||||
return testSlug
|
||||
}
|
||||
}
|
||||
// Fallback to timestamp
|
||||
return fmt.Sprintf("%s-%d", baseSlug, time.Now().Unix())
|
||||
}
|
||||
|
||||
func extractCategories(path string) []string {
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
@@ -415,55 +532,189 @@ func extractCategories(path string) []string {
|
||||
return categories
|
||||
}
|
||||
|
||||
// listLatestBlogs scans the blog and image folders under the provided site root and returns the latest N posts
|
||||
// extractAnnotation extracts the annotation from blog HTML meta tags
|
||||
func extractAnnotation(path string) string {
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
s := string(b)
|
||||
// Try to find description in meta tag first
|
||||
re := regexp.MustCompile(`(?is)<meta name="description" content="([^"]+)"`)
|
||||
m := re.FindStringSubmatch(s)
|
||||
if len(m) >= 2 {
|
||||
return m[1]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// extractContentMode extracts the content mode from blog HTML meta tags
|
||||
func extractContentMode(path string) string {
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
s := string(b)
|
||||
// Try to find content_mode in meta tag first
|
||||
re := regexp.MustCompile(`(?is)<meta name="content_mode" content="([^"]+)"`)
|
||||
m := re.FindStringSubmatch(s)
|
||||
if len(m) >= 2 {
|
||||
return m[1]
|
||||
}
|
||||
// Default to visual if not found
|
||||
return "visual"
|
||||
}
|
||||
|
||||
// extractSlug extracts the slug from blog HTML meta tags or generates from filename
|
||||
func extractSlug(path, filename string) string {
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return extractSlugFromContent(string(b))
|
||||
}
|
||||
|
||||
// extractSlugFromContent extracts the slug from HTML content string
|
||||
func extractSlugFromContent(htmlContent string) string {
|
||||
re := regexp.MustCompile(`(?is)<meta name="slug" content="([^"]+)"`)
|
||||
m := re.FindStringSubmatch(htmlContent)
|
||||
if len(m) >= 2 {
|
||||
return m[1]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func extractBlogID(path, filename string) string {
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return strings.TrimSuffix(filename, ".html")
|
||||
}
|
||||
s := string(b)
|
||||
// Try to find ID in meta tag first
|
||||
re := regexp.MustCompile(`(?is)<meta name="id" content="([^"]+)"`)
|
||||
m := re.FindStringSubmatch(s)
|
||||
if len(m) >= 2 {
|
||||
return m[1]
|
||||
}
|
||||
// Fallback: use filename without extension
|
||||
return strings.TrimSuffix(filename, ".html")
|
||||
}
|
||||
|
||||
func listLatestBlogs(siteRoot string, limit int) ([]BlogItem, error) {
|
||||
// Use the siteRoot path where blogs are actually located
|
||||
blogDir := filepath.Join(siteRoot, "blog")
|
||||
imgDir := filepath.Join(siteRoot, "img", "blog")
|
||||
|
||||
// For local development, you can override with environment variable
|
||||
if envPath := os.Getenv("REMOTE_BLOG_DIR"); envPath != "" {
|
||||
blogDir = envPath
|
||||
}
|
||||
|
||||
// If blog directory doesn't exist, return error
|
||||
if _, err := os.Stat(blogDir); os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("blog directory not found: %s. Set REMOTE_BLOG_DIR environment variable or ensure blog directory exists", blogDir)
|
||||
}
|
||||
|
||||
imgDir := filepath.Join(filepath.Dir(blogDir), "img", "blog")
|
||||
entries, err := os.ReadDir(blogDir)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("readdir blog: %w", err)
|
||||
}
|
||||
re := regexp.MustCompile(`^(\d{4})\.html$`)
|
||||
// Match both numeric (0001.html) and slug-based filenames
|
||||
re := regexp.MustCompile(`^(\d{4}|[a-z0-9-]+)\.html$`)
|
||||
var items []BlogItem
|
||||
seenIDs := make(map[string]bool) // Track seen IDs to avoid duplicates
|
||||
for _, e := range entries {
|
||||
name := e.Name()
|
||||
if !re.MatchString(name) {
|
||||
continue
|
||||
}
|
||||
id := strings.TrimSuffix(name, ".html")
|
||||
|
||||
// Title and categories extraction from blog HTML
|
||||
blogPath := filepath.Join(blogDir, name)
|
||||
title := extractTitle(blogPath)
|
||||
slug := extractSlug(blogPath, name)
|
||||
cats := extractCategories(blogPath)
|
||||
|
||||
// Determine canonical ID: prefer numeric when available.
|
||||
// This ensures consistent item identity regardless of whether the
|
||||
// numeric or slug filename is encountered first in the directory.
|
||||
canonicalID := id
|
||||
if regexp.MustCompile(`^[a-z]`).MatchString(id) {
|
||||
numericFiles, _ := filepath.Glob(filepath.Join(blogDir, "????.html"))
|
||||
for _, numericFile := range numericFiles {
|
||||
numericID := strings.TrimSuffix(filepath.Base(numericFile), ".html")
|
||||
numericPath := filepath.Join(blogDir, numericFile)
|
||||
numericSlug := extractSlug(numericPath, numericFile)
|
||||
if numericSlug == id {
|
||||
canonicalID = numericID
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Skip if this canonical ID or its slug was already processed (deduplication)
|
||||
if seenIDs[canonicalID] || (slug != "" && seenIDs[slug]) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Mark both canonical ID and slug as seen
|
||||
seenIDs[canonicalID] = true
|
||||
if slug != "" {
|
||||
seenIDs[slug] = true
|
||||
}
|
||||
// Determine mod time - prefer image modtime if exists, else html
|
||||
mtime := time.Time{}
|
||||
htmlInfo, err1 := os.Stat(filepath.Join(blogDir, name))
|
||||
if err1 == nil {
|
||||
mtime = htmlInfo.ModTime()
|
||||
}
|
||||
if imgInfo, err2 := os.Stat(filepath.Join(imgDir, id+".png")); err2 == nil {
|
||||
// For image path, canonicalID is already numeric when a numeric file exists
|
||||
imageID := canonicalID
|
||||
if imgInfo, err2 := os.Stat(filepath.Join(imgDir, imageID+".png")); err2 == nil {
|
||||
// If image is newer, use that as a proxy for recency
|
||||
if imgInfo.ModTime().After(mtime) {
|
||||
mtime = imgInfo.ModTime()
|
||||
}
|
||||
}
|
||||
// Use slug-based link if slug exists and is not just numeric, otherwise use canonical numeric ID
|
||||
var link string
|
||||
if slug != "" && regexp.MustCompile(`[a-z]`).MatchString(slug) {
|
||||
link = "/blog/" + slug
|
||||
} else {
|
||||
link = "/blog/" + canonicalID + ".html"
|
||||
}
|
||||
items = append(items, BlogItem{
|
||||
ID: id,
|
||||
ID: canonicalID,
|
||||
Title: title,
|
||||
Link: "/blog/" + id + ".html",
|
||||
Image: "/img/blog/" + id + ".png",
|
||||
Slug: slug,
|
||||
Link: link,
|
||||
Image: "/img/blog/" + imageID + ".png",
|
||||
MTime: mtime,
|
||||
Categories: cats,
|
||||
})
|
||||
}
|
||||
sort.Slice(items, func(i, j int) bool {
|
||||
// Descending by mod time, fallback to numeric ID desc
|
||||
// Always prefer numeric ID descending (higher ID = newer post).
|
||||
// Numeric IDs monotonically increase via nextBlogID, so they are
|
||||
// the authoritative ordering regardless of file MTime.
|
||||
ii, err1 := strconv.Atoi(items[i].ID)
|
||||
jj, err2 := strconv.Atoi(items[j].ID)
|
||||
if err1 == nil && err2 == nil {
|
||||
return ii > jj
|
||||
}
|
||||
// If only one item has a numeric ID, it is newer
|
||||
if err1 == nil {
|
||||
return true
|
||||
}
|
||||
if err2 == nil {
|
||||
return false
|
||||
}
|
||||
// Both non-numeric: fall back to MTime, then string comparison
|
||||
if !items[i].MTime.Equal(items[j].MTime) {
|
||||
return items[i].MTime.After(items[j].MTime)
|
||||
}
|
||||
ii, _ := strconv.Atoi(items[i].ID)
|
||||
jj, _ := strconv.Atoi(items[j].ID)
|
||||
return ii > jj
|
||||
return items[i].ID > items[j].ID
|
||||
})
|
||||
if limit > 0 && len(items) > limit {
|
||||
items = items[:limit]
|
||||
@@ -471,6 +722,26 @@ func listLatestBlogs(siteRoot string, limit int) ([]BlogItem, error) {
|
||||
return items, nil
|
||||
}
|
||||
|
||||
// validateBlogOrdering performs a startup health check to catch ordering regressions early.
|
||||
func validateBlogOrdering(siteRoot string) error {
|
||||
items, err := listLatestBlogs(siteRoot, 12)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(items) < 2 {
|
||||
return nil
|
||||
}
|
||||
for i := 0; i < len(items)-1; i++ {
|
||||
ii, e1 := strconv.Atoi(items[i].ID)
|
||||
jj, e2 := strconv.Atoi(items[i+1].ID)
|
||||
if e1 == nil && e2 == nil && ii <= jj {
|
||||
return fmt.Errorf("blog ordering suspect: %s (%d) should be newer than %s (%d)", items[i].ID, ii, items[i+1].ID, jj)
|
||||
}
|
||||
}
|
||||
log.Printf("blog ordering validated: newest=%s total=%d", items[0].ID, len(items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// extractTitle finds the first <h1>...</h1> and returns its inner text (very simple, best-effort)
|
||||
func extractTitle(path string) string {
|
||||
b, err := os.ReadFile(path)
|
||||
@@ -606,11 +877,21 @@ func main() {
|
||||
go scheduler(ctx)
|
||||
go videosScheduler(ctx)
|
||||
|
||||
// Load previously persisted videos so we have a fallback if yt api fails
|
||||
if err := loadVideosJSON(); err != nil {
|
||||
log.Printf("no persisted videos to load: %v", err)
|
||||
}
|
||||
|
||||
// Initial videos fetch on startup to warm cache
|
||||
if err := refreshVideos(ctx); err != nil {
|
||||
log.Printf("initial videos refresh error: %v", err)
|
||||
}
|
||||
|
||||
// Startup validation: warn if blog ordering looks wrong
|
||||
if err := validateBlogOrdering(staticPath()); err != nil {
|
||||
log.Printf("blog ordering validation: %v", err)
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
||||
okCORS(w)
|
||||
@@ -652,6 +933,25 @@ func main() {
|
||||
w.Write([]byte(";"))
|
||||
})
|
||||
|
||||
// Blog list JSON for frontend
|
||||
mux.HandleFunc("/data/blog-list.json", func(w http.ResponseWriter, r *http.Request) {
|
||||
okCORS(w)
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
limit := 50 // Default limit for blog list
|
||||
if q := r.URL.Query().Get("limit"); q != "" {
|
||||
if n, err := strconv.Atoi(q); err == nil && n > 0 {
|
||||
limit = n
|
||||
}
|
||||
}
|
||||
items, err := listLatestBlogs(staticPath(), limit)
|
||||
if err != nil {
|
||||
log.Printf("blog-list.json error: %v", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
_ = json.NewEncoder(w).Encode(items)
|
||||
})
|
||||
|
||||
// Blog API: latest N posts from filesystem
|
||||
mux.HandleFunc("/api/blog/latest", func(w http.ResponseWriter, r *http.Request) {
|
||||
okCORS(w)
|
||||
@@ -758,12 +1058,15 @@ func main() {
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
// Expect multipart form with: title, content (HTML), image (png), categories (comma-separated)
|
||||
// Expect multipart form with: title, slug, annotation, content_mode, content (HTML), image (png), categories (comma-separated)
|
||||
if err := r.ParseMultipartForm(20 << 20); err != nil { // 20MB
|
||||
http.Error(w, "invalid form", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
title := strings.TrimSpace(r.FormValue("title"))
|
||||
slugInput := strings.TrimSpace(r.FormValue("slug"))
|
||||
annotation := strings.TrimSpace(r.FormValue("annotation"))
|
||||
contentMode := strings.TrimSpace(r.FormValue("content_mode"))
|
||||
htmlContent := strings.TrimSpace(r.FormValue("content"))
|
||||
catsRaw := strings.TrimSpace(r.FormValue("categories"))
|
||||
var cats []string
|
||||
@@ -779,6 +1082,10 @@ func main() {
|
||||
http.Error(w, "missing title or content", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
// Default content mode to visual if not specified
|
||||
if contentMode == "" {
|
||||
contentMode = "visual"
|
||||
}
|
||||
f, fh, err := r.FormFile("image")
|
||||
if err != nil {
|
||||
http.Error(w, "missing image", http.StatusBadRequest)
|
||||
@@ -799,6 +1106,18 @@ func main() {
|
||||
return
|
||||
}
|
||||
idStr := fmt.Sprintf("%04d", nid)
|
||||
|
||||
// Determine slug
|
||||
var finalSlug string
|
||||
if slugInput != "" {
|
||||
// Use provided slug (already validated by frontend)
|
||||
finalSlug = slugInput
|
||||
} else {
|
||||
// Generate from title
|
||||
baseSlug := generateSlug(title)
|
||||
finalSlug = ensureUniqueSlug(site, baseSlug)
|
||||
}
|
||||
|
||||
// Write image (normalize to 1600x969 with letterboxing)
|
||||
imgDir := filepath.Join(site, "img", "blog")
|
||||
if err := os.MkdirAll(imgDir, 0755); err != nil {
|
||||
@@ -839,26 +1158,103 @@ func main() {
|
||||
reHead := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHead.ReplaceAllString(s, meta+"</head>")
|
||||
}
|
||||
// Write new blog html
|
||||
// Inject slug as <meta name="slug" content="..."> before </head>
|
||||
slugMeta := "<meta name=\"slug\" content=\"" + htmlEscape(finalSlug) + "\">\n"
|
||||
reHeadSlug := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadSlug.ReplaceAllString(s, slugMeta+"</head>")
|
||||
// Inject annotation as <meta name="description" content="..."> before </head>
|
||||
if annotation != "" {
|
||||
annotationMeta := "<meta name=\"description\" content=\"" + htmlEscape(annotation) + "\">\n"
|
||||
reHeadAnnotation := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadAnnotation.ReplaceAllString(s, annotationMeta+"</head>")
|
||||
}
|
||||
// Inject content mode as <meta name="content_mode" content="..."> before </head>
|
||||
contentModeMeta := "<meta name=\"content_mode\" content=\"" + htmlEscape(contentMode) + "\">\n"
|
||||
reHeadContentMode := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadContentMode.ReplaceAllString(s, contentModeMeta+"</head>")
|
||||
// Inject Rybbit analytics script before </head>
|
||||
rybbitScript := "<script src=\"https://rybbit.tdvorak.dev/api/script.js\" data-site-id=\"d40b7ffffffa\" defer></script>\n"
|
||||
reHeadRybbit := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadRybbit.ReplaceAllString(s, rybbitScript+"</head>")
|
||||
|
||||
// Write new blog html with both numeric and slug filenames
|
||||
blogDir := filepath.Join(site, "blog")
|
||||
if err := os.MkdirAll(blogDir, 0755); err != nil {
|
||||
http.Error(w, "storage error: blog dir", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// Write numeric file (for backward compatibility)
|
||||
htmlPath := filepath.Join(blogDir, idStr+".html")
|
||||
if err := os.WriteFile(htmlPath, []byte(s), 0644); err != nil {
|
||||
http.Error(w, "cannot write blog (is STATIC_PATH read-only?)", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// Write slug file (new format)
|
||||
slugPath := filepath.Join(blogDir, finalSlug+".html")
|
||||
if err := os.WriteFile(slugPath, []byte(s), 0644); err != nil {
|
||||
http.Error(w, "cannot write slug blog (is STATIC_PATH read-only?)", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{
|
||||
"id": idStr,
|
||||
"link": "/blog/" + idStr + ".html",
|
||||
"slug": finalSlug,
|
||||
"link": "/blog/" + finalSlug,
|
||||
"image": "/img/blog/" + idStr + ".png",
|
||||
"message": "created",
|
||||
})
|
||||
})
|
||||
|
||||
// Blog slug resolution: convert slug to numeric ID
|
||||
mux.HandleFunc("/api/blog/resolve", func(w http.ResponseWriter, r *http.Request) {
|
||||
okCORS(w)
|
||||
if r.Method != http.MethodGet {
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
slug := strings.TrimSpace(r.URL.Query().Get("slug"))
|
||||
if slug == "" {
|
||||
http.Error(w, "missing slug", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
// Validate slug format
|
||||
if !regexp.MustCompile(`^[a-z0-9-]+$`).MatchString(slug) {
|
||||
http.Error(w, "invalid slug format", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
site := staticPath()
|
||||
blogDir := filepath.Join(site, "blog")
|
||||
|
||||
// First try to find slug-based file
|
||||
slugPath := filepath.Join(blogDir, slug+".html")
|
||||
if b, err := os.ReadFile(slugPath); err == nil {
|
||||
s := string(b)
|
||||
// Try to find the corresponding numeric file
|
||||
entries, _ := os.ReadDir(blogDir)
|
||||
for _, e := range entries {
|
||||
name := e.Name()
|
||||
if !regexp.MustCompile(`^\d{4}\.html$`).MatchString(name) {
|
||||
continue
|
||||
}
|
||||
numericPath := filepath.Join(blogDir, name)
|
||||
numericContent, _ := os.ReadFile(numericPath)
|
||||
if string(numericContent) == s {
|
||||
// Found matching numeric file
|
||||
numericID := strings.TrimSuffix(name, ".html")
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{"id": numericID, "slug": slug})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If not found, return 404
|
||||
http.Error(w, "slug not found", http.StatusNotFound)
|
||||
})
|
||||
|
||||
// Blog fetch (admin): returns title, content html, image for editing
|
||||
mux.HandleFunc("/api/blog/get", func(w http.ResponseWriter, r *http.Request) {
|
||||
okCORS(w)
|
||||
@@ -901,9 +1297,12 @@ func main() {
|
||||
content = strings.TrimSpace(mc[1])
|
||||
}
|
||||
cats := extractCategories(path)
|
||||
slug := extractSlug(path, id+".html")
|
||||
annotation := extractAnnotation(path)
|
||||
contentMode := extractContentMode(path)
|
||||
img := "/img/blog/" + id + ".png"
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{"id": id, "title": title, "content_html": content, "image": img, "categories": cats})
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{"id": id, "title": title, "slug": slug, "annotation": annotation, "content_mode": contentMode, "content_html": content, "image": img, "categories": cats})
|
||||
})
|
||||
|
||||
// Blog edit (admin): update title/content and optionally replace image
|
||||
@@ -921,7 +1320,7 @@ func main() {
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
// Expect multipart form with: title, content (HTML), image (png), categories (comma-separated)
|
||||
// Expect multipart form with: title, slug, annotation, content_mode, content (HTML), image (png), categories (comma-separated)
|
||||
if err := r.ParseMultipartForm(25 << 20); err != nil {
|
||||
http.Error(w, "invalid form", http.StatusBadRequest)
|
||||
return
|
||||
@@ -933,6 +1332,9 @@ func main() {
|
||||
return
|
||||
}
|
||||
title := strings.TrimSpace(r.FormValue("title"))
|
||||
slugInput := strings.TrimSpace(r.FormValue("slug"))
|
||||
annotation := strings.TrimSpace(r.FormValue("annotation"))
|
||||
contentMode := strings.TrimSpace(r.FormValue("content_mode"))
|
||||
htmlContent := strings.TrimSpace(r.FormValue("content"))
|
||||
catsRaw := strings.TrimSpace(r.FormValue("categories"))
|
||||
var cats []string
|
||||
@@ -948,6 +1350,10 @@ func main() {
|
||||
http.Error(w, "missing title or content", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
// Default content mode to visual if not specified
|
||||
if contentMode == "" {
|
||||
contentMode = "visual"
|
||||
}
|
||||
site := staticPath()
|
||||
if f, fh, err := r.FormFile("image"); err == nil {
|
||||
defer f.Close()
|
||||
@@ -989,6 +1395,32 @@ func main() {
|
||||
reHead := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHead.ReplaceAllString(s, meta+"</head>")
|
||||
}
|
||||
// Update or add slug meta tag
|
||||
reSlug := regexp.MustCompile(`(?is)<meta name="slug" content="[^"]*"\s*/?>\s*`)
|
||||
s = reSlug.ReplaceAllString(s, "")
|
||||
slugMeta := "<meta name=\"slug\" content=\"" + htmlEscape(slugInput) + "\">\n"
|
||||
reHeadSlug := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadSlug.ReplaceAllString(s, slugMeta+"</head>")
|
||||
// Update or add annotation meta tag
|
||||
reAnnotation := regexp.MustCompile(`(?is)<meta name="description" content="[^"]*"\s*/?>\s*`)
|
||||
s = reAnnotation.ReplaceAllString(s, "")
|
||||
if annotation != "" {
|
||||
annotationMeta := "<meta name=\"description\" content=\"" + htmlEscape(annotation) + "\">\n"
|
||||
reHeadAnnotation := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadAnnotation.ReplaceAllString(s, annotationMeta+"</head>")
|
||||
}
|
||||
// Update or add content mode meta tag
|
||||
reContentMode := regexp.MustCompile(`(?is)<meta name="content_mode" content="[^"]*"\s*/?>\s*`)
|
||||
s = reContentMode.ReplaceAllString(s, "")
|
||||
contentModeMeta := "<meta name=\"content_mode\" content=\"" + htmlEscape(contentMode) + "\">\n"
|
||||
reHeadContentMode := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadContentMode.ReplaceAllString(s, contentModeMeta+"</head>")
|
||||
// Ensure Rybbit analytics script is present (idempotent: remove existing first, then add)
|
||||
reRybbit := regexp.MustCompile(`(?is)<script[^>]*src="https://rybbit\.tdvorak\.dev/api/script\.js"[^>]*>\s*</script>\s*`)
|
||||
s = reRybbit.ReplaceAllString(s, "")
|
||||
rybbitScript := "<script src=\"https://rybbit.tdvorak.dev/api/script.js\" data-site-id=\"d40b7ffffffa\" defer></script>\n"
|
||||
reHeadRybbit := regexp.MustCompile(`(?is)</head>`)
|
||||
s = reHeadRybbit.ReplaceAllString(s, rybbitScript+"</head>")
|
||||
if err := os.WriteFile(hPath, []byte(s), 0644); err != nil {
|
||||
http.Error(w, "cannot write", http.StatusInternalServerError)
|
||||
return
|
||||
@@ -1008,14 +1440,51 @@ func main() {
|
||||
return
|
||||
}
|
||||
id := strings.TrimSpace(r.URL.Query().Get("id"))
|
||||
re := regexp.MustCompile(`^\d{4}$`)
|
||||
if !re.MatchString(id) {
|
||||
// Accept numeric ID (0001) or slug (my-post-title)
|
||||
validID := regexp.MustCompile(`^\d{4}$`).MatchString(id) || regexp.MustCompile(`^[a-z0-9-]+$`).MatchString(id)
|
||||
if !validID {
|
||||
http.Error(w, "invalid id", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
site := staticPath()
|
||||
_ = os.Remove(filepath.Join(site, "blog", id+".html"))
|
||||
blogDir := filepath.Join(site, "blog")
|
||||
|
||||
// If numeric ID, also find and delete the slug file
|
||||
if regexp.MustCompile(`^\d{4}$`).MatchString(id) {
|
||||
// Delete numeric HTML file
|
||||
numericPath := filepath.Join(blogDir, id+".html")
|
||||
// Find slug before deleting
|
||||
if content, err := os.ReadFile(numericPath); err == nil {
|
||||
slug := extractSlugFromContent(string(content))
|
||||
if slug != "" && slug != id {
|
||||
_ = os.Remove(filepath.Join(blogDir, slug+".html"))
|
||||
}
|
||||
}
|
||||
_ = os.Remove(numericPath)
|
||||
// Delete image
|
||||
_ = os.Remove(filepath.Join(site, "img", "blog", id+".png"))
|
||||
} else {
|
||||
// It's a slug - find the numeric ID and delete both
|
||||
entries, _ := os.ReadDir(blogDir)
|
||||
for _, e := range entries {
|
||||
name := e.Name()
|
||||
if !regexp.MustCompile(`^\d{4}\.html$`).MatchString(name) {
|
||||
continue
|
||||
}
|
||||
numericID := strings.TrimSuffix(name, ".html")
|
||||
numericPath := filepath.Join(blogDir, name)
|
||||
if content, err := os.ReadFile(numericPath); err == nil {
|
||||
fileSlug := extractSlugFromContent(string(content))
|
||||
if fileSlug == id {
|
||||
// Found matching numeric file, delete both
|
||||
_ = os.Remove(numericPath)
|
||||
_ = os.Remove(filepath.Join(site, "img", "blog", numericID+".png"))
|
||||
_ = os.Remove(filepath.Join(blogDir, id+".html"))
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
})
|
||||
|
||||
@@ -1029,7 +1498,71 @@ func main() {
|
||||
mux.Handle("/js/", fs)
|
||||
// Protect /admin/ with Basic Auth
|
||||
mux.Handle("/admin/", basicAuth(http.StripPrefix("/admin/", http.FileServer(http.Dir(filepath.Join(staticPath(), "admin"))))))
|
||||
mux.Handle("/blog/", fs)
|
||||
|
||||
// Custom slug-based blog routing
|
||||
mux.HandleFunc("/blog/", func(w http.ResponseWriter, r *http.Request) {
|
||||
// Extract the slug/ID from the path
|
||||
path := strings.TrimPrefix(r.URL.Path, "/blog/")
|
||||
if path == "" || path == "/" {
|
||||
// Serve the main blog listing page
|
||||
http.ServeFile(w, r, filepath.Join(sp, "blog.html"))
|
||||
return
|
||||
}
|
||||
|
||||
// Remove .html extension if present
|
||||
if strings.HasSuffix(path, ".html") {
|
||||
path = strings.TrimSuffix(path, ".html")
|
||||
}
|
||||
|
||||
// Check if it's a numeric ID (legacy format)
|
||||
if regexp.MustCompile(`^\d{4}$`).MatchString(path) {
|
||||
// Serve numeric file directly
|
||||
numericPath := filepath.Join(sp, "blog", path+".html")
|
||||
if _, err := os.Stat(numericPath); err == nil {
|
||||
http.ServeFile(w, r, numericPath)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Check if it's a slug (new format)
|
||||
if regexp.MustCompile(`^[a-z0-9-]+$`).MatchString(path) {
|
||||
slugPath := filepath.Join(sp, "blog", path+".html")
|
||||
if _, err := os.Stat(slugPath); err == nil {
|
||||
http.ServeFile(w, r, slugPath)
|
||||
return
|
||||
}
|
||||
|
||||
// If slug file doesn't exist, try to resolve slug to numeric file
|
||||
blogDir := filepath.Join(sp, "blog")
|
||||
entries, err := os.ReadDir(blogDir)
|
||||
if err == nil {
|
||||
for _, entry := range entries {
|
||||
name := entry.Name()
|
||||
if !regexp.MustCompile(`^\d{4}\.html$`).MatchString(name) {
|
||||
continue
|
||||
}
|
||||
numericPath := filepath.Join(blogDir, name)
|
||||
|
||||
// Check if this numeric file has the matching slug
|
||||
b, err := os.ReadFile(numericPath)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
s := string(b)
|
||||
re := regexp.MustCompile(`(?is)<meta name="slug" content="([^"]+)"`)
|
||||
m := re.FindStringSubmatch(s)
|
||||
if len(m) >= 2 && m[1] == path {
|
||||
http.ServeFile(w, r, numericPath)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If not found, serve 404
|
||||
http.NotFound(w, r)
|
||||
})
|
||||
|
||||
mux.Handle("/zapasy/", fs)
|
||||
// Fallback: serve index.html at root, otherwise delegate to static file server
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -1041,7 +1574,9 @@ func main() {
|
||||
})
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" { port = "8080" }
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
srv := &http.Server{
|
||||
Addr: ":" + port,
|
||||
Handler: mux,
|
||||
@@ -1120,13 +1655,27 @@ func refresh(ctx context.Context) error {
|
||||
urlTable := fmt.Sprintf("%s/club/%s/%s/table", baseURL, clubType, clubID)
|
||||
|
||||
var detail ClubDetail
|
||||
if err := getJSON(ctx, client, urlDetail, &detail); err != nil {
|
||||
return fmt.Errorf("detail: %w", err)
|
||||
}
|
||||
var table ClubTable
|
||||
var activeClubID string
|
||||
|
||||
// Try primary API first
|
||||
if err := getJSON(ctx, client, urlDetail, &detail); err != nil {
|
||||
log.Printf("primary api detail failed (%v), trying fallback", err)
|
||||
urlDetail = fmt.Sprintf("%s/club/%s/%s?slug=%s", fallbackBaseURL, clubType, fallbackClubID, fallbackSlug)
|
||||
urlTable = fmt.Sprintf("%s/club/%s/%s/table?slug=%s", fallbackBaseURL, clubType, fallbackClubID, fallbackSlug)
|
||||
if err := getJSON(ctx, client, urlDetail, &detail); err != nil {
|
||||
return fmt.Errorf("fallback detail: %w", err)
|
||||
}
|
||||
if err := getJSON(ctx, client, urlTable, &table); err != nil {
|
||||
return fmt.Errorf("fallback table: %w", err)
|
||||
}
|
||||
activeClubID = fallbackClubID
|
||||
} else {
|
||||
if err := getJSON(ctx, client, urlTable, &table); err != nil {
|
||||
return fmt.Errorf("table: %w", err)
|
||||
}
|
||||
activeClubID = clubID
|
||||
}
|
||||
|
||||
// Override or inject facr_link based on match_id
|
||||
for i := range detail.Competitions {
|
||||
@@ -1136,10 +1685,10 @@ func refresh(ctx context.Context) error {
|
||||
detail.Competitions[i].Matches[j].FacrLink = fmt.Sprintf("https://www.fotbal.cz/futsal/zapasy/futsal/%s", mid)
|
||||
}
|
||||
// Override logo URLs for our club in match details
|
||||
if detail.Competitions[i].Matches[j].HomeID == clubID {
|
||||
if detail.Competitions[i].Matches[j].HomeID == activeClubID {
|
||||
detail.Competitions[i].Matches[j].HomeLogoURL = "/img/logo.png"
|
||||
}
|
||||
if detail.Competitions[i].Matches[j].AwayID == clubID {
|
||||
if detail.Competitions[i].Matches[j].AwayID == activeClubID {
|
||||
detail.Competitions[i].Matches[j].AwayLogoURL = "/img/logo.png"
|
||||
}
|
||||
}
|
||||
@@ -1148,7 +1697,7 @@ func refresh(ctx context.Context) error {
|
||||
// Override logo URLs for our club in the table standings
|
||||
for i := range table.Competitions {
|
||||
for j := range table.Competitions[i].Table.Overall {
|
||||
if table.Competitions[i].Table.Overall[j].TeamID == clubID {
|
||||
if table.Competitions[i].Table.Overall[j].TeamID == activeClubID {
|
||||
table.Competitions[i].Table.Overall[j].TeamLogo = "/img/logo.png"
|
||||
}
|
||||
}
|
||||
@@ -1166,7 +1715,7 @@ func refresh(ctx context.Context) error {
|
||||
if err := writeDiskJSON(c.data); err != nil {
|
||||
log.Printf("warn: write disk json: %v", err)
|
||||
}
|
||||
log.Printf("refreshed data: comps=%d", len(detail.Competitions))
|
||||
log.Printf("refreshed data: comps=%d source=%s", len(detail.Competitions), map[bool]string{true: "fallback", false: "primary"}[activeClubID == fallbackClubID])
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// TestListLatestBlogsOrdering verifies that listLatestBlogs returns items
|
||||
// sorted by numeric ID descending, regardless of file timestamps or order.
|
||||
func TestListLatestBlogsOrdering(t *testing.T) {
|
||||
// Create a temp directory structure mimicking the remote server
|
||||
tmpDir := t.TempDir()
|
||||
blogDir := filepath.Join(tmpDir, "blog")
|
||||
imgDir := filepath.Join(tmpDir, "img", "blog")
|
||||
if err := os.MkdirAll(blogDir, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.MkdirAll(imgDir, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Create numeric blog files with IDs spanning a wide range.
|
||||
// We intentionally create them in non-numeric order and touch
|
||||
// old IDs with newer timestamps to simulate a migration.
|
||||
files := []struct {
|
||||
id string
|
||||
slug string
|
||||
title string
|
||||
}{
|
||||
{"0031", "vstupujeme-spolecne-do-druhe-ligy", "VSTUPUJEME SPOLEČNĚ DO DRUHÉ LIGY!"},
|
||||
{"0032", "nova-mise-pred-nami", "NOVÁ MISE PŘED NÁMI!"},
|
||||
{"0033", "superpohar-divizi-je-zde", "SUPERPOHÁR DIVIZÍ JE ZDE!"},
|
||||
{"0034", "superpohar-je-nas", "SUPERPOHÁR JE NÁŠ!"},
|
||||
{"0035", "fotoreport-1", "FOTOREPORT"},
|
||||
{"0036", "regionalni-finale-je-tady", "REGIONÁLNÍ FINÁLE JE TADY!"},
|
||||
{"0037", "bizoni-slavi-postup", "BIZONI SLAVÍ POSTUP!"},
|
||||
{"0038", "fotoreport-2", "FOTOREPORT"},
|
||||
{"0039", "2-liga-je-tu", "2. LIGA JE TU!"},
|
||||
{"0040", "pred-startem-sezony-1", "PŘED STARTEM SEZONY"},
|
||||
{"0041", "pred-startem-sezony-2", "PŘED STARTEM SEZÓNY"},
|
||||
{"0042", "podpora-futsalu", "Podpora Futsalu"},
|
||||
{"0169", "stepan-stodulka-fanouskum-3", "Štěpán Stodůlka fanouškům: Budujeme klub, který bude dlouhodobě silný"},
|
||||
{"0170", "martin-prokes-fanouskum", "Martin Prokeš fanouškům: První futsalová sezóna přinesla cenné zkušenosti"},
|
||||
{"0171", "andrea-adamikova-fanouskum", "Andrea Adamíková fanouškům: Druhé místo je motivací do další práce"},
|
||||
{"0172", "stepan-stodulka-fanouskum-2", "Štěpán Stodůlka fanouškům: Bizonky jsou hrdou součástí našeho klubu"},
|
||||
{"0173", "martin-lapcik-fanouskum", "Martin Lapčík fanouškům: První rok bizoní mládeže nás všechny nadchl"},
|
||||
{"0174", "marek-stojaspal-fanouskum", "Marek Stojaspal fanouškům: Mládež položila pevné základy budoucnosti"},
|
||||
{"0175", "stepan-stodulka-fanouskum-1", "Štěpán Stodůlka fanouškům: Mládež ukázala velký potenciál"},
|
||||
{"0176", "dekujeme-my-jsme-tu-diky-vam", "DĚKUJEME, MY JSME TU DÍKY VÁM!"},
|
||||
}
|
||||
|
||||
for _, f := range files {
|
||||
// Create numeric HTML file with slug meta tag
|
||||
htmlContent := fmt.Sprintf(`<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="slug" content="%s">
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="lte-header">%s</h1>
|
||||
<div class="text lte-text-page clearfix">content</div>
|
||||
</body>
|
||||
</html>`, f.slug, f.title)
|
||||
numericPath := filepath.Join(blogDir, f.id+".html")
|
||||
if err := os.WriteFile(numericPath, []byte(htmlContent), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Create corresponding slug file (duplicate content)
|
||||
slugPath := filepath.Join(blogDir, f.slug+".html")
|
||||
if err := os.WriteFile(slugPath, []byte(htmlContent), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Create a dummy image
|
||||
imgPath := filepath.Join(imgDir, f.id+".png")
|
||||
if err := os.WriteFile(imgPath, []byte("fake png"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Touch some old IDs with a newer timestamp to simulate post-migration
|
||||
// (this is the exact condition that broke the old sorting).
|
||||
// We sleep briefly between creation and touch so the timestamp is definitely newer.
|
||||
importTime := time.Now()
|
||||
for _, oldID := range []string{"0031", "0032", "0042"} {
|
||||
fpath := filepath.Join(blogDir, oldID+".html")
|
||||
if err := os.Chtimes(fpath, importTime, importTime); err != nil {
|
||||
// ignore errors on Chtimes
|
||||
}
|
||||
}
|
||||
|
||||
// Call listLatestBlogs
|
||||
items, err := listLatestBlogs(tmpDir, 12)
|
||||
if err != nil {
|
||||
t.Fatalf("listLatestBlogs error: %v", err)
|
||||
}
|
||||
if len(items) != 12 {
|
||||
t.Fatalf("expected 12 items, got %d", len(items))
|
||||
}
|
||||
|
||||
// Verify IDs are sorted descending (newest first)
|
||||
for i := 0; i < len(items)-1; i++ {
|
||||
curr, _ := strconv.Atoi(items[i].ID)
|
||||
next, _ := strconv.Atoi(items[i+1].ID)
|
||||
if curr <= next {
|
||||
t.Errorf("IDs not sorted descending at index %d: %s (%d) <= %s (%d)",
|
||||
i, items[i].ID, curr, items[i+1].ID, next)
|
||||
}
|
||||
}
|
||||
|
||||
// Verify the first item is the newest (0176)
|
||||
if items[0].ID != "0176" {
|
||||
t.Errorf("expected first item ID to be 0176, got %s (title: %s)", items[0].ID, items[0].Title)
|
||||
}
|
||||
if items[1].ID != "0175" {
|
||||
t.Errorf("expected second item ID to be 0175, got %s", items[1].ID)
|
||||
}
|
||||
|
||||
// Verify deduplication: total unique posts should be 20 (not 40)
|
||||
allItems, err := listLatestBlogs(tmpDir, 0)
|
||||
if err != nil {
|
||||
t.Fatalf("listLatestBlogs unlimited error: %v", err)
|
||||
}
|
||||
if len(allItems) != 20 {
|
||||
t.Errorf("expected 20 unique items after dedup, got %d", len(allItems))
|
||||
}
|
||||
|
||||
// Verify all items are sorted descending
|
||||
sorted := sort.SliceIsSorted(allItems, func(i, j int) bool {
|
||||
ii, _ := strconv.Atoi(allItems[i].ID)
|
||||
jj, _ := strconv.Atoi(allItems[j].ID)
|
||||
return ii > jj
|
||||
})
|
||||
if !sorted {
|
||||
t.Error("allItems are not sorted by numeric ID descending")
|
||||
}
|
||||
}
|
||||
|
||||
// TestListLatestBlogsNoSlug verifies numeric-only blogs still sort correctly.
|
||||
func TestListLatestBlogsNoSlug(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
blogDir := filepath.Join(tmpDir, "blog")
|
||||
imgDir := filepath.Join(tmpDir, "img", "blog")
|
||||
os.MkdirAll(blogDir, 0755)
|
||||
os.MkdirAll(imgDir, 0755)
|
||||
|
||||
for _, id := range []string{"0001", "0005", "0010", "0002"} {
|
||||
content := fmt.Sprintf(`<html><head></head><body><h1 class="lte-header">Title %s</h1></body></html>`, id)
|
||||
os.WriteFile(filepath.Join(blogDir, id+".html"), []byte(content), 0644)
|
||||
os.WriteFile(filepath.Join(imgDir, id+".png"), []byte("png"), 0644)
|
||||
}
|
||||
|
||||
items, err := listLatestBlogs(tmpDir, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
expected := []string{"0010", "0005", "0002", "0001"}
|
||||
if len(items) != len(expected) {
|
||||
t.Fatalf("expected %d items, got %d", len(expected), len(items))
|
||||
}
|
||||
for i, exp := range expected {
|
||||
if items[i].ID != exp {
|
||||
t.Errorf("index %d: expected %s, got %s", i, exp, items[i].ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
//go:build ignore
|
||||
|
||||
// Migration script to clean up duplicate blog files
|
||||
// Run with: go run migrate_blogs.go <blog_directory>
|
||||
//
|
||||
// This script:
|
||||
// 1. Scans all blog HTML files
|
||||
// 2. Groups numeric files with their slug counterparts
|
||||
// 3. Removes orphan slug files (slugs without matching numeric files)
|
||||
// 4. Reports duplicates for manual review
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Println("Usage: go run migrate_blogs.go <blog_directory>")
|
||||
fmt.Println("Example: go run migrate_blogs.go ../blog")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
blogDir := os.Args[1]
|
||||
|
||||
// Check directory exists
|
||||
if _, err := os.Stat(blogDir); os.IsNotExist(err) {
|
||||
fmt.Printf("Error: blog directory not found: %s\n", blogDir)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Read all files
|
||||
entries, err := os.ReadDir(blogDir)
|
||||
if err != nil {
|
||||
fmt.Printf("Error reading directory: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
numericRe := regexp.MustCompile(`^\d{4}\.html$`)
|
||||
slugRe := regexp.MustCompile(`^[a-z0-9-]+\.html$`)
|
||||
|
||||
// Map: numeric ID -> slug (extracted from file content)
|
||||
numericToSlug := make(map[string]string)
|
||||
// Map: slug -> numeric ID (extracted by matching content)
|
||||
slugToNumeric := make(map[string]string)
|
||||
// List of orphan slug files (no matching numeric file)
|
||||
orphanSlugs := []string{}
|
||||
// List of numeric files
|
||||
numericFiles := []string{}
|
||||
// List of slug files
|
||||
slugFiles := []string{}
|
||||
|
||||
// First pass: categorize files
|
||||
for _, e := range entries {
|
||||
name := e.Name()
|
||||
if numericRe.MatchString(name) {
|
||||
numericFiles = append(numericFiles, name)
|
||||
} else if slugRe.MatchString(name) {
|
||||
slugFiles = append(slugFiles, name)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Printf("Found %d numeric files and %d slug files\n", len(numericFiles), len(slugFiles))
|
||||
|
||||
// Extract slugs from numeric files
|
||||
for _, name := range numericFiles {
|
||||
path := filepath.Join(blogDir, name)
|
||||
content, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
slug := extractSlugFromContent(string(content))
|
||||
id := strings.TrimSuffix(name, ".html")
|
||||
if slug != "" {
|
||||
numericToSlug[id] = slug
|
||||
}
|
||||
}
|
||||
|
||||
// Check slug files for matches
|
||||
for _, name := range slugFiles {
|
||||
slug := strings.TrimSuffix(name, ".html")
|
||||
foundMatch := false
|
||||
|
||||
// Check if any numeric file has this slug
|
||||
for numericID, numericSlug := range numericToSlug {
|
||||
if numericSlug == slug {
|
||||
slugToNumeric[slug] = numericID
|
||||
foundMatch = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !foundMatch {
|
||||
orphanSlugs = append(orphanSlugs, name)
|
||||
}
|
||||
}
|
||||
|
||||
// Report findings
|
||||
fmt.Println("\n=== Blog Migration Report ===")
|
||||
fmt.Printf("\nNumeric files with slugs:\n")
|
||||
for id, slug := range numericToSlug {
|
||||
fmt.Printf(" %s -> %s\n", id, slug)
|
||||
}
|
||||
|
||||
fmt.Printf("\nSlug files with matching numeric:\n")
|
||||
for slug, id := range slugToNumeric {
|
||||
fmt.Printf(" %s.html -> %s.html\n", slug, id)
|
||||
}
|
||||
|
||||
if len(orphanSlugs) > 0 {
|
||||
fmt.Printf("\nOrphan slug files (no matching numeric file):\n")
|
||||
for _, name := range orphanSlugs {
|
||||
fmt.Printf(" %s\n", name)
|
||||
}
|
||||
|
||||
fmt.Printf("\nRemove %d orphan slug files? (y/n): ", len(orphanSlugs))
|
||||
var response string
|
||||
fmt.Scanln(&response)
|
||||
if strings.ToLower(response) == "y" {
|
||||
for _, name := range orphanSlugs {
|
||||
path := filepath.Join(blogDir, name)
|
||||
if err := os.Remove(path); err != nil {
|
||||
fmt.Printf(" Error removing %s: %v\n", name, err)
|
||||
} else {
|
||||
fmt.Printf(" Removed: %s\n", name)
|
||||
}
|
||||
}
|
||||
fmt.Println("Migration complete!")
|
||||
} else {
|
||||
fmt.Println("Migration cancelled.")
|
||||
}
|
||||
} else {
|
||||
fmt.Println("\nNo orphan slug files found. Blog directory is clean.")
|
||||
}
|
||||
}
|
||||
|
||||
func extractSlugFromContent(htmlContent string) string {
|
||||
re := regexp.MustCompile(`(?is)<meta name="slug" content="([^"]+)"`)
|
||||
m := re.FindStringSubmatch(htmlContent)
|
||||
if len(m) >= 2 {
|
||||
return m[1]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
+24
-3
@@ -31,6 +31,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
@@ -63,20 +64,40 @@
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-29540" class="menu-item menu-item-type-post_type menu-item-object-page">
|
||||
<a href="">
|
||||
<a href="o-nas.html">
|
||||
<span>O nás</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-59" class="menu-item menu-item-type-custom">
|
||||
<a href="">
|
||||
<a href="blog.html">
|
||||
<span>Blog</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-13613" class="menu-item menu-item-type-post_type menu-item-object-page">
|
||||
<a href="">
|
||||
<a href="kontakt.html">
|
||||
<span>Kontakt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="vykonny-vybor.html">
|
||||
<span>Výkonný výbor</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#tym">
|
||||
<span>Tým</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#sponzori">
|
||||
<span>Sponzoři</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a target="_blank" href="https://eu.zonerama.com/Fcbizoni/1419417">
|
||||
<span>Fotogalerie</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Mobile Menu Toggle -->
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
@@ -78,6 +79,11 @@
|
||||
<span>Kontakt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="vykonny-vybor.html">
|
||||
<span>Výkonný výbor</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#tym">
|
||||
<span>Tým</span>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos e--ua-blink e--ua-edge e--ua-webkit" data-elementor-device-mode="mobile_extra">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full" style=" min-height: 0px;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="O nás">
|
||||
<meta name="category" content="Novinky">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="O nás">
|
||||
<meta name="category" content="Novinky">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="Fotoreport">
|
||||
</head>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="Fotoreport">
|
||||
<meta name="category" content="Zápasy">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="../js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="../js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="../js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<meta name="category" content="Zápasy">
|
||||
<meta name="category" content="O nás">
|
||||
</head>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+4
-4
@@ -94,13 +94,13 @@
|
||||
<member>
|
||||
<name>Řičica Jakub</name>
|
||||
<number></number>
|
||||
<role>sekretář klubu</role>
|
||||
<role>Člen VV</role>
|
||||
<image>img/muzi/Řičica_Jakub_1.png</image>
|
||||
</member>
|
||||
<member>
|
||||
<name>Moravec David</name>
|
||||
<number>44</number>
|
||||
<role>místopředseda klubu</role>
|
||||
<role>Místopředseda</role>
|
||||
<image>img/muzi/Moravec_David_1.png</image>
|
||||
</member>
|
||||
<member>
|
||||
@@ -112,7 +112,7 @@
|
||||
<member>
|
||||
<name>Stodůlka Štěpán</name>
|
||||
<number>96</number>
|
||||
<role>PR manažer klubu</role>
|
||||
<role>Předseda</role>
|
||||
<image>img/muzi/Stodůlka_Štěpán_1.png</image>
|
||||
</member>
|
||||
<member>
|
||||
@@ -130,7 +130,7 @@
|
||||
<member>
|
||||
<name>Náplava Jaroslav</name>
|
||||
<number>88</number>
|
||||
<role>Předseda klubu</role>
|
||||
<role>Člen VV</role>
|
||||
<image>img/muzi/Náplava_Jaroslav_1.png</image>
|
||||
</member>
|
||||
</category>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
+41
-7
@@ -30,6 +30,7 @@
|
||||
window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };
|
||||
</script>
|
||||
<script defer src="/_vercel/speed-insights/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<link rel="stylesheet" id="bootstrap-css" href="css/bootstrap.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="atleticos-theme-style-css" href="css/bizoni.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" href="css/overrides.css" type="text/css" media="all" />
|
||||
@@ -102,6 +103,11 @@
|
||||
<span>Kontakt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="vykonny-vybor.html">
|
||||
<span>Výkonný výbor</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#tym">
|
||||
<span>Tým</span>
|
||||
@@ -1768,13 +1774,6 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://alpacar.pl/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor17.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://vechra.cz/" target="_blank">
|
||||
@@ -1852,6 +1851,41 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sxl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://sbernesurovinyuh.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor29.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sxl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://www.kovosteel.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor30.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sxl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="http://gracla.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor31.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sxl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://nsa.gov.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor32.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sxl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://zlinskykraj.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor33.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,6 +51,12 @@
|
||||
const res = await fetch('/api/blog/latest?limit=12', {credentials: 'omit'});
|
||||
if (!res.ok) throw new Error('HTTP '+res.status);
|
||||
let items = await res.json();
|
||||
// Defensive sort: numeric ID descending ensures newest first regardless of API ordering
|
||||
items.sort((a,b)=>{
|
||||
const ai = parseInt(a.id,10); const bi = parseInt(b.id,10);
|
||||
if (!isNaN(ai) && !isNaN(bi)) return bi-ai;
|
||||
return (b.id||'').localeCompare(a.id||'');
|
||||
});
|
||||
if (primary) primary.innerHTML = '';
|
||||
if (!Array.isArray(items) || items.length === 0) {
|
||||
if (primary) primary.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#888;">Žádné příspěvky zatím nejsou.</div>';
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
if (!res.ok) throw new Error('HTTP '+res.status);
|
||||
let items = await res.json();
|
||||
if (!Array.isArray(items) || items.length === 0) items = [];
|
||||
// Defensive sort: numeric ID descending ensures newest first regardless of API ordering
|
||||
items.sort((a,b)=>{
|
||||
const ai = parseInt(a.id,10); const bi = parseInt(b.id,10);
|
||||
if (!isNaN(ai) && !isNaN(bi)) return bi-ai;
|
||||
return (b.id||'').localeCompare(a.id||'');
|
||||
});
|
||||
|
||||
// Update background images of zoom slider slides if present
|
||||
const slides = document.querySelectorAll('.lte-slider-zoom .zs-slides .zs-slide');
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
@@ -78,6 +79,11 @@
|
||||
<span>Kontakt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="vykonny-vybor.html">
|
||||
<span>Výkonný výbor</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#tym">
|
||||
<span>Tým</span>
|
||||
|
||||
+42
-8
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
<link rel="stylesheet" id="tec-variables-skeleton-css" href="css/variables-skeleton.min.css" type="text/css" media="all">
|
||||
<link rel="stylesheet" id="tec-variables-full-css" href="css/variables-full.min.css" type="text/css" media="all">
|
||||
<link rel="stylesheet" id="tribe-common-skeleton-style-css" href="css/common-skeleton.min.css" type="text/css" media="all">
|
||||
@@ -90,6 +91,11 @@
|
||||
<span>Kontakt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="vykonny-vybor.html">
|
||||
<span>Výkonný výbor</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#tym">
|
||||
<span>Tým</span>
|
||||
@@ -185,7 +191,7 @@
|
||||
<div class="lte-heading lte-style-header-subheader lte-uppercase lte-subcolor-main has-subheader heading-tag-h6 heading-subtag-h6">
|
||||
<div class="lte-heading-content">
|
||||
<h6 class="lte-subheader">2025 / 2026</h6>
|
||||
<h6 class="lte-header">Účastník 2. FUTSAL LIGY</h6>
|
||||
<h6 class="lte-header">Výherce 2. FUTSAL LIGY</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -458,13 +464,6 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://alpacar.pl/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor17.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://vechra.cz/" target="_blank">
|
||||
@@ -542,6 +541,41 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://sbernesurovinyuh.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor29.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://www.kovosteel.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor30.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="http://gracla.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor31.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://nsa.gov.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor32.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-ms-6 col-xs-12 partners-wrap center-flex">
|
||||
<div class="partners-item item center-flex">
|
||||
<a href="https://zlinskykraj.cz/" target="_blank">
|
||||
<img decoding="async" src="img/sponzor33.png" class="image">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Remove local blog files and keep only remote blogs
|
||||
# Run this in your bizoni directory
|
||||
|
||||
echo "🗑️ Removing local blog files..."
|
||||
|
||||
# Remove all blog files
|
||||
rm -rf blog/
|
||||
|
||||
echo "✅ Local blog files removed!"
|
||||
echo ""
|
||||
echo "📝 Next steps:"
|
||||
echo "1. Deploy updated backend to server"
|
||||
echo "2. Backend will now work with remote blogs only"
|
||||
echo "3. Admin interface will connect to server API"
|
||||
echo ""
|
||||
echo "🌐 Your live blogs will remain untouched on the server"
|
||||
@@ -0,0 +1,300 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 🚀 Bizoni Remote Blog Setup - One Command Script
|
||||
# Run this to setup remote blog management
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Bizoni Remote Blog Setup"
|
||||
echo "=========================="
|
||||
|
||||
# Configuration - UPDATE THESE
|
||||
SERVER_USER="your_username" # Your SSH username
|
||||
SERVER_HOST="your_server.com" # Your server domain/IP
|
||||
SERVER_BLOG_DIR="/var/www/bizoni/blog" # Blog directory on server
|
||||
LOCAL_PROJECT_DIR="/home/tdvorak/Desktop/HTML_Projekty/bizoni" # Your local project
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Helper functions
|
||||
print_status() {
|
||||
echo -e "${BLUE}ℹ️ $1${NC}"
|
||||
}
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}✅ $1${NC}"
|
||||
}
|
||||
|
||||
print_warning() {
|
||||
echo -e "${YELLOW}⚠️ $1${NC}"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}❌ $1${NC}"
|
||||
}
|
||||
|
||||
# Check if local blogs exist
|
||||
check_local_blogs() {
|
||||
print_status "Checking local blog files..."
|
||||
|
||||
if [ -d "$LOCAL_PROJECT_DIR/blog" ]; then
|
||||
blog_count=$(find "$LOCAL_PROJECT_DIR/blog" -name "*.html" -type f 2>/dev/null | wc -l)
|
||||
if [ "$blog_count" -gt 0 ]; then
|
||||
print_warning "Found $blog_count local blog files"
|
||||
read -p "Remove local blog files? (y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
rm -rf "$LOCAL_PROJECT_DIR/blog"
|
||||
print_success "Local blog files removed"
|
||||
else
|
||||
print_warning "Skipping local blog removal"
|
||||
fi
|
||||
else
|
||||
print_success "No local blog files found"
|
||||
fi
|
||||
else
|
||||
print_success "No local blog directory found"
|
||||
fi
|
||||
}
|
||||
|
||||
# Create Ubuntu management script
|
||||
create_server_script() {
|
||||
print_status "Creating server management script..."
|
||||
|
||||
cat > /tmp/ubuntu-blog-manager.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
# Ubuntu Server Blog Management Script
|
||||
set -e
|
||||
|
||||
BLOG_DIR="/var/www/bizoni/blog"
|
||||
BACKUP_DIR="/var/backups/bizoni-blogs"
|
||||
|
||||
# Create backup
|
||||
create_backup() {
|
||||
echo "📦 Creating backup..."
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
timestamp=$(date +%Y%m%d_%H%M%S)
|
||||
tar -czf "$BACKUP_DIR/blogs_backup_$timestamp.tar.gz" -C "$BLOG_DIR" . 2>/dev/null || echo "No files to backup"
|
||||
echo "✅ Backup created"
|
||||
}
|
||||
|
||||
# Generate slug from title
|
||||
generate_slug() {
|
||||
local title="$1"
|
||||
echo "$title" | tr '[:upper:]' '[:lower:]' | \
|
||||
sed 's/á/a/g; s/ä/a/g; s/č/c/g; s/ď/d/g; s/é/e/g; s/ě/e/g; s/í/i/g; s/ľ/l/g; s/ň/n/g; s/ó/o/g; s/ö/o/g; s/ô/o/g; s/ř/r/g; s/š/s/g; s/ť/t/g; s/ú/u/g; s/ů/u/g; s/ý/y/g; s/ž/z/g' | \
|
||||
sed 's/Á/a/g; s/Ä/a/g; s/Č/c/g; s/Ď/d/g; s/É/e/g; s/Ě/e/g; s/Í/i/g; s/Ľ/l/g; s/Ň/n/g; s/Ó/o/g; s/Ö/o/g; s/Ô/o/g; s/Ř/r/g; s/Š/s/g; s/Ť/t/g; s/Ú/u/g; s/Ů/u/g; s/Ý/y/g; s/Ž/z/g' | \
|
||||
sed 's/[^a-z0-9\s-]//g' | \
|
||||
sed 's/[\s-]\+/ -/g' | \
|
||||
sed 's/^-\|-$//g'
|
||||
}
|
||||
|
||||
# Add slug to blog
|
||||
add_slug_to_blog() {
|
||||
local blog_id="$1"
|
||||
local blog_file="$BLOG_DIR/$blog_id.html"
|
||||
|
||||
if [ ! -f "$blog_file" ]; then
|
||||
echo "❌ Blog not found: $blog_id.html"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check if slug already exists
|
||||
if grep -q '<meta name="slug"' "$blog_file"; then
|
||||
echo "ℹ️ $blog_id already has slug"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Extract title
|
||||
title=$(grep -o '<h1[^>]*class="[^"]*lte-header[^"]*"[^>]*>.*</h1>' "$blog_file" 2>/dev/null | sed 's/<[^>]*>//g' | xargs || echo "")
|
||||
|
||||
if [ -z "$title" ]; then
|
||||
echo "❌ Could not extract title from $blog_id"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Generate slug
|
||||
slug=$(generate_slug "$title")
|
||||
|
||||
# Check uniqueness
|
||||
counter=2
|
||||
original_slug="$slug"
|
||||
while [ -f "$BLOG_DIR/$slug.html" ]; do
|
||||
slug="$original_slug-$counter"
|
||||
((counter++))
|
||||
done
|
||||
|
||||
echo "📝 $blog_id: $title → $slug"
|
||||
|
||||
# Add slug meta tag
|
||||
sed -i "s|</head>|<meta name=\"slug\" content=\"$slug\">\n</head>|" "$blog_file"
|
||||
|
||||
# Create slug file
|
||||
cp "$blog_file" "$BLOG_DIR/$slug.html"
|
||||
|
||||
echo "✅ Added slug: $slug.html"
|
||||
}
|
||||
|
||||
# Migrate all blogs
|
||||
migrate_all() {
|
||||
echo "🔄 Migrating all blogs..."
|
||||
|
||||
if [ ! -d "$BLOG_DIR" ]; then
|
||||
echo "❌ Blog directory not found: $BLOG_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
create_backup
|
||||
|
||||
count=0
|
||||
for blog_file in "$BLOG_DIR"/*.html; do
|
||||
if [ -f "$blog_file" ]; then
|
||||
filename=$(basename "$blog_file")
|
||||
if [[ "$filename" =~ ^([0-9]{4})\.html$ ]]; then
|
||||
blog_id="${BASH_REMATCH[1]}"
|
||||
add_slug_to_blog "$blog_id"
|
||||
((count++))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "✅ Migration completed! Processed $count blogs"
|
||||
}
|
||||
|
||||
# List blogs
|
||||
list_blogs() {
|
||||
echo "📋 Blogs on server:"
|
||||
if [ -d "$BLOG_DIR" ]; then
|
||||
for file in "$BLOG_DIR"/*.html; do
|
||||
if [ -f "$file" ]; then
|
||||
filename=$(basename "$file")
|
||||
if [[ "$filename" =~ ^[0-9]{4}\.html$ ]]; then
|
||||
echo " 📄 $filename (numeric)"
|
||||
elif [[ "$filename" =~ ^[a-z0-9-]+\.html$ ]]; then
|
||||
echo " 🔗 $filename (slug)"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo " ❌ Blog directory not found"
|
||||
fi
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
"migrate")
|
||||
migrate_all
|
||||
;;
|
||||
"list")
|
||||
list_blogs
|
||||
;;
|
||||
"backup")
|
||||
create_backup
|
||||
;;
|
||||
*)
|
||||
echo "Ubuntu Blog Manager"
|
||||
echo "=================="
|
||||
echo "Usage: $0 <command>"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " migrate - Add slugs to all blogs"
|
||||
echo " list - List all blogs"
|
||||
echo " backup - Create backup"
|
||||
echo ""
|
||||
echo "Example: $0 migrate"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
EOF
|
||||
|
||||
chmod +x /tmp/ubuntu-blog-manager.sh
|
||||
print_success "Server script created"
|
||||
}
|
||||
|
||||
# Deploy to server
|
||||
deploy_to_server() {
|
||||
print_status "Deploying to server..."
|
||||
|
||||
# Upload server script
|
||||
scp /tmp/ubuntu-blog-manager.sh "$SERVER_USER@$SERVER_HOST:/tmp/"
|
||||
|
||||
# Move script to server location and make executable
|
||||
ssh "$SERVER_USER@$SERVER_HOST" "sudo mv /tmp/ubuntu-blog-manager.sh /usr/local/bin/blog-manager && sudo chmod +x /usr/local/bin/blog-manager"
|
||||
|
||||
print_success "Server script deployed to /usr/local/bin/blog-manager"
|
||||
}
|
||||
|
||||
# Test server connection
|
||||
test_connection() {
|
||||
print_status "Testing server connection..."
|
||||
|
||||
if ssh "$SERVER_USER@$SERVER_HOST" "echo 'Connection successful'" 2>/dev/null; then
|
||||
print_success "Server connection OK"
|
||||
else
|
||||
print_error "Cannot connect to server. Please check:"
|
||||
echo " - Username: $SERVER_USER"
|
||||
echo " - Host: $SERVER_HOST"
|
||||
echo " - SSH key or password setup"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Run migration on server
|
||||
run_migration() {
|
||||
print_status "Running migration on server..."
|
||||
|
||||
ssh "$SERVER_USER@$SERVER_HOST" "sudo blog-manager migrate"
|
||||
|
||||
print_success "Migration completed on server"
|
||||
}
|
||||
|
||||
# Show results
|
||||
show_results() {
|
||||
print_status "Showing results..."
|
||||
|
||||
echo ""
|
||||
ssh "$SERVER_USER@$SERVER_HOST" "blog-manager list"
|
||||
echo ""
|
||||
print_success "Setup completed!"
|
||||
echo ""
|
||||
echo "🌐 Your blogs now have clean URLs:"
|
||||
echo " Old: /blog/0030.html"
|
||||
echo " New: /blog/jdeme-do-finale"
|
||||
echo ""
|
||||
echo "🔧 Server commands you can use:"
|
||||
echo " ssh $SERVER_USER@$SERVER_HOST 'blog-manager list'"
|
||||
echo " ssh $SERVER_USER@$SERVER_HOST 'blog-manager backup'"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Main execution
|
||||
main() {
|
||||
echo ""
|
||||
print_warning "Please update the configuration in this script:"
|
||||
echo " SERVER_USER=\"$SERVER_USER\""
|
||||
echo " SERVER_HOST=\"$SERVER_HOST\""
|
||||
echo " SERVER_BLOG_DIR=\"$SERVER_BLOG_DIR\""
|
||||
echo ""
|
||||
read -p "Continue with current settings? (y/N): " -n 1 -r
|
||||
echo
|
||||
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "Please edit the script and run again"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_local_blogs
|
||||
test_connection
|
||||
create_server_script
|
||||
deploy_to_server
|
||||
run_migration
|
||||
show_results
|
||||
}
|
||||
|
||||
# Run main function
|
||||
main "$@"
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Simple Server Setup Script - Run this ON YOUR SERVER after git push
|
||||
# Usage: ./setup-server.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Bizoni Server Setup Script"
|
||||
echo "============================"
|
||||
|
||||
# Configuration - UPDATE THESE IF NEEDED
|
||||
BLOG_DIR="/var/www/bizoni/blog"
|
||||
IMG_DIR="/var/www/bizoni/img/blog"
|
||||
BACKUP_DIR="/var/backups/bizoni"
|
||||
|
||||
echo "📁 Blog directory: $BLOG_DIR"
|
||||
echo "🖼️ Image directory: $IMG_DIR"
|
||||
echo ""
|
||||
|
||||
# Check if directories exist
|
||||
if [ ! -d "$BLOG_DIR" ]; then
|
||||
echo "❌ Blog directory not found: $BLOG_DIR"
|
||||
echo "Please update BLOG_DIR in this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$IMG_DIR" ]; then
|
||||
echo "❌ Image directory not found: $IMG_DIR"
|
||||
echo "Please update IMG_DIR in this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Directories found"
|
||||
echo ""
|
||||
|
||||
# Create backup
|
||||
echo "📦 Creating backup..."
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
timestamp=$(date +%Y%m%d_%H%M%S)
|
||||
tar -czf "$BACKUP_DIR/blogs_backup_$timestamp.tar.gz" -C "$(dirname "$BLOG_DIR")" "$(basename "$BLOG_DIR")"
|
||||
echo "✅ Backup created: $BACKUP_DIR/blogs_backup_$timestamp.tar.gz"
|
||||
echo ""
|
||||
|
||||
# Count existing blogs
|
||||
total_blogs=$(ls "$BLOG_DIR"/*.html 2>/dev/null | wc -l)
|
||||
numeric_blogs=$(ls "$BLOG_DIR"/[0-9][0-9][0-9][0-9].html 2>/dev/null | wc -l)
|
||||
slug_blogs=$(ls "$BLOG_DIR"/[a-z]*.html 2>/dev/null | wc -l)
|
||||
|
||||
echo "📊 Current blog status:"
|
||||
echo " Total blogs: $total_blogs"
|
||||
echo " Numeric files: $numeric_blogs"
|
||||
echo " Slug files: $slug_blogs"
|
||||
echo ""
|
||||
|
||||
# Function to generate slug from title
|
||||
generate_slug() {
|
||||
local title="$1"
|
||||
echo "$title" | tr '[:upper:]' '[:lower:]' | \
|
||||
sed 's/á/a/g; s/ä/a/g; s/č/c/g; s/ď/d/g; s/é/e/g; s/ě/e/g; s/í/i/g; s/ľ/l/g; s/ň/n/g; s/ó/o/g; s/ö/o/g; s/ô/o/g; s/ř/r/g; s/š/s/g; s/ť/t/g; s/ú/u/g; s/ů/u/g; s/ý/y/g; s/ž/z/g' | \
|
||||
sed 's/Á/a/g; s/Ä/a/g; s/Č/c/g; s/Ď/d/g; s/É/e/g; s/Ě/e/g; s/Í/i/g; s/Ľ/l/g; s/Ň/n/g; s/Ó/o/g; s/Ö/o/g; s/Ô/o/g; s/Ř/r/g; s/Š/s/g; s/Ť/t/g; s/Ú/u/g; s/Ů/u/g; s/Ý/y/g; s/Ž/z/g' | \
|
||||
iconv -c -f utf-8 -t ascii//TRANSLIT | \
|
||||
sed 's/\s\+/-/g' | \
|
||||
sed 's/[^a-z0-9\-]//g' | \
|
||||
sed 's/-\+/-/g' | \
|
||||
sed 's/^\-\|\-$//g'
|
||||
}
|
||||
|
||||
# Function to extract title from HTML
|
||||
extract_title() {
|
||||
local file="$1"
|
||||
grep -o '<h1[^>]*class="[^"]*lte-header[^"]*"[^>]*>.*</h1>' "$file" | sed 's/<[^>]*>//g' | xargs || echo ""
|
||||
}
|
||||
|
||||
# Function to check if slug exists
|
||||
slug_exists() {
|
||||
local slug="$1"
|
||||
[ -f "$BLOG_DIR/$slug.html" ]
|
||||
}
|
||||
|
||||
# Process numeric blogs that don't have slugs yet
|
||||
echo "🔄 Processing blogs without slugs..."
|
||||
processed=0
|
||||
|
||||
for blog_file in "$BLOG_DIR"/[0-9][0-9][0-9][0-9].html; do
|
||||
if [ ! -f "$blog_file" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
filename=$(basename "$blog_file")
|
||||
blog_id="${filename%.html}"
|
||||
|
||||
# Check if slug meta tag already exists
|
||||
if grep -q '<meta name="slug"' "$blog_file"; then
|
||||
echo " ⏭️ Skipping $filename (slug already exists)"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Extract title
|
||||
title=$(extract_title "$blog_file")
|
||||
if [ -z "$title" ]; then
|
||||
echo " ⚠️ Skipping $filename (no title found)"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Generate slug
|
||||
base_slug=$(generate_slug "$title")
|
||||
slug="$base_slug"
|
||||
|
||||
# Make slug unique
|
||||
counter=2
|
||||
while slug_exists "$slug"; do
|
||||
slug="${base_slug}-${counter}"
|
||||
((counter++))
|
||||
done
|
||||
|
||||
echo " 📝 $filename: '$title' → '$slug'"
|
||||
|
||||
# Add slug meta tag before </head>
|
||||
sed -i "s|</head>|<meta name=\"slug\" content=\"$slug\">\n</head>|" "$blog_file"
|
||||
|
||||
# Create slug file (copy of original)
|
||||
cp "$blog_file" "$BLOG_DIR/$slug.html"
|
||||
|
||||
((processed++))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "✅ Migration completed!"
|
||||
echo "📊 Processed $processed blogs"
|
||||
echo ""
|
||||
|
||||
# Show final status
|
||||
total_blogs=$(ls "$BLOG_DIR"/*.html 2>/dev/null | wc -l)
|
||||
numeric_blogs=$(ls "$BLOG_DIR"/[0-9][0-9][0-9][0-9].html 2>/dev/null | wc -l)
|
||||
slug_blogs=$(ls "$BLOG_DIR"/[a-z]*.html 2>/dev/null | wc -l)
|
||||
|
||||
echo "📊 Final blog status:"
|
||||
echo " Total blogs: $total_blogs"
|
||||
echo " Numeric files: $numeric_blogs"
|
||||
echo " Slug files: $slug_blogs"
|
||||
echo ""
|
||||
|
||||
# Show some example URLs
|
||||
echo "🌐 Example URLs now available:"
|
||||
echo " /blog/$(ls "$BLOG_DIR"/[a-z]*.html 2>/dev/null | head -1 | xargs basename -s .html || echo 'jdeme-do-finale')"
|
||||
echo " /blog/$(ls "$BLOG_DIR"/[a-z]*.html 2>/dev/null | head -2 | tail -1 | xargs basename -s .html || echo '1-zapas-final-score')"
|
||||
echo ""
|
||||
|
||||
echo "🎉 Setup complete! Your blogs now support:"
|
||||
echo " ✅ Clean URLs (slugs)"
|
||||
echo " ✅ SEO meta tags"
|
||||
echo " ✅ Backward compatibility"
|
||||
echo " ✅ New admin features"
|
||||
echo ""
|
||||
echo "📝 Next steps:"
|
||||
echo " 1. Restart your backend service"
|
||||
echo " 2. Test new URLs in browser"
|
||||
echo " 3. Try admin interface with new features"
|
||||
@@ -0,0 +1,166 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Println("Usage: ./migrate_slugs.go <site_root>")
|
||||
fmt.Println("Example: ./migrate_slugs.go /home/tdvorak/Desktop/HTML_Projekty/bizoni")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
siteRoot := os.Args[1]
|
||||
blogDir := filepath.Join(siteRoot, "blog")
|
||||
|
||||
// Read all blog files
|
||||
entries, err := os.ReadDir(blogDir)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to read blog directory: %v", err)
|
||||
}
|
||||
|
||||
// Pattern to match numeric blog files
|
||||
numericPattern := regexp.MustCompile(`^(\d{4})\.html$`)
|
||||
|
||||
for _, entry := range entries {
|
||||
if entry.IsDir() {
|
||||
continue
|
||||
}
|
||||
|
||||
filename := entry.Name()
|
||||
matches := numericPattern.FindStringSubmatch(filename)
|
||||
if len(matches) != 2 {
|
||||
continue // Skip non-numeric files
|
||||
}
|
||||
|
||||
blogPath := filepath.Join(blogDir, filename)
|
||||
|
||||
// Read the blog file
|
||||
content, err := os.ReadFile(blogPath)
|
||||
if err != nil {
|
||||
log.Printf("Failed to read %s: %v", filename, err)
|
||||
continue
|
||||
}
|
||||
|
||||
contentStr := string(content)
|
||||
|
||||
// Check if slug already exists
|
||||
slugPattern := regexp.MustCompile(`(?is)<meta name="slug" content="([^"]+)"`)
|
||||
if slugPattern.MatchString(contentStr) {
|
||||
log.Printf("Skipping %s - slug already exists", filename)
|
||||
continue
|
||||
}
|
||||
|
||||
// Extract title
|
||||
titlePattern := regexp.MustCompile(`(?is)<h1[^>]*class="[^"]*\blte-header\b[^"]*"[^>]*>(.*?)</h1>`)
|
||||
titleMatches := titlePattern.FindStringSubmatch(contentStr)
|
||||
if len(titleMatches) < 2 {
|
||||
log.Printf("Skipping %s - could not find title", filename)
|
||||
continue
|
||||
}
|
||||
|
||||
title := titleMatches[1]
|
||||
// Remove any HTML tags from title
|
||||
title = regexp.MustCompile(`(?is)<[^>]+>`).ReplaceAllString(title, "")
|
||||
title = strings.TrimSpace(title)
|
||||
|
||||
// Generate slug
|
||||
slug := generateSlug(title)
|
||||
slug = ensureUniqueSlug(siteRoot, slug)
|
||||
|
||||
// Find where to insert the slug meta tag (before </head>)
|
||||
headPattern := regexp.MustCompile(`(?is)</head>`)
|
||||
if !headPattern.MatchString(contentStr) {
|
||||
log.Printf("Skipping %s - could not find </head> tag", filename)
|
||||
continue
|
||||
}
|
||||
|
||||
// Insert slug meta tag
|
||||
slugMeta := fmt.Sprintf(`<meta name="slug" content="%s">`, slug)
|
||||
newContent := headPattern.ReplaceAllString(contentStr, slugMeta+"\n</head>")
|
||||
|
||||
// Write the updated content to both files
|
||||
err = os.WriteFile(blogPath, []byte(newContent), 0644)
|
||||
if err != nil {
|
||||
log.Printf("Failed to write updated %s: %v", filename, err)
|
||||
continue
|
||||
}
|
||||
|
||||
// Create slug-based file
|
||||
slugPath := filepath.Join(blogDir, slug+".html")
|
||||
err = os.WriteFile(slugPath, []byte(newContent), 0644)
|
||||
if err != nil {
|
||||
log.Printf("Failed to create slug file %s: %v", slugPath, err)
|
||||
continue
|
||||
}
|
||||
|
||||
log.Printf("Processed %s: title='%s' -> slug='%s'", filename, title, slug)
|
||||
}
|
||||
|
||||
log.Println("Migration completed!")
|
||||
}
|
||||
|
||||
// generateSlug creates a URL-friendly slug from a title
|
||||
func generateSlug(title string) string {
|
||||
slug := strings.ToLower(title)
|
||||
// Replace Czech characters with their ASCII equivalents
|
||||
replacements := map[string]string{
|
||||
"á": "a", "ä": "a", "č": "c", "ď": "d", "é": "e", "ě": "e", "í": "i", "ľ": "l",
|
||||
"ň": "n", "ó": "o", "ö": "o", "ô": "o", "ř": "r", "š": "s", "ť": "t", "ú": "u",
|
||||
"ů": "u", "ý": "y", "ž": "z",
|
||||
"Á": "a", "Ä": "a", "Č": "c", "Ď": "d", "É": "e", "Ě": "e", "Í": "i", "Ľ": "l",
|
||||
"Ň": "n", "Ó": "o", "Ö": "o", "Ô": "o", "Ř": "r", "Š": "s", "Ť": "t", "Ú": "u",
|
||||
"Ů": "u", "Ý": "y", "Ž": "z",
|
||||
}
|
||||
for czech, ascii := range replacements {
|
||||
slug = strings.ReplaceAll(slug, czech, ascii)
|
||||
}
|
||||
// Remove any character that isn't alphanumeric, space, or hyphen
|
||||
re := regexp.MustCompile(`[^a-z0-9\s-]`)
|
||||
slug = re.ReplaceAllString(slug, "")
|
||||
// Replace spaces and multiple hyphens with a single hyphen
|
||||
re = regexp.MustCompile(`[\s-]+`)
|
||||
slug = re.ReplaceAllString(slug, "-")
|
||||
// Remove leading and trailing hyphens
|
||||
slug = strings.Trim(slug, "-")
|
||||
return slug
|
||||
}
|
||||
|
||||
// ensureUniqueSlug ensures the slug is unique by appending a number if needed
|
||||
func ensureUniqueSlug(siteRoot, baseSlug string) string {
|
||||
blogDir := filepath.Join(siteRoot, "blog")
|
||||
entries, err := os.ReadDir(blogDir)
|
||||
if err != nil {
|
||||
return baseSlug
|
||||
}
|
||||
existingSlugs := make(map[string]bool)
|
||||
for _, e := range entries {
|
||||
if !strings.HasSuffix(e.Name(), ".html") {
|
||||
continue
|
||||
}
|
||||
// Extract slug from filename if it follows the new pattern
|
||||
name := strings.TrimSuffix(e.Name(), ".html")
|
||||
// Check if it's a slug-based filename (contains letters, not just numbers)
|
||||
if regexp.MustCompile(`[a-z]`).MatchString(name) {
|
||||
existingSlugs[name] = true
|
||||
}
|
||||
}
|
||||
if !existingSlugs[baseSlug] {
|
||||
return baseSlug
|
||||
}
|
||||
// Try baseSlug-2, baseSlug-3, etc.
|
||||
for i := 2; i < 100; i++ {
|
||||
testSlug := fmt.Sprintf("%s-%d", baseSlug, i)
|
||||
if !existingSlugs[testSlug] {
|
||||
return testSlug
|
||||
}
|
||||
}
|
||||
// Fallback to timestamp
|
||||
return fmt.Sprintf("%s-%d", baseSlug, 1234567890)
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ubuntu Server Script: Remote Blog Management
|
||||
# This script manages blogs on the remote server only
|
||||
|
||||
set -e
|
||||
|
||||
# Configuration - UPDATE THESE PATHS
|
||||
SERVER_BLOG_DIR="/var/www/bizoni/blog" # Path to blogs on your server
|
||||
BACKUP_DIR="/var/backups/bizoni-blogs" # Backup location
|
||||
SITE_ROOT="/var/www/bizoni" # Site root on server
|
||||
|
||||
echo "🚀 Bizoni Remote Blog Management Script"
|
||||
echo "====================================="
|
||||
|
||||
# Function to create backup
|
||||
create_backup() {
|
||||
echo "📦 Creating backup..."
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
timestamp=$(date +%Y%m%d_%H%M%S)
|
||||
tar -czf "$BACKUP_DIR/blogs_backup_$timestamp.tar.gz" -C "$SERVER_BLOG_DIR" .
|
||||
echo "✅ Backup created: $BACKUP_DIR/blogs_backup_$timestamp.tar.gz"
|
||||
}
|
||||
|
||||
# Function to list blogs
|
||||
list_blogs() {
|
||||
echo "📋 Current blogs on server:"
|
||||
if [ -d "$SERVER_BLOG_DIR" ]; then
|
||||
ls -la "$SERVER_BLOG_DIR"/*.html | while read line; do
|
||||
filename=$(basename "$line")
|
||||
if [[ "$filename" =~ ^[0-9]{4}\.html$ ]]; then
|
||||
echo " 📄 $filename (numeric)"
|
||||
elif [[ "$filename" =~ ^[a-z0-9-]+\.html$ ]]; then
|
||||
echo " 🔗 $filename (slug)"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo " ❌ Blog directory not found: $SERVER_BLOG_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to add slug to existing blog
|
||||
add_slug_to_blog() {
|
||||
local blog_id="$1"
|
||||
local blog_file="$SERVER_BLOG_DIR/$blog_id.html"
|
||||
|
||||
if [ ! -f "$blog_file" ]; then
|
||||
echo "❌ Blog file not found: $blog_file"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "🔧 Adding slug to blog: $blog_id"
|
||||
|
||||
# Extract title from blog file
|
||||
title=$(grep -o '<h1[^>]*class="[^"]*lte-header[^"]*"[^>]*>.*</h1>' "$blog_file" | sed 's/<[^>]*>//g' | xargs)
|
||||
|
||||
if [ -z "$title" ]; then
|
||||
echo "❌ Could not extract title from $blog_file"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "📝 Title: $title"
|
||||
|
||||
# Generate slug
|
||||
slug=$(echo "$title" | tr '[:upper:]' '[:lower:]' | \
|
||||
sed 's/á/a/g; s/ä/a/g; s/č/c/g; s/ď/d/g; s/é/e/g; s/ě/e/g; s/í/i/g; s/ľ/l/g; s/ň/n/g; s/ó/o/g; s/ö/o/g; s/ô/o/g; s/ř/r/g; s/š/s/g; s/ť/t/g; s/ú/u/g; s/ů/u/g; s/ý/y/g; s/ž/z/g' | \
|
||||
sed 's/Á/a/g; s/Ä/a/g; s/Č/c/g; s/Ď/d/g; s/É/e/g; s/Ě/e/g; s/Í/i/g; s/Ľ/l/g; s/Ň/n/g; s/Ó/o/g; s/Ö/o/g; s/Ô/o/g; s/Ř/r/g; s/Š/s/g; s/Ť/t/g; s/Ú/u/g; s/Ů/u/g; s/Ý/y/g; s/Ž/z/g' | \
|
||||
sed 's/[^a-z0-9\s-]//g' | \
|
||||
sed 's/[\s-]\+/ -/g' | \
|
||||
sed 's/^-\|-$//g')
|
||||
|
||||
# Check if slug file already exists
|
||||
slug_file="$SERVER_BLOG_DIR/$slug.html"
|
||||
if [ -f "$slug_file" ]; then
|
||||
# Add number suffix
|
||||
i=2
|
||||
while [ -f "$SERVER_BLOG_DIR/${slug}-${i}.html" ]; do
|
||||
((i++))
|
||||
done
|
||||
slug="${slug}-${i}"
|
||||
slug_file="$SERVER_BLOG_DIR/${slug}.html"
|
||||
fi
|
||||
|
||||
echo "🔗 Generated slug: $slug"
|
||||
|
||||
# Check if slug meta tag already exists
|
||||
if grep -q '<meta name="slug"' "$blog_file"; then
|
||||
echo "ℹ️ Slug meta tag already exists"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Add slug meta tag before </head>
|
||||
sed -i "s|</head>|<meta name=\"slug\" content=\"$slug\">\n</head>|" "$blog_file"
|
||||
|
||||
# Create slug file (copy of original)
|
||||
cp "$blog_file" "$slug_file"
|
||||
|
||||
echo "✅ Slug added and slug file created: $slug.html"
|
||||
}
|
||||
|
||||
# Function to migrate all blogs to slugs
|
||||
migrate_all_blogs() {
|
||||
echo "🔄 Migrating all blogs to slugs..."
|
||||
|
||||
if [ ! -d "$SERVER_BLOG_DIR" ]; then
|
||||
echo "❌ Blog directory not found: $SERVER_BLOG_DIR"
|
||||
echo "Please update SERVER_BLOG_DIR in this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
create_backup
|
||||
|
||||
# Process all numeric blog files
|
||||
for blog_file in "$SERVER_BLOG_DIR"/*.html; do
|
||||
if [ -f "$blog_file" ]; then
|
||||
filename=$(basename "$blog_file")
|
||||
if [[ "$filename" =~ ^([0-9]{4})\.html$ ]]; then
|
||||
blog_id="${BASH_REMATCH[1]}"
|
||||
add_slug_to_blog "$blog_id"
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "✅ Migration completed!"
|
||||
}
|
||||
|
||||
# Function to show blog info
|
||||
show_blog_info() {
|
||||
local blog_id="$1"
|
||||
local blog_file="$SERVER_BLOG_DIR/$blog_id.html"
|
||||
|
||||
if [ ! -f "$blog_file" ]; then
|
||||
echo "❌ Blog file not found: $blog_file"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "📄 Blog Info for: $blog_id"
|
||||
echo "========================"
|
||||
|
||||
# Extract title
|
||||
title=$(grep -o '<h1[^>]*class="[^"]*lte-header[^"]*"[^>]*>.*</h1>' "$blog_file" | sed 's/<[^>]*>//g' | xargs)
|
||||
echo "📝 Title: $title"
|
||||
|
||||
# Extract slug
|
||||
slug=$(grep -o '<meta name="slug" content="[^"]*"' "$blog_file" | sed 's/.*content="\([^"]*\)".*/\1/')
|
||||
echo "🔗 Slug: $slug"
|
||||
|
||||
# Extract categories
|
||||
categories=$(grep -o '<meta name="category" content="[^"]*"' "$blog_file" | sed 's/.*content="\([^"]*\)".*/\1/' | tr '\n' ', ')
|
||||
echo "🏷️ Categories: $categories"
|
||||
|
||||
# File size
|
||||
size=$(du -h "$blog_file" | cut -f1)
|
||||
echo "📊 Size: $size"
|
||||
|
||||
# Check if slug file exists
|
||||
if [ -n "$slug" ] && [ -f "$SERVER_BLOG_DIR/$slug.html" ]; then
|
||||
echo "✅ Slug file exists: $slug.html"
|
||||
else
|
||||
echo "❌ Slug file missing"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main menu
|
||||
case "${1:-}" in
|
||||
"list")
|
||||
list_blogs
|
||||
;;
|
||||
"migrate")
|
||||
migrate_all_blogs
|
||||
;;
|
||||
"info")
|
||||
if [ -z "${2:-}" ]; then
|
||||
echo "Usage: $0 info <blog_id>"
|
||||
echo "Example: $0 info 0030"
|
||||
exit 1
|
||||
fi
|
||||
show_blog_info "$2"
|
||||
;;
|
||||
"add-slug")
|
||||
if [ -z "${2:-}" ]; then
|
||||
echo "Usage: $0 add-slug <blog_id>"
|
||||
echo "Example: $0 add-slug 0030"
|
||||
exit 1
|
||||
fi
|
||||
add_slug_to_blog "$2"
|
||||
;;
|
||||
"backup")
|
||||
create_backup
|
||||
;;
|
||||
*)
|
||||
echo "Bizoni Remote Blog Management"
|
||||
echo "============================"
|
||||
echo ""
|
||||
echo "Usage: $0 <command> [options]"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " list - List all blogs on server"
|
||||
echo " migrate - Migrate all blogs to use slugs"
|
||||
echo " info <blog_id> - Show info about specific blog"
|
||||
echo " add-slug <blog_id> - Add slug to specific blog"
|
||||
echo " backup - Create backup of all blogs"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 list"
|
||||
echo " $0 migrate"
|
||||
echo " $0 info 0030"
|
||||
echo " $0 add-slug 0030"
|
||||
echo ""
|
||||
echo "⚠️ Make sure to update SERVER_BLOG_DIR path in this script!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,448 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>Bizoni UH - Výkonný výbor</title>
|
||||
<link rel="icon" type="image/x-icon" href="img/logo.png">
|
||||
<!-- Stylesheets -->
|
||||
<link rel="stylesheet" id="swiper-css" href="css/swiper.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="bootstrap-css" href="css/bootstrap.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="atleticos-theme-style-css" href="css/bizoni.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="elementor-icons-css" href="css/elementor-icons.min.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="elementor-frontend-css" href="css/custom-frontend.min.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="elementor-post-13200-css" href="css/post-13200.css" type="text/css" media="all" />
|
||||
<!-- External Stylesheets -->
|
||||
<link rel="stylesheet" id="elementor-post-32647-css" href="css/post-32647.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="event-tickets-rsvp-css" href="css/rsvp.min.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="magnific-popup-css" href="css/magnific-popup.css" type="text/css" media="all" />
|
||||
<script type="text/javascript" src="js/jquery.nicescroll.js" id="nicescroll-js"></script>
|
||||
<link rel="stylesheet" id="atleticos-google-fonts-css" href="//fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700%7CSofia+Sans+Extra+Condensed:800,300i" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="font-awesome-shims-css" href="css/v4-shims.min.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="lte-font-css" href="css/lte-font-codes.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" id="google-fonts-1-css" href="https://fonts.googleapis.com/css?family=Open+Sans%3A100%2C100italic%2C200%2C200italic%2C300%2C300italic%2C400%2C400italic%2C500%2C500italic%2C600%2C600italic%2C700%2C700italic%2C800%2C800italic%2C900%2C900italic%7CMarcellus%7CTangerine&display=auto&ver=6.4.5" type="text/css" media="all" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<!-- Scripts -->
|
||||
<script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
|
||||
<script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.min.js" id="jquery-core-js"></script>
|
||||
<script type="text/javascript" src="js/jquery-migrate.min.js" id="jquery-migrate-js"></script>
|
||||
<script type="text/javascript" src="js/jquery.blockUI.min.js" id="jquery-blockui-js" defer="defer"></script>
|
||||
<script type="text/javascript" src="js/jquery.paroller.js" id="jquery-paroller-js"></script>
|
||||
<script type="text/javascript" src="js/modernizr-2.6.2.min.js" id="modernizr-js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="https://rybbit.tdvorak.dev/api/script.js" data-site-id="d40b7ffffffa" defer></script>
|
||||
</head>
|
||||
<body class="home page-template page-template-page-templates page-template-full-width page page-id-32647 theme-atleticos woocommerce-no-js tribe-no-js tec-no-tickets-on-recurring tec-no-rsvp-on-recurring full-width lte-fw-loaded lte-color-scheme-default lte-body-white lte-background-white paceloader-disabled no-sidebar elementor-default elementor-kit-13200 elementor-page elementor-page-32647 tribe-theme-atleticos">
|
||||
<div class="lte-content-wrapper lte-layout-transparent-full">
|
||||
<div class="lte-header-wrapper header-h1 header-parallax lte-header-overlay lte-layout-transparent-full lte-pageheader-disabled">
|
||||
<div id="lte-nav-wrapper" class="lte-layout-transparent-full lte-nav-color-white">
|
||||
<nav class="lte-navbar affix" data-spy="affix" data-offset-top="0">
|
||||
<div class="container">
|
||||
<!-- Logo -->
|
||||
<div class="lte-navbar-logo">
|
||||
<a class="lte-logo" href="index.html">
|
||||
<img src="img/logo.png">
|
||||
</a>
|
||||
</div>
|
||||
<!-- Navigation Items -->
|
||||
<div class="lte-navbar-items navbar-mobile-black navbar-collapse collapse" id="navbar" data-mobile-screen-width="1198">
|
||||
<div class="toggle-wrap">
|
||||
<a class="lte-logo" href="index.html">
|
||||
<img src="img/logo.png">
|
||||
</a>
|
||||
<button type="button" class="lte-navbar-toggle collapsed" id="close-button">
|
||||
<span class="close">×</span>
|
||||
</button>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<!-- Navigation Menu -->
|
||||
<ul id="menu-main-menu" class="lte-ul-nav">
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html">
|
||||
<span>Domů</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-29540" class="menu-item menu-item-type-post_type menu-item-object-page">
|
||||
<a href="o-nas.html">
|
||||
<span>O nás</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-59" class="menu-item menu-item-type-custom">
|
||||
<a href="blog.html">
|
||||
<span>Blog</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-13613" class="menu-item menu-item-type-post_type menu-item-object-page">
|
||||
<a href="kontakt.html">
|
||||
<span>Kontakt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="vykonny-vybor.html">
|
||||
<span>Výkonný výbor</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#tym">
|
||||
<span>Tým</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a href="index.html#sponzori">
|
||||
<span>Sponzoři</span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="menu-item-20758" class="menu-item menu-item-type-custom current-menu-ancestor current-menu-parent">
|
||||
<a target="_blank" href="https://eu.zonerama.com/Fcbizoni/1419417">
|
||||
<span>Fotogalerie</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Mobile Menu Toggle -->
|
||||
<button type="button" class="lte-navbar-toggle" id="open-button">
|
||||
<span class="icon-bar top-bar"></span>
|
||||
<span class="icon-bar middle-bar"></span>
|
||||
<span class="icon-bar bottom-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<header class="lte-page-header lte-parallax-yes">
|
||||
<div class="container">
|
||||
<div class="lte-header-h1-wrapper">
|
||||
<h1 class="lte-header">Výkonný výbor</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<!-- Content -->
|
||||
<div class="lte-text-page margin-default">
|
||||
<div class="row centered">
|
||||
<div class="col-xl-12 col-xs-12">
|
||||
<article id="post-13611" class="post-13611 page type-page status-publish has-post-thumbnail hentry">
|
||||
<div class="entry-content clearfix" id="entry-div">
|
||||
<div data-elementor-type="wp-page" data-elementor-id="13611" class="elementor elementor-13611">
|
||||
<section class="elementor-section elementor-top-section elementor-element elementor-element-3724f34 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="3724f34" data-element_type="section">
|
||||
<div class="elementor-container elementor-column-gap-no">
|
||||
<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9b8c152" data-id="9b8c152" data-element_type="column">
|
||||
<div class="elementor-widget-wrap elementor-element-populated">
|
||||
<div class="elementor-element elementor-element-e42573f lte-contacts-icons lte-icons-align-center lte-style-grid-disabled elementor-widget elementor-widget-lte-icons" data-id="e42573f" data-element_type="widget" data-widget_type="lte-icons.default">
|
||||
<div class="elementor-widget-container">
|
||||
<ul class="lte-block-icon has-descr icons-count-5 lte-icon-space-md lte-icon-shape-default lte-icon-background-disabled lte-icon-color-main lte-icon-divider-dashed lte-icon-size-medium lte-header-color-black lte-icon-type-top lte-icon-align-center layout-cols5 lte-additional-">
|
||||
<li class=" col-lg-12 col-md-12 col-sm-12 col-ms-12 col-xs-12">
|
||||
<div class="lte-inner">
|
||||
<ion-icon name="person-outline" class="ion-icons"></ion-icon>
|
||||
<span class="lte-icon-content">
|
||||
<span class="lte-header lte-h5"> Předseda </span>
|
||||
<span class="lte-descr">Mgr. Štěpán Stodůlka<br />775 247 633</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class=" col-lg-12 col-md-12 col-sm-12 col-ms-12 col-xs-12">
|
||||
<div class="lte-inner">
|
||||
<ion-icon name="person-outline" class="ion-icons"></ion-icon>
|
||||
<span class="lte-icon-content">
|
||||
<span class="lte-header lte-h5"> Místopředseda </span>
|
||||
<span class="lte-descr">David Moravec<br />602 702 129</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class=" col-lg-12 col-md-12 col-sm-12 col-ms-12 col-xs-12">
|
||||
<div class="lte-inner">
|
||||
<ion-icon name="person-outline" class="ion-icons"></ion-icon>
|
||||
<span class="lte-icon-content">
|
||||
<span class="lte-header lte-h5"> Člen VV </span>
|
||||
<span class="lte-descr">Mgr. Martin Janečka<br />605 089 558</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class=" col-lg-12 col-md-12 col-sm-12 col-ms-12 col-xs-12">
|
||||
<div class="lte-inner">
|
||||
<ion-icon name="person-outline" class="ion-icons"></ion-icon>
|
||||
<span class="lte-icon-content">
|
||||
<span class="lte-header lte-h5"> Člen VV </span>
|
||||
<span class="lte-descr">Mgr. Jakub Řičica<br />721 502 700</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class=" col-lg-12 col-md-12 col-sm-12 col-ms-12 col-xs-12">
|
||||
<div class="lte-inner">
|
||||
<ion-icon name="person-outline" class="ion-icons"></ion-icon>
|
||||
<span class="lte-icon-content">
|
||||
<span class="lte-header lte-h5"> Člen VV </span>
|
||||
<span class="lte-descr">Jaroslav Náplava<br />603 950 224</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="elementor-element elementor-element-16d0b91 elementor-widget elementor-widget-spacer" data-id="16d0b91" data-element_type="widget" data-widget_type="spacer.default">
|
||||
<div class="elementor-widget-container">
|
||||
<div class="elementor-spacer">
|
||||
<div class="elementor-spacer-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lte-footer-wrapper lte-footer-layout-default">
|
||||
<div class="footer-wrapper">
|
||||
<div class="lte-container">
|
||||
<div class="footer-block lte-footer-widget-area">
|
||||
<div data-elementor-type="wp-post" data-elementor-id="29393" class="elementor elementor-29393">
|
||||
<div class="elementor-element elementor-element-a939976 lte-background-black e-flex e-con-boxed e-con e-parent" data-id="a939976" data-element_type="container" data-settings="{"background_background":"classic"}" data-core-v316-plus="true">
|
||||
<div class="e-con-inner" style="padding-bottom: 92px;">
|
||||
<div class="elementor-element elementor-element-f2b730e e-con-full e-flex e-con e-child" data-id="f2b730e" data-element_type="container">
|
||||
<div class="elementor-element elementor-element-81a7a24 elementor-widget__width-initial elementor-widget elementor-widget-shortcode" data-id="81a7a24" data-element_type="widget" data-widget_type="shortcode.default">
|
||||
<div class="elementor-widget-container">
|
||||
<div class="elementor-shortcode">
|
||||
<a class="lte-logo" href="index.html">
|
||||
<img src="img/logo.png" style="filter: drop-shadow(9px -1px 23px black);">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="elementor-element elementor-element-86345d3 elementor-widget__width-initial elementor-widget elementor-widget-text-editor" data-id="86345d3" data-element_type="widget" data-widget_type="text-editor.default">
|
||||
<div class="elementor-widget-container">
|
||||
<p>
|
||||
<span class="text-sm">
|
||||
<a href="https://maps.app.goo.gl/kEc9CJuXTxqNUhgj8" target="_blank">Stonky 559, 686 01 Uherské Hradiště 1</a>
|
||||
<br>fcbizoni@gmail.com </span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="elementor-element elementor-element-475baf0 elementor-widget elementor-widget-lte-elements" data-id="475baf0" data-element_type="widget" data-widget_type="lte-elements.default">
|
||||
<div class="elementor-widget-container">
|
||||
<div class="lte-social lte-nav-second lte-type-">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://www.facebook.com/bizoniuh" target="_blank">
|
||||
<ion-icon name="logo-facebook" style="height: 22px; width: 22px;"></ion-icon>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.instagram.com/fcbizoni_uh/" target="_blank">
|
||||
<ion-icon name="logo-instagram" style="height: 22px; width: 22px;"></ion-icon>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.youtube.com/@FCBizoniUH" target="_blank">
|
||||
<ion-icon name="logo-youtube" style="height: 22px; width: 22px;"></ion-icon>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="copyright-block copyright-layout-copyright-transparent">
|
||||
<div class="container">
|
||||
<p>
|
||||
<a href="https://tdvorak.dev" target="_blank">TDvorak</a> © Všechna práva vyhrazena - 2024
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<a href="#" class="lte-go-top floating lte-go-top-icon">
|
||||
<span class="go-top-icon-v2 icon">
|
||||
<ion-icon name="football-outline" style="padding-right: 2px;"></ion-icon>
|
||||
</span>
|
||||
<span class="go-top-header">Nahoru</span>
|
||||
</a>
|
||||
<link rel='stylesheet' id='elementor-post-36123-css' href='css/post-36123.css' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='elementor-post-36124-css' href='css/post-36124.css' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='elementor-post-35532-css' href='css/post-35532.css' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='elementor-post-36129-css' href='css/post-36129.css' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='elementor-post-36131-css' href='css/post-36131.css' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='lte-zoomslider-css' href='css/zoom-slider.css' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='elementor-post-20251-css' href='css/post-20251.css' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='elementor-post-29393-css' href='css/post-29393.css' type='text/css' media='all' />
|
||||
<script type="text/javascript" src="js/parallax-js.js" id="parallax-js-js"></script>
|
||||
<script type="text/javascript" src="js/scripts.js" id="atleticos-scripts-js"></script>
|
||||
<script type="text/javascript" src="js/swiper.min.js" id="swiper-js"></script>
|
||||
<script type="text/javascript" src="js/frontend.js" id="lte-frontend-js"></script>
|
||||
<script type="text/javascript" src="js/jquery.zoomslider.js" id="lte-zoomslider-js"></script>
|
||||
<script type="text/javascript" src="js/webpack.runtime.min.js" id="elementor-webpack-runtime-js"></script>
|
||||
<script type="text/javascript" src="js/frontend-modules.min.js" id="elementor-frontend-modules-js"></script>
|
||||
<script type="text/javascript" src="js/waypoints.min.js" id="elementor-waypoints-js"></script>
|
||||
<script type="text/javascript" src="js/core.min.js" id="jquery-ui-core-js"></script>
|
||||
<script type="text/javascript" id="elementor-frontend-js-before">
|
||||
/*
|
||||
|
||||
<![CDATA[ */
|
||||
var elementorFrontendConfig = {
|
||||
"environmentMode": {
|
||||
"edit": false,
|
||||
"wpPreview": false,
|
||||
"isScriptDebug": false
|
||||
},
|
||||
"i18n": {
|
||||
"shareOnFacebook": "Share on Facebook",
|
||||
"shareOnTwitter": "Share on Twitter",
|
||||
"pinIt": "Pin it",
|
||||
"download": "Download",
|
||||
"downloadImage": "Download image",
|
||||
"fullscreen": "Fullscreen",
|
||||
"zoom": "Zoom",
|
||||
"share": "Share",
|
||||
"playVideo": "Play Video",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"close": "Close",
|
||||
"a11yCarouselWrapperAriaLabel": "Carousel | Horizontal scrolling: Arrow Left & Right",
|
||||
"a11yCarouselPrevSlideMessage": "Previous slide",
|
||||
"a11yCarouselNextSlideMessage": "Next slide",
|
||||
"a11yCarouselFirstSlideMessage": "This is the first slide",
|
||||
"a11yCarouselLastSlideMessage": "This is the last slide",
|
||||
"a11yCarouselPaginationBulletMessage": "Go to slide"
|
||||
},
|
||||
"is_rtl": false,
|
||||
"breakpoints": {
|
||||
"xs": 0,
|
||||
"sm": 480,
|
||||
"md": 768,
|
||||
"lg": 1200,
|
||||
"xl": 1440,
|
||||
"xxl": 1600
|
||||
},
|
||||
"responsive": {
|
||||
"breakpoints": {
|
||||
"mobile": {
|
||||
"label": "Mobile Portrait",
|
||||
"value": 767,
|
||||
"default_value": 767,
|
||||
"direction": "max",
|
||||
"is_enabled": true
|
||||
},
|
||||
"mobile_extra": {
|
||||
"label": "Mobile Landscape",
|
||||
"value": 991,
|
||||
"default_value": 880,
|
||||
"direction": "max",
|
||||
"is_enabled": true
|
||||
},
|
||||
"tablet": {
|
||||
"label": "Tablet Portrait",
|
||||
"value": 1199,
|
||||
"default_value": 1024,
|
||||
"direction": "max",
|
||||
"is_enabled": true
|
||||
},
|
||||
"tablet_extra": {
|
||||
"label": "Tablet Landscape",
|
||||
"value": 1366,
|
||||
"default_value": 1200,
|
||||
"direction": "max",
|
||||
"is_enabled": true
|
||||
},
|
||||
"laptop": {
|
||||
"label": "Laptop",
|
||||
"value": 1599,
|
||||
"default_value": 1366,
|
||||
"direction": "max",
|
||||
"is_enabled": true
|
||||
},
|
||||
"widescreen": {
|
||||
"label": "Widescreen",
|
||||
"value": 1900,
|
||||
"default_value": 2400,
|
||||
"direction": "min",
|
||||
"is_enabled": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"version": "3.20.1",
|
||||
"is_static": false,
|
||||
"experimentalFeatures": {
|
||||
"e_optimized_assets_loading": true,
|
||||
"additional_custom_breakpoints": true,
|
||||
"container": true,
|
||||
"e_swiper_latest": true,
|
||||
"block_editor_assets_optimize": true,
|
||||
"ai-layout": true,
|
||||
"landing-pages": true,
|
||||
"nested-elements": true,
|
||||
"e_image_loading_optimization": true
|
||||
},
|
||||
"urls": {
|
||||
"assets": "./js/text-editor.2c35aafbe5bf0e127950.bundle.min.js"
|
||||
},
|
||||
"swiperClass": "swiper",
|
||||
"settings": {
|
||||
"page": [],
|
||||
"editorPreferences": []
|
||||
},
|
||||
"kit": {
|
||||
"viewport_tablet": 1199,
|
||||
"viewport_mobile": 767,
|
||||
"active_breakpoints": ["viewport_mobile", "viewport_mobile_extra", "viewport_tablet", "viewport_tablet_extra", "viewport_laptop", "viewport_widescreen"],
|
||||
"viewport_mobile_extra": 991,
|
||||
"viewport_laptop": 1599,
|
||||
"viewport_widescreen": 1900,
|
||||
"viewport_tablet_extra": 1366,
|
||||
"lightbox_enable_counter": "yes",
|
||||
"lightbox_enable_fullscreen": "yes",
|
||||
"lightbox_enable_zoom": "yes",
|
||||
"lightbox_enable_share": "yes",
|
||||
"lightbox_title_src": "title",
|
||||
"lightbox_description_src": "description"
|
||||
},
|
||||
"post": {
|
||||
"id": 32647,
|
||||
"title": "",
|
||||
"excerpt": "",
|
||||
"featuredImage": false
|
||||
}
|
||||
};
|
||||
/* ]]> */
|
||||
</script>
|
||||
<script type="text/javascript" src="js/frontend.min.js" id="elementor-frontend-js"></script>
|
||||
<script>
|
||||
// Ensure the DOM is fully loaded before adding event listeners
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Get the buttons and the navbar element
|
||||
const openButton = document.getElementById('open-button');
|
||||
const closeButton = document.getElementById('close-button');
|
||||
const navbar = document.getElementById('navbar');
|
||||
// Log to check if elements exist
|
||||
console.log('Open button:', openButton);
|
||||
console.log('Close button:', closeButton);
|
||||
console.log('Navbar:', navbar);
|
||||
// Ensure that buttons and navbar exist
|
||||
if (openButton && closeButton && navbar) {
|
||||
console.log('Elements found and event listeners ready.');
|
||||
// Add event listener to the open button
|
||||
openButton.addEventListener('click', function() {
|
||||
console.log('Open button clicked');
|
||||
});
|
||||
// Add event listener to the close button
|
||||
closeButton.addEventListener('click', function() {
|
||||
console.log('Close button clicked');
|
||||
});
|
||||
} else {
|
||||
console.error('Error: Buttons or navbar element not found.');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user