feat: add Pi agent blog post, AI tooling, and SVG support
test / cargo test (push) Failing after 1m56s
test / cargo test (push) Failing after 1m56s
Add new blog post documenting a week using the Pi CLI agent for 100% agentic development. Include AI agent configuration with custom prompts and skills to streamline content creation workflow. - Publish "Week with my-pi-agent" article with Pi logo and screenshot assets - Add .pi/ configuration with new-blog-post prompt and review-article skill - Create AGENTS.md with comprehensive project documentation for AI assistants - Fix SVG rendering to skip unsupported dimension extraction in markdown filter - Update picture generator to handle SVG files with simple img tag - Update syntect dependency to 5.3.0 with default-fancy features - Swap featured segment from older post to new Pi agent article
This commit is contained in:
@@ -64,6 +64,19 @@ pub fn parse_markdown<T: fmt::Display>(
|
||||
);
|
||||
}
|
||||
|
||||
// Handle SVG files - don't try to get dimensions (image crate doesn't support SVG)
|
||||
if dest_url.to_lowercase().ends_with(".svg") {
|
||||
return Event::Html(
|
||||
formatdoc!(
|
||||
r#"<figure>
|
||||
<img src="{dest_url}" alt="{title}">
|
||||
<figcaption>
|
||||
"#
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
|
||||
let dev_only_img_path =
|
||||
Path::new("static/").join(dest_url.strip_prefix("/").unwrap_or(&dest_url));
|
||||
|
||||
|
||||
@@ -23,13 +23,27 @@ pub fn generate_picture_markup(
|
||||
class_name: Option<&str>,
|
||||
) -> Result<String, anyhow::Error> {
|
||||
let orig_path = Path::new(orig_img_path);
|
||||
let exported_formats = get_export_formats(orig_path);
|
||||
let class_attr = if let Some(class) = class_name {
|
||||
format!(r#"class="{class}""#)
|
||||
} else {
|
||||
"".to_string()
|
||||
};
|
||||
|
||||
// Handle SVG files - return simple img tag with provided dimensions for display sizing
|
||||
if orig_img_path.to_lowercase().ends_with(".svg") {
|
||||
return Ok(formatdoc!(
|
||||
r#"<img
|
||||
src="{orig_img_path}"
|
||||
width="{width}"
|
||||
height="{height}"
|
||||
{class_attr}
|
||||
alt="{alt_text}"
|
||||
>"#
|
||||
));
|
||||
}
|
||||
|
||||
let exported_formats = get_export_formats(orig_path);
|
||||
|
||||
// Here the resolution is already correct
|
||||
if exported_formats.is_empty() {
|
||||
return Ok(formatdoc!(
|
||||
|
||||
Reference in New Issue
Block a user