Skip to content

Commit 43ff451

Browse files
committed
fix: use raw block instead of inline
1 parent 0aafe42 commit 43ff451

File tree

3 files changed

+117
-41
lines changed

3 files changed

+117
-41
lines changed

src/resources/projects/website/listing/item-default.ejs.md

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,56 +39,86 @@ print(`<div class="metadata-value listing-${field}">${listing.utilities.outputLi
3939
::: {.quarto-post .image-<%= imageAlign %> <%= listing.utilities.metadataAttrs(item) %>}
4040

4141
<% if (fields.includes('image')) { %>
42-
`<div class="thumbnail"><a href="<%- item.path %>" class="no-external">`{=html}
42+
43+
```{=html}
44+
<div class="thumbnail"><a href="<%- item.path %>" class="no-external">
4345
<% if (item.image) { %>
4446
<%= listing.utilities.img(itemNumber, item.image, "thumbnail-image", item['image-alt'], item['image-lazy-loading'] ?? listing['image-lazy-loading']) %>
4547
<% } else { %>
4648
<%= listing.utilities.imgPlaceholder(listing.id, itemNumber, item.outputHref) %>
4749
<% } %>
48-
`</a></div>`{=html}
50+
</a></div>
51+
```
52+
4953
<% } %>
5054

5155
::: {.body}
5256

5357
<% if (fields.includes('title')) { %>
54-
`<h3 class="no-anchor listing-title"><a href="<%- item.path %>" class="no-external">`{=html} <%= item.title %> `</a></h3>`{=html}
58+
<h3 class="no-anchor listing-title"><a href="<%- item.path %>" class="no-external"><%= item.title %></a></h3>
5559
<% if (fields.includes('subtitle')) { %>
56-
`<div class="listing-subtitle"><a href="<%- item.path %>" class="no-external">`{=html} <%= item.subtitle %> `</a></div>`{=html}
60+
<div class="listing-subtitle"><a href="<%- item.path %>" class="no-external"><%= item.subtitle %></a></div>
5761
<% } %>
5862
<% } %>
5963

6064
<% if (fields.includes('categories') && item.categories) { %>
61-
`<div class="listing-categories">`{=html}
65+
66+
```{=html}
67+
<div class="listing-categories">
6268
<% for (const category of item.categories) { %>
63-
`<div class="listing-category" onclick="window.quartoListingCategory('<%- utils.b64encode(category) %>'); return false;">`{=html} <%= category %> `</div>`{=html}
69+
<div class="listing-category" onclick="window.quartoListingCategory('<%- utils.b64encode(category) %>'); return false;"><%= category %></div>
6470
<% } %>
65-
`</div>`{=html}
71+
</div>
72+
```
73+
6674
<% } %>
6775

6876
<% if (fields.includes('description')) { %>
69-
`<div class="delink listing-description"><a href="<%- item.path %>" class="no-external">`{=html} <%= item.description %> `</a></div>`{=html}
77+
78+
```{=html}
79+
<div class="delink listing-description"><a href="<%- item.path %>" class="no-external">
80+
```
81+
82+
<%= item.description %>
83+
84+
```{=html}
85+
</a></div>
86+
```
87+
7088
<% } %>
7189

7290
:::
7391

7492
::: {.metadata}
75-
`<a href="<%- item.path %>" class="no-external">`{=html}
93+
94+
```{=html}
95+
<a href="<%- item.path %>" class="no-external">
96+
```
97+
7698
<% if (fields.includes('date') && item.date) { %>
77-
`<div class="listing-date">`{=html} <%= item.date %> `</div>`{=html}
99+
<div class="listing-date"><%= item.date %></div>
78100
<% } %>
79101

80102
<% if (fields.includes('author') && item.author) { %>
81-
`<div class="listing-author">`{=html} <%= item.author %> `</div>`{=html}
103+
<div class="listing-author"><%= item.author %></div>
82104
<% } %>
83105

84106
<% if (fields.includes('reading-time') && item['reading-time']) { %>
85-
`<div class="listing-reading-time">`{=html} <%= item['reading-time'] %> `</div>`{=html}
107+
108+
```{=html}
109+
<div class="listing-reading-time"><%= item['reading-time'] %></div>
110+
```
111+
86112
<% } %>
87113

88114
<% for (const field of otherFields) { %>
89115
<% outputMetadata(item, field) %>
90116
<% } %>
91-
`</a>`{=html}
117+
118+
```{=html}
119+
</a>
120+
```
121+
92122
:::
93123

94124
:::

src/resources/projects/website/listing/item-grid.ejs.md

Lines changed: 73 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,93 +45,139 @@ return !["title", "image", "image-alt", "date", "author", "subtitle", "descripti
4545
```
4646

4747
<% if (fields.includes('image')) { %>
48+
4849
<% if (item.image) { %>
49-
`<p class="card-img-top">`{=html}
50+
51+
```{=html}
52+
<p class="card-img-top">
5053
<%= listing.utilities.img(itemNumber, item.image, "thumbnail-image card-img", item['image-alt'], item['image-lazy-loading'] ?? listing['image-lazy-loading']) %>
51-
`</p>`{=html}
54+
</p>
55+
```
56+
5257
<% } else { %>
58+
59+
```{=html}
5360
<%= listing.utilities.imgPlaceholder(listing.id, itemNumber, item.outputHref) %>
54-
<% } %>
61+
```
5562

5663
<% } %>
64+
<% } %>
65+
5766
<% if (showField('title') || showField('subtitle') || showField('description') || showField('author') || showField('date') || otherFields.length > 0) { %>
5867

59-
`<div class="card-body post-contents">`{=html}
68+
::: {.card-body .post-contents}
6069

6170
<% if (showField('title')) { %>
62-
`<h5 class="no-anchor card-title listing-title">`{=html} <%= item.title %> `</h5>`{=html}
71+
<h5 class="no-anchor card-title listing-title"><%= item.title %></h5>
6372
<% } %>
6473

6574
<% if (showField('subtitle')) { %>
66-
`<div class="card-subtitle listing-subtitle">`{=html} <%= item.subtitle %> `</div>`{=html}
75+
<div class="card-subtitle listing-subtitle"><%= item.subtitle %></div>
6776
<% } %>
6877

6978
<% if (showField('reading-time')) { %>
70-
`<div class="listing-reading-time card-text text-muted">`{=html} <%= item['reading-time'] %> `</div>`{=html}
79+
80+
```{=html}
81+
<div class="listing-reading-time card-text text-muted"><%= item['reading-time'] %></div>
82+
```
83+
7184
<% } %>
7285

7386
<% if (fields.includes('categories') && item.categories) { %>
74-
`<div class="listing-categories">`{=html}
7587

88+
```{=html}
89+
<div class="listing-categories">
7690
<% for (const category of item.categories) { %>
77-
`<div class="listing-category" onclick="window.quartoListingCategory('<%- utils.b64encode(category ) %>'); return false;">`{=html} <%= category %> `</div>`{=html}
91+
<div class="listing-category" onclick="window.quartoListingCategory('<%- utils.b64encode(category ) %>'); return false;"><%= category %></div>
7892
<% } %>
93+
</div>
94+
```
7995

80-
`</div>`{=html}
8196
<% } %>
8297

8398
<% if (showField('description')) { %>
84-
`<div class="card-text listing-description delink">`{=html} <%= item.description %> `</div>`{=html}
99+
100+
```{=html}
101+
<div class="card-text listing-description delink">
102+
```
103+
104+
<%= item.description %>
105+
106+
```{=html}
107+
</div>
108+
```
109+
85110
<% } %>
86111

87112
<%
88113
const flexJustify = showField('author') && showField('date') ? "justify" : showField('author') ? "start" : "end";
89114
%>
90115

91116
<% if (showField('author') || showField('date')) { %>
92-
`<div class="card-attribution card-text-small <%- flexJustify %>">`{=html}
117+
118+
```{=html}
119+
<div class="card-attribution card-text-small <%- flexJustify %>">
120+
```
93121

94122
<% if (showField('author')) { %>
95-
`<div class="listing-author">`{=html} <%= item.author %> `</div>`{=html}
123+
<div class="listing-author"><%= item.author %></div>
96124
<% } %>
97125

98126
<% if (showField('date')) { %>
99-
`<div class="listing-date">`{=html} <%= item.date %> `</div>`{=html}
127+
<div class="listing-date"><%= item.date %></div>
100128
<% } %>
101129

102-
`</div>`{=html}
130+
```{=html}
131+
</div>
132+
```
133+
103134
<% } %>
104135

105136
<% if (otherFields.length > 0) { %>
106-
`<table class="card-other-values">`{=html}
137+
138+
```{=html}
139+
<table class="card-other-values">
107140
<% for (const field of otherFields) {
108141
let value = readField(item, field);
109142
%>
110-
`<tr>`{=html}
111-
`<td>`{=html} <%= listing.utilities.fieldName(field) %> `</td>`{=html}
112-
`<td class="<%- field %>">`{=html} <%= listing.utilities.outputLink(item, field, value) %> `</td>`{=html}
113-
`</tr>`{=html}
143+
<tr>
144+
<td><%= listing.utilities.fieldName(field) %></td>
145+
<td class="<%- field %>"><%= listing.utilities.outputLink(item, field, value) %></td>
146+
</tr>
114147
<% } %>
115-
`</table>`{=html}
148+
</table>
149+
```
150+
116151
<% } %>
117152

118-
`</div>`{=html}
153+
:::
119154
<% } %>
120155

121156
<% if (fields.includes('filename') || fields.includes('file-modified')) { %>
122157

123-
`<div class="card-footer">`{=html}
158+
::: {.card-footer}
124159

125160
<% if (fields.includes('filename')) { %>
126-
`<div class="card-filename listing-filename">`{=html} <%= item.filename ? item.filename : "&nbsp;" %> `</div>`{=html}
161+
162+
```{=html}
163+
<div class="card-filename listing-filename"><%= item.filename ? item.filename : "&nbsp;" %></div>
164+
```
165+
127166
<% } %>
128167

129168
<% if (fields.includes('file-modified')) { %>
130-
`<div class="card-file-modified listing-file-modified">`{=html} <%= item['file-modified'] ? item['file-modified'] : "&nbsp;" %> `</div>`{=html}
169+
170+
```{=html}
171+
<div class="card-file-modified listing-file-modified"><%= item['file-modified'] ? item['file-modified'] : "&nbsp;" %></div>
172+
```
173+
131174
<% } %>
132175

133-
`</div>`{=html}
176+
:::
134177
<% } %>
135-
`</div></a>`{=html}
178+
179+
```{=html}
180+
</div></a>
181+
```
136182

137183
:::

src/resources/projects/website/listing/listing-table.ejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ return listing.utilities.outputLink(item, field, value, `listing-${field}`);
7070
<tr>
7171
<% for (const field of fields) { %>
7272
<th>
73-
<% if (sortUi && hasSort(field)) { %><a class="sort" data-sort="<%-listing.utilities.sortTarget(field)%>" onclick="if (this.classList.contains('sort-asc')) { this.classList.add('sort-desc'); this.classList.remove('sort-asc') } else { this.classList.add('sort-asc'); this.classList.remove('sort-desc')} return false;"><% } %><%= listing.utilities.fieldName(field) %><% if (sortUi && hasSort(field)) { %></a><% } %>
73+
<% if (sortUi && hasSort(field)) { %><a class="sort" data-sort="<%- listing.utilities.sortTarget(field) %>" onclick="if (this.classList.contains('sort-asc')) { this.classList.add('sort-desc'); this.classList.remove('sort-asc') } else { this.classList.add('sort-asc'); this.classList.remove('sort-desc')} return false;"><% } %><%= listing.utilities.fieldName(field) %><% if (sortUi && hasSort(field)) { %></a><% } %>
7474
</th>
7575
<% } %>
7676
</tr>

0 commit comments

Comments
 (0)