(self, tmp_path, readme)
| 92 | (tmp_path / "SPONSORSHIP.md").write_text("# Sponsorship\n", encoding="utf-8") |
| 93 | |
| 94 | def _make_repo(self, tmp_path, readme): |
| 95 | (tmp_path / "README.md").write_text(readme, encoding="utf-8") |
| 96 | tpl_dir = tmp_path / "website" / "templates" |
| 97 | tpl_dir.mkdir(parents=True) |
| 98 | (tpl_dir / "base.html").write_text( |
| 99 | "<!DOCTYPE html><html lang='en'><head><title>{% block title %}{% endblock %}</title>" |
| 100 | "<meta name='description' content='{% block description %}{% endblock %}'>" |
| 101 | "</head><body>{% block content %}{% endblock %}</body></html>", |
| 102 | encoding="utf-8", |
| 103 | ) |
| 104 | (tpl_dir / "index.html").write_text( |
| 105 | '{% extends "base.html" %}{% block content %}' |
| 106 | "{% for entry in entries %}" |
| 107 | '<div class="row">' |
| 108 | "<span>{{ entry.name }}</span>" |
| 109 | "<span>{{ entry.categories | join(', ') }}</span>" |
| 110 | "<span>{{ entry.groups | join(', ') }}</span>" |
| 111 | "</div>" |
| 112 | "{% endfor %}" |
| 113 | "{% endblock %}", |
| 114 | encoding="utf-8", |
| 115 | ) |
| 116 | (tpl_dir / "category.html").write_text( |
| 117 | '{% extends "base.html" %}{% block content %}<h1>{{ category.name }}</h1>{% for entry in entries %}<a href="{{ entry.url }}">{{ entry.name }}</a>{% endfor %}{% endblock %}', |
| 118 | encoding="utf-8", |
| 119 | ) |
| 120 | (tpl_dir / "sponsorship.html").write_text( |
| 121 | '{% extends "base.html" %}{% block content %}<h1>Sponsor</h1>{% endblock %}', |
| 122 | encoding="utf-8", |
| 123 | ) |
| 124 | (tpl_dir / "llms.txt").write_text( |
| 125 | "# Awesome Python\n\nHomepage: {{ site_url }}\n\n## Categories\n\n{{ categories_md }}\n", |
| 126 | encoding="utf-8", |
| 127 | ) |
| 128 | |
| 129 | def _copy_real_templates(self, tmp_path): |
| 130 | real_tpl = Path(__file__).parent / ".." / "templates" |
no outgoing calls
no test coverage detected