Skip to content

Commit 90417b3

Browse files
refactor
1 parent 9c5e476 commit 90417b3

26 files changed

+262
-318
lines changed

.github/copilot-instructions.md

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Persona Zola Theme
22

3-
Persona is a modern, responsive portfolio and blog theme for the Zola static site generator. It features Bootstrap components, AOS animations, and a clean design suitable for personal websites, portfolios, resumes, and blogs.
3+
Persona is a modern, responsive portfolio and blog theme for the Zola static site generator.
4+
It features Bootstrap components, AOS animations, and a clean design suitable for personal websites, portfolios, resumes, and blogs.
45

56
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
67

@@ -9,7 +10,7 @@ Always reference these instructions first and fallback to search or bash command
910
### Prerequisites and Setup
1011
- Install Zola static site generator (minimum version 0.20.0):
1112
```bash
12-
wget https://github.com/getzola/zola/releases/download/v0.19.2/zola-v0.19.2-x86_64-unknown-linux-gnu.tar.gz -O /tmp/zola.tar.gz
13+
wget https://github.com/getzola/zola/releases/download/v0.20.0/zola-v0.20.0-x86_64-unknown-linux-gnu.tar.gz -O /tmp/zola.tar.gz
1314
tar -xzf /tmp/zola.tar.gz -C /tmp
1415
sudo mv /tmp/zola /usr/local/bin/
1516
```
@@ -21,33 +22,6 @@ Always reference these instructions first and fallback to search or bash command
2122
- Serve development version: `zola serve --interface 0.0.0.0 --port 8000` -- starts immediately
2223
- Clean build: Remove `public/` directory before building if needed
2324

24-
### Content Structure Requirements
25-
This is a **theme repository**, not a complete site. To test functionality:
26-
27-
1. Create `content/` directory in repository root
28-
2. Create `content/_index.md` with basic frontmatter:
29-
```markdown
30-
+++
31-
+++
32-
33-
# Welcome to Persona Theme
34-
```
35-
36-
3. For additional sections, create structured content like:
37-
```markdown
38-
+++
39-
title = "About"
40-
template = "plain.html"
41-
42-
[extra]
43-
order = 1
44-
icon_class = "bi bi-person"
45-
template = "plain.html"
46-
+++
47-
48-
Content goes here.
49-
```
50-
5125
### Validation and Testing
5226
- **CRITICAL**: Always test theme functionality after making changes by:
5327
1. Creating test content structure as described above
@@ -62,7 +36,7 @@ This is a **theme repository**, not a complete site. To test functionality:
6236
**Key template requirements that must be satisfied:**
6337
- Sections displayed in navigation need `extra.icon_class` (Bootstrap Icons)
6438
- Sections need `extra.order` for display ordering
65-
- Sections need `extra.template` matching template type (`"plain.html"` or `"category.html"`)
39+
- Sections need `extra.type` matching template type (`"plain"`, `"category"`, or `"blog"`)
6640
- Blog posts need `extra.excerpt` for post listing pages
6741
- Sections with cards need `extra.thumbnail` for image display
6842

@@ -86,7 +60,12 @@ This is a **theme repository**, not a complete site. To test functionality:
8660
│ └── vendor/ # Third-party libraries
8761
└── templates/ # Zola templates
8862
├── base.html # Base template
89-
├── index.html # Home page template
63+
├── index.html # Home template
64+
├── 404.html # 404 error page
65+
├── section.html # Section template
66+
├── page.html # Page template
67+
├── categories/ # Category template
68+
├── shortcodes/ # Shortcode macros
9069
├── macros/ # Template macros
9170
└── partials/ # Template partials
9271
```
@@ -98,13 +77,13 @@ This is a **theme repository**, not a complete site. To test functionality:
9877

9978
### Troubleshooting
10079
**Common template errors:**
101-
- `Variable 'subsection.extra.icon_class' not found`: Add `icon_class` to section frontmatter
102-
- `Variable 'page.extra.excerpt' not found`: Add `excerpt` to page frontmatter
103-
- `Variable 'pos.extra.template' not found`: Add `template` to section extra metadata
80+
- `Variable 'subsection.extra.icon_class' not found`: Add `icon_class` to section front matter
81+
- `Variable 'page.extra.excerpt' not found`: Add `excerpt` to page front matter
82+
- `Variable 'pos.extra.type' not found`: Add `type` to section extra metadata
10483

10584
**Build issues:**
10685
- Empty builds (0 pages): Create `content/_index.md` file
107-
- Template rendering errors: Check section frontmatter has required fields
86+
- Template rendering errors: Check section front matter has required fields
10887
- Missing assets: Verify `static/` directory structure is intact
10988

11089
**Development server issues:**
@@ -123,7 +102,7 @@ After making template or style changes, always validate by:
123102
```
124103

125104
2. **Full theme test with sections:**
126-
- Create multiple content sections with proper frontmatter
105+
- Create multiple content sections with proper front matter
127106
- Test navigation between sections
128107
- Verify responsive design
129108
- Check contact form display (if configured)

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,3 @@
33

44
# Zola build directory
55
public/
6-
7-
# Test content (for theme testing only)
8-
content/
9-
10-
# processed images
11-
static/processed_images/

config.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ compile_sass = true
1313
build_search_index = true
1414

1515
taxonomies = [
16-
{ name = "tags" },
17-
{ name = "categories" },
16+
{ name = "tags", feed = true },
17+
{ name = "categories", feed = true },
1818
]
1919

2020
[markdown]
@@ -35,8 +35,6 @@ external_links_no_referrer = true
3535
[extra]
3636

3737
[extra.persona]
38-
title = "Persona"
39-
subtitles = "a Portfolio, a Resume, a Blog, a Zola Theme"
4038
quote = "There's the private persona and the public persona, and the two shall never meet. --- Liev Schreiber"
4139
social_links = [
4240
{ name = "GitHub", url = "https://github.com/hanson-hschang/persona-zola-theme", icon_class = "bi bi-github" },

content/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
title = "Persona"
3+
template = "index.html"
4+
[extra]
5+
subtitles = "a Portfolio, a Resume, a Blog, a Zola Theme"
6+
+++

templates/404.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% extends "base.html" %}
2-
{% import "macros/title.html" as title_macro %}
3-
{% import "macros/content.html" as content_macro %}
2+
{% import "macros/render.html" as render_macro %}
43

54
{% block head %}
65
{{ super() }}
@@ -15,12 +14,10 @@
1514

1615
<section class="plain section">
1716

18-
{{
19-
title_macro::render(
20-
title="Error 404 - Page Not Found",
21-
subtitle="The page you are looking for was not found or no longer exists."
22-
)
23-
}}
17+
{{ render_macro::section_title(
18+
title="Error 404 - Page Not Found",
19+
subtitle="The page you are looking for was not found or no longer exists."
20+
) }}
2421

2522
</section>
2623

templates/base.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
{% import "macros/head.html" as head_macro %}
2-
{% import "macros/icon-link.html" as icon_link_macro %}
31
{% import "macros/debug.html" as debug_macro %}
42

5-
63
<!DOCTYPE html>
74
<html lang="en">
85

@@ -12,7 +9,7 @@
129
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
1310

1411
<!-- Meta Info -->
15-
{{ head_macro::title() }}
12+
{% include "partials/head-title.html" %}
1613
<meta name="description" content="{{ config.description }}" >
1714
<meta name="author" content="{{ config.author }}" >
1815

@@ -32,7 +29,6 @@
3229
<link rel="stylesheet" href="{{ get_url(path='vendor/swiper/swiper-bundle.min.css') }}">
3330
<link rel="stylesheet" href="{{ get_url(path='vendor/academicons/css/academicons.min.css') }}"/>
3431

35-
<!-- Debug CSS -->
3632
{% if page.extra.tex %}
3733
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
3834
{% endif %}

templates/blog.html

Lines changed: 0 additions & 25 deletions
This file was deleted.

templates/category.html

Lines changed: 0 additions & 30 deletions
This file was deleted.

templates/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{% extends "base.html" %}
2-
{% import "macros/title.html" as title_macro %}
32
{% import "macros/section.html" as section_macro %}
43

54

@@ -25,7 +24,7 @@
2524
{% set_global poss = poss | concat(with=[subsection]) %}
2625
{% endif %}
2726
{% endfor %}
28-
{{ section_macro::render(poss=poss) }}
27+
{{ section_macro::populate(poss=poss) }}
2928

3029
{% include "partials/contact.html" %}
3130

templates/macros/blog.html

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
{% import "macros/breadcrumbs.html" as breadcrumbs_macro %}
2-
{% import "macros/title.html" as title_macro %}
3-
{% import "macros/icon-link.html" as icon_link_macro %}
4-
5-
{#
6-
Page Macros
7-
These macros are used to render different types of pages on the website.
8-
#}
1+
{% import "macros/render.html" as render_macro %}
92

103
{% macro post_thumbnail(thumbnail) %}
114
<div class="post-img">
125
<img src="{{ page.extra.thumbnail }}" alt="" class="img-fluid">
136
</div>
14-
{% endmacro post_thumbnail %}
7+
{% endmacro %}
158

169
{% macro post_share(link) %}
1710

1811
<div id="share" class="share-container">
1912
<button id="share-button" class="share-button" aria-label="Share post">
2013
<i class="bi bi-box-arrow-up" aria-hidden="true"></i>
2114
</button>
22-
{{ icon_link_macro::share()}}
15+
{{ render_macro::share_menu(title=page.title, permalink=page.permalink) }}
2316
</div>
2417

25-
{% endmacro post_share %}
18+
{% endmacro %}
2619

2720

2821
{% macro post_tag(tags) %}
@@ -33,7 +26,7 @@
3326
{% endfor %}
3427
{% endif %}
3528
</div>
36-
{% endmacro post_tag %}
29+
{% endmacro %}
3730

3831

3932
{% macro post_header(page) %}
@@ -69,12 +62,12 @@ <h2 class="post-title">{{ page.title }}</h2>
6962
<div class="meta-top-divider"></div>
7063
</div>
7164

72-
{% endmacro post_header %}
65+
{% endmacro %}
7366

7467

7568
{% macro post_content(content) %}
7669
<div class="post-content">{{ content | safe }}</div>
77-
{% endmacro post_content %}
70+
{% endmacro %}
7871

7972

8073
{% macro side_bar(page) %}
@@ -97,12 +90,12 @@ <h4><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h4>
9790
</div>
9891
</aside>
9992

100-
{% endmacro side_bar %}
93+
{% endmacro %}
10194

10295

10396
{% macro post(page) %}
10497

105-
{{ breadcrumbs_macro::render(crumbs=page.components) }}
98+
{{ render_macro::breadcrumbs(crumbs=page.components) }}
10699
<div class="container">
107100
<div class="row">
108101
<section id="blog-post" class="blog-post section col-lg-8">
@@ -120,4 +113,4 @@ <h4><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h4>
120113
</div>
121114
</div>
122115

123-
{% endmacro blog_post%}
116+
{% endmacro %}

0 commit comments

Comments
 (0)