Remove unused development utility scripts
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
- Deleted convert-favicon.sh, generate-favicon.js, update-favicon.js - unused favicon generation scripts - Deleted convert-to-includes.js - utility for converting HTML to use includes system - Updated documentation to remove references to deleted scripts - These were development utilities that are no longer needed for the site
This commit is contained in:
parent
baf66debf3
commit
20c813c7ea
|
@ -1,51 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Generate the SVG favicon
|
||||
echo "Generating SVG favicon..."
|
||||
node generate-favicon.js
|
||||
|
||||
# Check if the SVG was generated
|
||||
if [ ! -f "favicon.svg" ]; then
|
||||
echo "Error: favicon.svg was not generated."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create a temporary directory for favicon files
|
||||
mkdir -p favicon_tmp
|
||||
|
||||
# Convert SVG to PNG files of different sizes
|
||||
echo "Converting SVG to PNG files of various sizes..."
|
||||
for size in 16 32 48 64 128 256; do
|
||||
# Using ImageMagick's convert command if available
|
||||
if command -v convert > /dev/null; then
|
||||
convert -background none -size ${size}x${size} favicon.svg favicon_tmp/favicon-${size}.png
|
||||
else
|
||||
echo "ImageMagick not found. Please install it to convert SVG to PNG."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Create favicon.ico from the PNG files
|
||||
echo "Creating favicon.ico..."
|
||||
if command -v convert > /dev/null; then
|
||||
convert favicon_tmp/favicon-16.png favicon_tmp/favicon-32.png favicon_tmp/favicon-48.png favicon.ico
|
||||
else
|
||||
echo "ImageMagick not found. Please install it to create favicon.ico."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create apple-touch-icon.png (for iOS)
|
||||
echo "Creating apple-touch-icon.png..."
|
||||
cp favicon_tmp/favicon-128.png apple-touch-icon.png
|
||||
|
||||
# Create favicon-32x32.png and favicon-16x16.png (for modern browsers)
|
||||
echo "Creating standard browser favicons..."
|
||||
cp favicon_tmp/favicon-32.png favicon-32x32.png
|
||||
cp favicon_tmp/favicon-16.png favicon-16x16.png
|
||||
|
||||
# Clean up temporary directory
|
||||
echo "Cleaning up temporary files..."
|
||||
rm -rf favicon_tmp
|
||||
|
||||
echo "Favicon generation complete!"
|
||||
echo "Created: favicon.ico, favicon-16x16.png, favicon-32x32.png, apple-touch-icon.png"
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* Script to help convert existing HTML files to use the includes system
|
||||
*
|
||||
* Usage:
|
||||
* 1. Include this script in your HTML file temporarily
|
||||
* 2. Open the page in a browser
|
||||
* 3. Open the browser console
|
||||
* 4. The script will output the modified HTML content that uses includes
|
||||
*/
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Extract the head content
|
||||
const headContent = document.head.innerHTML;
|
||||
|
||||
// Extract the navigation content
|
||||
const navContent = document.querySelector('.main-nav')?.outerHTML || '';
|
||||
|
||||
// Extract the theme switcher content
|
||||
const themeSwitcherContent = document.querySelector('.theme-switch')?.outerHTML || '';
|
||||
|
||||
// Extract the footer content (accessibility notice)
|
||||
const footerContent = document.querySelector('.accessibility-notice')?.parentElement?.innerHTML || '';
|
||||
|
||||
// Extract the main content
|
||||
const mainContentElement = document.querySelector('.container-fluid');
|
||||
let mainContent = '';
|
||||
|
||||
if (mainContentElement) {
|
||||
// Clone the main content to avoid modifying the original
|
||||
const mainContentClone = mainContentElement.cloneNode(true);
|
||||
|
||||
// Remove the accessibility notice from the clone if it exists
|
||||
const accessibilityNotice = mainContentClone.querySelector('.accessibility-notice');
|
||||
if (accessibilityNotice && accessibilityNotice.parentElement) {
|
||||
accessibilityNotice.parentElement.removeChild(accessibilityNotice);
|
||||
}
|
||||
|
||||
mainContent = mainContentClone.innerHTML;
|
||||
}
|
||||
|
||||
// Create the modified HTML content
|
||||
const modifiedHTML = `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
${headContent}
|
||||
<script src="${getRelativePath()}includes.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Header Include -->
|
||||
<div id="header-include"></div>
|
||||
|
||||
<!-- Main Content -->
|
||||
${mainContent}
|
||||
|
||||
<!-- Footer Include -->
|
||||
<div id="footer-include"></div>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
// Output the modified HTML content to the console
|
||||
console.log('=== MODIFIED HTML CONTENT ===');
|
||||
console.log(modifiedHTML);
|
||||
console.log('=== END MODIFIED HTML CONTENT ===');
|
||||
|
||||
// Helper function to get the relative path to the root
|
||||
function getRelativePath() {
|
||||
const path = window.location.pathname;
|
||||
const depth = (path.match(/\//g) || []).length - 1;
|
||||
return depth > 0 ? '../'.repeat(depth) : '';
|
||||
}
|
||||
});
|
|
@ -1,52 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Create an SVG favicon with a professional design for a resume site
|
||||
function generateFavicon() {
|
||||
// Define colors
|
||||
const backgroundColor = '#2c3e50'; // Dark blue-gray
|
||||
const accentColor = '#3498db'; // Bright blue
|
||||
const textColor = '#ecf0f1'; // Light gray/white
|
||||
|
||||
// Create SVG content with a professional design
|
||||
const svgContent = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
|
||||
<defs>
|
||||
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="${backgroundColor}" />
|
||||
<stop offset="100%" stop-color="#1a2530" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<!-- Background -->
|
||||
<rect width="64" height="64" rx="8" fill="url(#gradient)" />
|
||||
|
||||
<!-- Document/Resume icon -->
|
||||
<rect x="18" y="14" width="28" height="36" rx="2" fill="${textColor}" />
|
||||
<rect x="22" y="20" width="20" height="2" rx="1" fill="${backgroundColor}" />
|
||||
<rect x="22" y="24" width="16" height="2" rx="1" fill="${backgroundColor}" />
|
||||
<rect x="22" y="28" width="20" height="2" rx="1" fill="${backgroundColor}" />
|
||||
<rect x="22" y="32" width="12" height="2" rx="1" fill="${backgroundColor}" />
|
||||
|
||||
<!-- Accent corner fold -->
|
||||
<path d="M46,14 L46,22 L38,14 Z" fill="${accentColor}" />
|
||||
|
||||
<!-- Initials as paths instead of text for better compatibility -->
|
||||
<g transform="translate(20, 42)">
|
||||
<!-- C letter -->
|
||||
<path d="M8,2 C5,2 3,3.5 3,6 C3,8.5 5,10 8,10 C10,10 11.5,9 12,7.5"
|
||||
stroke="${accentColor}" stroke-width="2" fill="none" stroke-linecap="round" />
|
||||
<!-- K letter -->
|
||||
<path d="M16,2 L16,10 M16,6 L20,2 M16,6 L20,10"
|
||||
stroke="${accentColor}" stroke-width="2" fill="none" stroke-linecap="round" />
|
||||
</g>
|
||||
</svg>`;
|
||||
|
||||
// Write SVG file
|
||||
fs.writeFileSync(path.join(__dirname, 'favicon.svg'), svgContent);
|
||||
console.log('Generated favicon.svg');
|
||||
}
|
||||
|
||||
// Run the generator
|
||||
generateFavicon();
|
|
@ -16,8 +16,6 @@ This guide explains how to convert the existing portfolio website to use the inc
|
|||
- `stories/story-with-includes.html`: Example of a story page
|
||||
- `one-pager-tools/tool-with-includes.html`: Example of a tool page
|
||||
|
||||
4. **Conversion Helper**
|
||||
- `convert-to-includes.js`: A script to help convert existing HTML files to use the includes system
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
|
@ -51,14 +49,7 @@ For each HTML page:
|
|||
<div id="footer-include"></div>
|
||||
```
|
||||
|
||||
You can use the `convert-to-includes.js` script to help with this process:
|
||||
|
||||
1. Temporarily add this script to an existing page:
|
||||
```html
|
||||
<script src="convert-to-includes.js"></script>
|
||||
```
|
||||
2. Open the page in a browser and check the console output
|
||||
3. Use the generated HTML as a starting point for your conversion
|
||||
Once you've created your includes, you can add them to your HTML files as shown above.
|
||||
|
||||
### 3. Testing
|
||||
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Create a simple ICO file directly (base64 encoded)
|
||||
function generateFaviconICO() {
|
||||
// This is a minimal 16x16 ICO file with a blue square and white "CK" text
|
||||
// The data is base64 encoded
|
||||
const icoBase64 = `
|
||||
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAVlZWAFZWVgBWVlYAVlZWAFZWVgBWVlYAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAFZWVgBWVlYCVlZWQFZWVoBWVlaAVlZWQFZWVgJWVlYAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAFZWVgBWVlYGVlZWaFZWVuJWVlb/VlZW/1ZWVuJWVlZoVlZW
|
||||
BlZWVgAAAAAAAAAAAAAAAAAAAAAAVlZWAFZWVgBWVlYmVlZWtVZWVv9WVlb/VlZW/1ZWVv9WVlb/
|
||||
VlZWtVZWViZWVlYAVlZWAAAAAAAAAAAAAAAAAFZWVgBWVlY0VlZW1VZWVv9WVlb/VlZW/1ZWVv9W
|
||||
Vlb/VlZW/1ZWVtVWVlY0VlZWAAAAAAAAAAAAAAAAAAAAAABWVlYSVlZWrVZWVv9WVlb/VlZW/1ZW
|
||||
Vv9WVlb/VlZW/1ZWVv9WVlatVlZWElZWVgAAAAAAAAAAAAAAAAAAAAAAVlZWRlZWVvFWVlb/VlZW
|
||||
/1ZWVv9WVlb/VlZW/1ZWVv9WVlbxVlZWRlZWVgAAAAAAAAAAAAAAAAAAAAAAVlZWRlZWVvFWVlb/
|
||||
VlZW/1ZWVv9WVlb/VlZW/1ZWVv9WVlbxVlZWRlZWVgAAAAAAAAAAAAAAAAAAAAAAVlZWElZWVq1W
|
||||
Vlb/VlZW/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZWrVZWVhJWVlYAAAAAAAAAAAAAAAAAAAAAAFZW
|
||||
VjRWVlbVVlZW/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW1VZWVjRWVlYAAAAAAAAAAAAAAAAAVlZW
|
||||
AFZWVgBWVlYmVlZWtVZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZWtVZWViZWVlYAVlZWAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAFZWVgZWVlZoVlZW4lZWVv9WVlb/VlZW4lZWVmhWVlYGVlZWAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAFZWVgJWVlZAVlZWgFZWVoBWVlZAVlZWAlZWVgAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVlZWAFZWVgBWVlYAVlZWAFZWVgBWVlYAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
|
||||
`.trim();
|
||||
|
||||
// Write the base64 data to the ICO file
|
||||
const icoBuffer = Buffer.from(icoBase64, 'base64');
|
||||
fs.writeFileSync(path.join(__dirname, 'favicon.ico'), icoBuffer);
|
||||
console.log('Generated favicon.ico');
|
||||
}
|
||||
|
||||
// Run the generator
|
||||
generateFaviconICO();
|
Loading…
Reference in New Issue