Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions plugin-readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ type PluginReadmeOptions = {

export const pluginReadme = (options: PluginReadmeOptions): Plugin => {
const watchDir = path.join(__dirname, options.watchDir);
let base = "/";

const marked = new Marked(
markedHighlight({
async: true,
Expand Down Expand Up @@ -80,10 +78,6 @@ export const pluginReadme = (options: PluginReadmeOptions): Plugin => {
return;
}
},
configResolved(config) {
// Get the base URL from Vite config.
base = config.base;
},
transformIndexHtml(html) {
return `<html lang="en">
<head>
Expand All @@ -93,7 +87,6 @@ export const pluginReadme = (options: PluginReadmeOptions): Plugin => {
name="description"
content="${options.description}"
/>
<link rel="icon" type="image/svg+xml" href="${base}favicon.svg" />
<title>${options.title}</title>
<style>
html {
Expand Down
1 change: 0 additions & 1 deletion public/favicon.svg

This file was deleted.

1 change: 1 addition & 0 deletions tests/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
import "github-markdown-css/github-markdown-dark.css";
import { mount } from "svelte";
import Readme from "../README.md";
import favicon from "./favicon.svg";

const faviconElement = document.createElement("link");
faviconElement.rel = "icon";
faviconElement.type = "image/svg+xml";
faviconElement.href = favicon;
document.head.appendChild(faviconElement);

mount(Readme, { target: document.getElementById("readme") });
</script>