Skip to content

Commit f98b1f6

Browse files
committed
Fix content loading paths and add Instructions7.md
1 parent 2f40822 commit f98b1f6

5 files changed

Lines changed: 401 additions & 6 deletions

File tree

Instructions7.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Instructions 7: Website Content Integration
2+
3+
## What We've Done
4+
5+
We've updated the website to properly integrate the content objects gathered in the previous task:
6+
7+
1. **Fixed JavaScript Path Issues**:
8+
- Updated relative paths in `site-config.js` to correctly load content files
9+
- Changed `../content/site-metadata.json` to `./content/site-metadata.json`
10+
- Changed `../content/about-me.md` to `./content/about-me.md`
11+
- Updated relative paths in `projects.js` to correctly load project data
12+
- Changed `../projects/projects-data.json` to `./projects/projects-data.json`
13+
14+
2. **Fixed Image Paths**:
15+
- Updated image paths in `io-puzzle-2025.md` to use correct relative paths
16+
- Changed `../images/projects/io-puzzle-*.jpg` to `./images/projects/io-puzzle-*.jpg`
17+
18+
## Content Integration
19+
20+
The website now correctly loads:
21+
- Professional bio from `about-me.md`
22+
- Site configuration from `site-metadata.json`
23+
- Skills and navigation from site metadata
24+
- Project information from `projects-data.json`
25+
- Detailed project descriptions from markdown files
26+
27+
## Manual Steps Still Required
28+
29+
As mentioned in Instructions6.md, you'll still need to:
30+
31+
1. **Download Profile Images**:
32+
- Follow instructions in `images/profile/image-sources.md`
33+
- Save your professional headshot from emilysueanderson.com
34+
35+
2. **Download Project Images**:
36+
- Follow instructions in `images/projects/image-sources.md`
37+
- Save screenshots of your I/O Puzzle solutions and Google Tutorials
38+
39+
3. **Download Background Images**:
40+
- Follow instructions in `images/backgrounds/image-sources.md`
41+
- Save background images from your websites
42+
43+
## How to Test Your Website
44+
45+
After downloading the images, you can test your website locally:
46+
47+
1. Open `index.html` in your browser
48+
2. Verify that your about content loads correctly
49+
3. Check that your projects display properly
50+
4. Ensure all links work as expected
51+
52+
## Next Steps
53+
54+
1. **Push Changes to Git**:
55+
- Commit the path fixes and new instructions file
56+
- Push to GitHub to update the live site
57+
58+
2. **Content Refinement**:
59+
- Review and edit the content to ensure accuracy
60+
- Add any additional details or projects you'd like to showcase
61+
62+
3. **Design Customization**:
63+
- Adjust the CSS to match your preferred color scheme and style
64+
- Customize the layout for different sections if needed
65+
66+
4. **Mobile Optimization**:
67+
- Test the website on various devices
68+
- Make any necessary adjustments for mobile responsiveness

PromptContext.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
- Website successfully deployed to GitHub Pages
1111
- Domain configured and working with HTTPS
1212
- Basic website structure in place with placeholder content
13-
- Instructions4.md created with website personalization steps
13+
- Folder structure created for organizing website assets
14+
- README files added to each folder with guidelines
15+
- Content populated from existing websites (emilysueanderson.com and bold.pro profile)
16+
- Dynamic content loading implemented with JavaScript
17+
- Fixed path issues in JavaScript files to correctly load content
18+
- Instructions7.md created with content integration steps
1419

1520
## Personalization Context
1621
```
@@ -21,20 +26,43 @@
2126
"github": "repository_created_and_pushed",
2227
"domain": "configured_and_working",
2328
"deployment": "successful",
24-
"personalization": "in_progress"
29+
"personalization": "in_progress",
30+
"asset_organization": "complete",
31+
"content_population": "complete",
32+
"dynamic_loading": "implemented",
33+
"content_integration": "fixed_and_working"
34+
},
35+
"folder_structure": {
36+
"images": {
37+
"profile": "For profile photos",
38+
"projects": "For project screenshots",
39+
"backgrounds": "For background images",
40+
"icons": "For icons and logos"
41+
},
42+
"content": "For text content and site data",
43+
"resume": "For resume-related files",
44+
"projects": "For detailed project information",
45+
"js": "For JavaScript files"
46+
},
47+
"content_files": {
48+
"about-me.md": "Professional bio",
49+
"site-metadata.json": "Site configuration",
50+
"resume-data.json": "Work history and skills",
51+
"projects-data.json": "Project information",
52+
"io-puzzle-2025.md": "Detailed project description"
2553
},
2654
"required_actions": [
27-
"gather_personal_assets",
28-
"update_website_content",
55+
"manually_download_images",
2956
"customize_design",
30-
"add_personal_projects",
31-
"optimize_for_mobile"
57+
"optimize_for_mobile",
58+
"review_and_refine_content"
3259
],
3360
"personalization_context": {
3461
"github_username": "emscape",
3562
"repository_name": "HelloEmilyDev",
3663
"domain": "HelloEmily.dev",
3764
"current_design": "blue_theme_basic_layout",
65+
"content_sources": ["emilysueanderson.com", "bold.pro/my/emily-s-anderson/102r"],
3866
"cost_efficiency": "using_free_resources_and_own_assets"
3967
}
4068
}

js/projects.js

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/**
2+
* Projects loader script for HelloEmily.dev
3+
* Dynamically loads and displays project data from JSON
4+
*/
5+
6+
document.addEventListener('DOMContentLoaded', function() {
7+
// Load projects data from JSON file
8+
fetch('./projects/projects-data.json')
9+
.then(response => response.json())
10+
.then(data => {
11+
displayProjects(data.projects);
12+
})
13+
.catch(error => {
14+
console.error('Error loading projects data:', error);
15+
displayFallbackProjects();
16+
});
17+
});
18+
19+
/**
20+
* Displays projects in the project grid
21+
* @param {Array} projects - Array of project objects
22+
*/
23+
function displayProjects(projects) {
24+
const projectsContainer = document.querySelector('.project-grid');
25+
26+
// Clear any existing content
27+
if (projectsContainer) {
28+
projectsContainer.innerHTML = '';
29+
30+
// Sort projects to show featured ones first
31+
const sortedProjects = [...projects].sort((a, b) => {
32+
if (a.featured && !b.featured) return -1;
33+
if (!a.featured && b.featured) return 1;
34+
return 0;
35+
});
36+
37+
// Create and append project cards
38+
sortedProjects.forEach(project => {
39+
const projectCard = document.createElement('div');
40+
projectCard.className = 'project-card';
41+
42+
// Create tags HTML
43+
const tagsHTML = project.technologies
44+
.map(tech => `<span>${tech}</span>`)
45+
.join('');
46+
47+
// Build card HTML
48+
projectCard.innerHTML = `
49+
<h3>${project.title}</h3>
50+
<p>${project.shortDescription}</p>
51+
<div class="project-tags">
52+
${tagsHTML}
53+
</div>
54+
<div class="project-links">
55+
${project.liveUrl ? `<a href="${project.liveUrl}" class="btn" target="_blank">View Project</a>` : ''}
56+
${project.githubUrl ? `<a href="${project.githubUrl}" class="btn btn-secondary" target="_blank">View Source</a>` : ''}
57+
</div>
58+
`;
59+
60+
projectsContainer.appendChild(projectCard);
61+
});
62+
}
63+
}
64+
65+
/**
66+
* Displays fallback projects if JSON loading fails
67+
*/
68+
function displayFallbackProjects() {
69+
const projectsContainer = document.querySelector('.project-grid');
70+
71+
if (projectsContainer) {
72+
// Keep any existing content as fallback
73+
if (projectsContainer.children.length === 0) {
74+
projectsContainer.innerHTML = `
75+
<div class="project-card">
76+
<h3>HelloEmily.dev Website</h3>
77+
<p>My personal portfolio website built with HTML, CSS, and JavaScript. Hosted on GitHub Pages with a custom domain.</p>
78+
<div class="project-tags">
79+
<span>HTML</span>
80+
<span>CSS</span>
81+
<span>JavaScript</span>
82+
<span>GitHub Pages</span>
83+
</div>
84+
<a href="https://github.com/emscape/HelloEmilyDev" class="btn" target="_blank">View Source</a>
85+
</div>
86+
`;
87+
}
88+
}
89+
}

js/site-config.js

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
/**
2+
* Site configuration loader for HelloEmily.dev
3+
* Dynamically loads site metadata and configures page elements
4+
*/
5+
6+
document.addEventListener('DOMContentLoaded', function() {
7+
// Load site metadata from JSON file
8+
fetch('./content/site-metadata.json')
9+
.then(response => response.json())
10+
.then(data => {
11+
applySiteMetadata(data);
12+
})
13+
.catch(error => {
14+
console.error('Error loading site metadata:', error);
15+
});
16+
17+
// Load about content from markdown file
18+
fetch('./content/about-me.md')
19+
.then(response => response.text())
20+
.then(markdown => {
21+
// Simple markdown parsing for paragraphs
22+
const htmlContent = parseSimpleMarkdown(markdown);
23+
const aboutTextContainer = document.querySelector('.about-text');
24+
25+
if (aboutTextContainer) {
26+
aboutTextContainer.innerHTML = htmlContent;
27+
}
28+
})
29+
.catch(error => {
30+
console.error('Error loading about content:', error);
31+
});
32+
});
33+
34+
/**
35+
* Applies site metadata to the page
36+
* @param {Object} metadata - Site metadata object
37+
*/
38+
function applySiteMetadata(metadata) {
39+
// Set page title
40+
document.title = metadata.title;
41+
42+
// Set meta description
43+
const metaDescription = document.querySelector('meta[name="description"]');
44+
if (metaDescription) {
45+
metaDescription.setAttribute('content', metadata.description);
46+
}
47+
48+
// Update navigation if it exists
49+
const navList = document.querySelector('nav ul');
50+
if (navList && metadata.navigation) {
51+
navList.innerHTML = '';
52+
metadata.navigation.forEach(item => {
53+
const li = document.createElement('li');
54+
li.innerHTML = `<a href="${item.url}">${item.name}</a>`;
55+
navList.appendChild(li);
56+
});
57+
}
58+
59+
// Update contact email
60+
const contactEmail = document.querySelector('.contact-email');
61+
if (contactEmail && metadata.contact && metadata.contact.email) {
62+
contactEmail.innerHTML = `Email: <a href="mailto:${metadata.contact.email}">${metadata.contact.email}</a>`;
63+
}
64+
65+
// Update social links
66+
const socialLinks = document.querySelector('.social-links');
67+
if (socialLinks && metadata.social) {
68+
socialLinks.innerHTML = '';
69+
70+
if (metadata.social.github) {
71+
socialLinks.innerHTML += `<a href="${metadata.social.github}" target="_blank">GitHub</a>`;
72+
}
73+
74+
if (metadata.social.linkedin) {
75+
socialLinks.innerHTML += `<a href="${metadata.social.linkedin}" target="_blank">LinkedIn</a>`;
76+
}
77+
78+
if (metadata.social.instagram) {
79+
socialLinks.innerHTML += `<a href="${metadata.social.instagram}" target="_blank">Instagram</a>`;
80+
}
81+
}
82+
83+
// Update skills section if it exists
84+
const skillsContainer = document.querySelector('.skills-container');
85+
if (skillsContainer && metadata.skills) {
86+
skillsContainer.innerHTML = '';
87+
88+
metadata.skills.forEach(category => {
89+
const skillCategory = document.createElement('div');
90+
skillCategory.className = 'skill-category';
91+
92+
skillCategory.innerHTML = `
93+
<h3>${category.category}</h3>
94+
<ul class="skill-list">
95+
${category.items.map(skill => `<li>${skill}</li>`).join('')}
96+
</ul>
97+
`;
98+
99+
skillsContainer.appendChild(skillCategory);
100+
});
101+
}
102+
}
103+
104+
/**
105+
* Simple markdown parser for basic formatting
106+
* @param {string} markdown - Markdown text
107+
* @return {string} HTML content
108+
*/
109+
function parseSimpleMarkdown(markdown) {
110+
let html = '';
111+
const lines = markdown.split('\n');
112+
let inParagraph = false;
113+
114+
lines.forEach(line => {
115+
// Handle headers
116+
if (line.startsWith('# ')) {
117+
if (inParagraph) {
118+
html += '</p>';
119+
inParagraph = false;
120+
}
121+
html += `<h2>${line.substring(2)}</h2>`;
122+
}
123+
else if (line.startsWith('## ')) {
124+
if (inParagraph) {
125+
html += '</p>';
126+
inParagraph = false;
127+
}
128+
html += `<h3>${line.substring(3)}</h3>`;
129+
}
130+
// Handle list items
131+
else if (line.startsWith('- ')) {
132+
if (inParagraph) {
133+
html += '</p>';
134+
inParagraph = false;
135+
}
136+
if (!html.endsWith('</ul>') && !html.endsWith('<ul>')) {
137+
html += '<ul>';
138+
}
139+
html += `<li>${line.substring(2)}</li>`;
140+
}
141+
// Handle empty lines
142+
else if (line.trim() === '') {
143+
if (inParagraph) {
144+
html += '</p>';
145+
inParagraph = false;
146+
}
147+
if (html.endsWith('</li>')) {
148+
html += '</ul>';
149+
}
150+
}
151+
// Handle regular paragraphs
152+
else {
153+
if (!inParagraph) {
154+
html += '<p>';
155+
inParagraph = true;
156+
} else {
157+
html += ' ';
158+
}
159+
html += line;
160+
}
161+
});
162+
163+
if (inParagraph) {
164+
html += '</p>';
165+
}
166+
167+
return html;
168+
}

0 commit comments

Comments
 (0)