Skip to content

Commit 85362ac

Browse files
authored
Merge pull request #6 from ajphilton/copilot/fix-github-pages-publish-workflow
Fix GitHub Pages site build and exclude pages from PyPI publish
2 parents 6d314fd + bf6aed9 commit 85362ac

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- main
77
tags:
88
- 'v*'
9+
paths-ignore:
10+
- 'pages/**'
11+
- '.github/workflows/pages.yaml'
12+
- 'docs/**'
913

1014
jobs:
1115
build:

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ include README.md
22
include CHANGELOG.md
33
include LICENSE
44
recursive-include caddy_tui *.py
5+
prune pages
6+
prune docs

pages/build.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,18 @@
4242

4343

4444
# Extract meta tags, schema.org, and Open Graph from META.md
45-
meta_tags = []
46-
schema_org = []
4745
open_graph = []
46+
schema_org_match = re.search(r'(<script\s+type="application/ld\+json">[\s\S]*?</script>)', meta_md)
47+
schema_org_html = schema_org_match.group(1) if schema_org_match else ""
48+
4849
for line in meta_md.splitlines():
49-
if line.strip().startswith('<meta '):
50-
meta_tags.append(line.strip())
51-
elif line.strip().startswith('<script '):
52-
schema_org.append(line.strip())
53-
elif line.strip().startswith('<meta property="og:'):
50+
if line.strip().startswith('<meta property="og:'):
5451
open_graph.append(line.strip())
5552

5653
# Compose meta head HTML
57-
meta_head_html = '\n'.join(meta_tags + schema_org + open_graph)
54+
meta_head_html = '\n'.join(open_graph)
55+
if schema_org_html:
56+
meta_head_html = meta_head_html + '\n' + schema_org_html if meta_head_html else schema_org_html
5857

5958

6059
# Convert markdown to HTML for README sections

pages/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>caddy-tui Pages Site</title>
8+
<!-- META_HEAD -->
89
<link rel="stylesheet" href="style.css">
910
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg">
1011
</head>
1112

1213
<body>
1314
<div class="container">
1415
<h1>caddy-tui</h1>
15-
<section id="meta">
16-
<!-- Meta info from META.md will be inserted here by build script -->
17-
</section>
1816
<section id="readme-intro">
1917
<!-- README intro will be inserted here by build script -->
2018
</section>
@@ -27,4 +25,4 @@ <h1>caddy-tui</h1>
2725
</div>
2826
</body>
2927

30-
</html>
28+
</html>

pages/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
h1, h2, h3 {
21
body {
32
font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
43
background: #f6f5ec;
54
color: #222e3a;
65
margin: 0;
76
padding: 0;
87
}
8+
h1, h2, h3 {
99
color: #2456a6;
1010
font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
1111
font-weight: 700;

0 commit comments

Comments
 (0)