Skip to content

Conversation

@Apoo711
Copy link
Owner

@Apoo711 Apoo711 commented Jun 21, 2025

Summary by Sourcery

Introduce a Research subdirectory with its own collection, layouts, and styling in Eleventy, wire it into the navigation, and add sample research content to enable a dedicated research section.

New Features:

  • Configure Eleventy to collect and render a dedicated "research" collection from content tagged "research"
  • Introduce new Nunjucks layouts for a research listing (research-list.njk) and individual research posts (research-post.njk)
  • Add research.css and include it in the base layout to style the research section
  • Insert a "Research" link into the site navigation across all relevant templates
  • Add sample research content under src/research, including a placeholder article and index page

Enhancements:

  • Update base and post layouts to reference the new layouts folder structure
  • Clean up existing CSS and JS by removing obsolete comments and normalizing formatting

@Apoo711 Apoo711 requested a review from Copilot June 21, 2025 05:46
@Apoo711 Apoo711 self-assigned this Jun 21, 2025
@Apoo711 Apoo711 added the enhancement New feature or request label Jun 21, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Jun 21, 2025

Reviewer's Guide

This pull request introduces a new “Research” section—complete with dedicated CSS, Eleventy layouts, and content—while cleaning up and standardizing existing CSS and JS, adjusting templates, and updating navigation and site configuration.

File-Level Changes

Change Details Files
Add Research section
  • New research.css for styling research pages
  • Created research-list.njk and research-post.njk layouts
  • Added /research index and sample markdown article
  • Configured Eleventy to collect pages tagged “research”
src/css/research.css
src/_includes/layouts/research-list.njk
src/_includes/layouts/research-post.njk
src/research/index.md
src/research/2025/spanish-inquisition.md
eleventy.config.js
Update navigation to include Research
  • Inserted Research link and SVG icon into base.njk and VCE templates
src/_includes/layouts/base.njk
src/index.html
src/vce/**/*.html
Template path and layout fixes
  • Fixed layout front‐matter references to use correct ‘layouts/base.njk’ path
  • Updated blog index and post templates to point at new layout directory
src/_includes/layouts/post.njk
src/blog/index.njk
Cleanup and standardize CSS
  • Removed commented-out rules and excessive inline comments
  • Unified whitespace, indentation and trailing commas
  • Consolidated media‐query brackets and formatting
src/css/**/*.css
Refactor JS and config
  • Stripped outdated comments and unused parameters
  • Standardized object formatting and removed trailing commas
  • Cleaned up Eleventy plugin setup and added research collection
src/js/*.js
eleventy.config.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Apoo711 - I've reviewed your changes - here's some feedback:

  • I noticed you’ve manually added the Research nav link in many HTML templates—extract that into a shared include or macro to keep it DRY and prevent drift when you need to update it in the future.
  • The new research.css is quite large; consider splitting it into smaller component or utility files (or reusing existing base/component styles) to reduce duplication and keep the bundle more maintainable.
  • You’re relying on the CSS :has() selector for layout overrides (main:has(.page-with-left-sidebar)), which isn’t fully supported in all browsers—think about a fallback or an alternative way to apply those overrides.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- I noticed you’ve manually added the Research nav link in many HTML templates—extract that into a shared include or macro to keep it DRY and prevent drift when you need to update it in the future.
- The new research.css is quite large; consider splitting it into smaller component or utility files (or reusing existing base/component styles) to reduce duplication and keep the bundle more maintainable.
- You’re relying on the CSS :has() selector for layout overrides (main:has(.page-with-left-sidebar)), which isn’t fully supported in all browsers—think about a fallback or an alternative way to apply those overrides.

## Individual Comments

### Comment 1
<location> `src/_includes/layouts/research-list.njk:15` </location>
<code_context>
+                <article class="article-item">
+                    <div class="article-title-line">
+                        <h2><a href="{{ post.url | url }}">{{ post.data.title }}</a></h2>
+                        {% if post.data.status %}
+                            <span class="status-badge status-{{ post.data.status | slug }}">{{ post.data.status }}</span>
+                        {% endif %}
+                    </div>
</code_context>

<issue_to_address>
Using a slug filter on status may not handle all edge cases.

Sanitize or restrict status values to ensure valid CSS class names and prevent styling issues.

Suggested implementation:

```
                            <span class="status-badge status-{{ post.data.status | cssclass }}">{{ post.data.status }}</span>

```

You must define a `cssclass` filter in your Eleventy/Nunjucks configuration that:
- Converts the string to lowercase,
- Replaces spaces and invalid characters with hyphens,
- Removes any characters not allowed in CSS class names (e.g., only a-z, 0-9, and hyphens).

Example (in your .eleventy.js config):

```js
eleventyConfig.addFilter("cssclass", function(value) {
  return String(value)
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, '-')
    .replace(/^-+|-+$/g, '');
});
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +15 to +16
{% if post.data.status %}
<span class="status-badge status-{{ post.data.status | slug }}">{{ post.data.status }}</span>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Using a slug filter on status may not handle all edge cases.

Sanitize or restrict status values to ensure valid CSS class names and prevent styling issues.

Suggested implementation:

                            <span class="status-badge status-{{ post.data.status | cssclass }}">{{ post.data.status }}</span>

You must define a cssclass filter in your Eleventy/Nunjucks configuration that:

  • Converts the string to lowercase,
  • Replaces spaces and invalid characters with hyphens,
  • Removes any characters not allowed in CSS class names (e.g., only a-z, 0-9, and hyphens).

Example (in your .eleventy.js config):

eleventyConfig.addFilter("cssclass", function(value) {
  return String(value)
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, '-')
    .replace(/^-+|-+$/g, '');
});

Comment on lines 4 to 48
var slider = tns({
container: '.project-slider',
items: 1, // Default items for smallest screens
items: 1,
slideBy: 1,
autoplay: false,
controls: true,
// controlsText: ['\2039', '\203A'], // Using CSS ::before for controls now

nav: false,
gutter: 15,
edgePadding: 15, // Default edge padding, adjust for smallest screens
edgePadding: 15,
mouseDrag: true,
loop: true,
// fixedWidth: 325, // Remove fixedWidth from base for mobile-first approach

responsive: {
// Small mobile (e.g. up to 480px) - 1 item, let it fill space
320: { // Example breakpoint for small phones

320: {
items: 1,
edgePadding: 10,
// fixedWidth: false, // Explicitly ensure fixedWidth is off if inheriting

},
// Larger mobile / Small tablets
580: { // Breakpoint where 2 items might start to fit if not fixed width
items: 1, // Still 1 item if fixedWidth is desired, or 2 if flexible
// fixedWidth: 260, // Or a slightly smaller fixedWidth if desired

580: {
items: 1,

edgePadding: 20
},
// Tablets

768: {
items: 2,
// fixedWidth: 280, // Example: A fixed width that allows two items
edgePadding: 20 // Adjust as per layout.css container padding

edgePadding: 20
},
// Desktops

1024: {
items: 2, // Or 3 if you prefer and space allows
fixedWidth: 325, // Re-introduce fixedWidth for larger screens if desired
edgePadding: 30 // Adjust to match .project-slider-container padding
items: 2,
fixedWidth: 325,
edgePadding: 30
},
1200: { // For wider desktops if you want to show more items or wider fixedWidth
items: 2, // Or 3
fixedWidth: 325, // Or adjust as needed
edgePadding: 50 // Match desktop container padding
1200: {
items: 2,
fixedWidth: 325,
edgePadding: 50
}
}
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Use const or let instead of var. (avoid-using-var)

Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.

From the Airbnb JavaScript Style Guide

@Apoo711 Apoo711 merged commit 73c53a3 into main Jun 21, 2025
1 of 2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new “Research” section to the site, including navigation links, page templates, markdown content, styling, and Eleventy configuration updates.

  • Introduce “Research” link in site nav (HTML and base layout)
  • Create research index and individual post markdown with front-matter
  • Add layouts (research-list.njk, research-post.njk), research.css, and Eleventy collection for research

Reviewed Changes

Copilot reviewed 19 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/index.html, src/vce/chem/index.html Insert “Research” nav item
src/research/index.md Add research landing page content
src/research/2025/spanish-inquisition.md Create placeholder research post with lastUpdated
src/_includes/layouts/research-list.njk New layout for listing research articles
src/_includes/layouts/research-post.njk New layout for individual research posts
src/_includes/layouts/base.njk Include research.css and nav update
eleventy.config.js Register research collection and load new layouts
src/css/research.css Styling for research list and posts

<main>
<section id="research-list">
<h1>{{ title }}</h1>
<p class="intro">{{ content | safe }}</p>
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping {{ content }} (which itself outputs <p> tags) inside another <p> leads to invalid nested paragraphs. Consider using a <div class="intro">…</div> or output raw content without an extra <p> wrapper.

Suggested change
<p class="intro">{{ content | safe }}</p>
<div class="intro">{{ content | safe }}</div>

Copilot uses AI. Check for mistakes.
description: "A brief look into the Spanish Inquisition"
date: 2025-06-19
layout: layouts/research-post.njk
permalink: "/research/{{ page.date.getFullYear() }}/{{ page.fileSlug }}/"
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Front-matter permalink is not evaluated as JavaScript in Eleventy, so {{ page.date.getFullYear() }} will not be replaced. Use Eleventy’s date filter or a computed permalink in config instead (e.g., permalink: "/research/{{ page.date | date: '%Y' }}/{{ page.fileSlug }}/").

Suggested change
permalink: "/research/{{ page.date.getFullYear() }}/{{ page.fileSlug }}/"
permalink: "/research/{{ page.date | date: '%Y' }}/{{ page.fileSlug }}/"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants