Skip to content

Commit 01d05dd

Browse files
committed
blog.jquery.com: Sync sites.php entry and import blog.jquery.com theme
The version of this theme in this repo is practicaly empty and hasn't been used in a long time. When activating this locally via jquery-wp-docker, I noticed the settings don't match what we use in production. * Import files from: https://github.com/jquery/blog.jquery.com-theme/tree/6710984735eb/jquery.com Refactor files slightly to work on the current version of the base theme. blog.jquery.com-theme/jquery/ - /header.php /footer-bottom.php /menu-header.php /page-fullwidth.php /searchform.php Minor differences, differed only in being a older but compatible version. Kept the newer ones here unchanged. (e.g. still mentioned Forum, IRC, and StackPath, and older search input field styling). - /functions.jquery.php This defined one extra function, jq_logo_link, which served as a workaround for missing some parts of jquery-wp-content by hardcoding `return '/'`, and already had a TODO for removing it when merging into jquery-wp-content. It was used in header.php, where we now use `get_option('jquery_logo_link', '/')` which works fine for the blog. blog.jquery.com-theme/jquery.com/ - /functions.php: The body_class filter for class "listing" is already here as part of plugins/jquery-filters.php. The twentyeleven_comment (now jq_comment) function had logic for pingbanks. Import this code over so that (approved) pingbacks remain displayed among blog comments. - /category.php Identical to the one in the current "jquery" base theme, except for the heading "Category Archives" instead of "Category". This is presumably because API pages are considered posts in a category, and so the word "Archives" would be confusing there. Solve this by keeping the neutral "Category" that we have in the base theme and remove the forked veersion for that one word difference. - /content.php The only difference was the class "entry-posted" instead of "entry-meta" for the "posted on" date. This branch in the base theme is never used, so change it to the one the blog has. The entry-posted class is styled nearly the same as entry-meta except that in category/search listings we don't float "post on" to the right, whereas entry-meta categories are. - /single.php This is an override for blog posts. In order to share this neatly across the three blogs in the future, I've added this to the base theme as "single-blogpost.php" with a stub in blog.jquery.com/single.php that references this. This is akin to how we share templates for API sites with single-api.php. * comments.php: Add missing support for post_password_required This is included at https://github.com/jquery/blog.jquery.com-theme but missing here. Given no other sites use this, prefer to keep this as-is instead of figuring out whether it is safe to remove. * base.css: Move text-shadow from `blockquote p` to `blockquote`. In markdown, things generally get wrapped in paragraphs, but in WordPress they typically don't. Tweak this to match the styles of the blog theme instead, which should still apply to paragraphs inside quotes just as well. Follows-up #454. Ref jquery/infrastructure-puppet#17
1 parent f004bf9 commit 01d05dd

17 files changed

+413
-92
lines changed

plugins/jquery-actions.php

-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44
* Description: Default actions for all jQuery sites.
55
*/
66

7-
remove_action( 'wp_head', 'feed_links', 2 );
8-
remove_action( 'wp_head', 'feed_links_extra', 3 );
9-
remove_action( 'wp_head', 'rsd_link' );
10-
remove_action( 'wp_head', 'wlwmanifest_link' );
11-
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
12-
13-
// Remove shortlink <head> and header.
14-
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10 );
15-
remove_action( 'template_redirect', 'wp_shortlink_header', 11 );
16-
177
// Ensure relative links remain on the current protocol
188
// (such as references to theme assets and intra-site links).
199
// This does not influence 'home' and 'siteurl' options, and thus

plugins/jquery-filters.php

+15-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,21 @@
3131
}
3232
unset( $sites, $options, $option );
3333

34-
// Disable WordPress auto-paragraphing for posts.
35-
remove_filter( 'the_content', 'wpautop' );
34+
// Remove misc links from <head> on non-blog sites
35+
if ( !get_option( 'jquery_is_blog' ) ) {
36+
remove_action( 'wp_head', 'feed_links', 2 );
37+
remove_action( 'wp_head', 'feed_links_extra', 3 );
38+
remove_action( 'wp_head', 'rsd_link' );
39+
remove_action( 'wp_head', 'wlwmanifest_link' );
40+
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
41+
42+
// Remove shortlink <head> and header.
43+
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10 );
44+
remove_action( 'template_redirect', 'wp_shortlink_header', 11 );
45+
46+
// Disable WordPress auto-paragraphing for posts, except on actual blog sites
47+
remove_filter( 'the_content', 'wpautop' );
48+
}
3649

3750
// Disable WordPress text transformations (smart quotes, etc.) for posts.
3851
remove_filter( 'the_content', 'wptexturize' );

sites.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ function jquery_sites() {
2626
'blog_id' => 2,
2727
'cookie_domain' => '.jquery.com',
2828
'options' => array(
29-
'blogname' => 'jQuery Blog',
30-
'stylesheet' => 'blog-jquery-com',
31-
// 'permalink_structure' => '/%category%/%postname%/',
29+
'blogname' => 'Official jQuery Blog',
30+
'blogdescription' => 'New Wave JavaScript',
31+
'jquery_author' => 'jQuery Team - jquery.com',
32+
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
33+
'stylesheet' => 'blog.jquery.com',
3234
'jquery_body_class' => 'jquery',
35+
'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/',
36+
'jquery_is_blog' => true,
3337
),
3438
),
3539
'api.jquery.com' => array(
@@ -395,6 +399,7 @@ function jquery_default_site_options() {
395399
'blogdescription' => '',
396400
'permalink_structure' => '/%postname%/',
397401
'use_smilies' => 0,
402+
398403
// The one site where comments are sometimes enabled (blog.jquery.com)
399404
// has always had thread_comments turned off.
400405
//

themes/blog.jquery.com/sidebar.php

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<div id="sidebar" class="widget-area" role="complementary">
2+
<aside class="widget">
3+
<h3 class="widget-title">Categories</h3>
4+
<ul>
5+
<?php wp_list_categories(array(
6+
'depth' => 1,
7+
'title_li' => '',
8+
'exclude' => '1'
9+
)); ?>
10+
</ul>
11+
</aside>
12+
<aside class="widget">
13+
<h3 class="widget-title">Recent Posts</h3>
14+
<ul>
15+
<?php
16+
$recent_posts = wp_get_recent_posts(array(
17+
'post_status' => 'publish'
18+
));
19+
foreach( $recent_posts as $recent ){
20+
echo '<li><a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"].'</a></li>';
21+
}
22+
?>
23+
</ul>
24+
</aside>
25+
<aside class="widget">
26+
<h3 class="widget-title">Archives</h3>
27+
<ul>
28+
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
29+
</ul>
30+
</aside>
31+
</div>

themes/blog.jquery.com/single.php

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
get_template_part( 'single', 'blogpost' );

themes/blog.jquery.com/style.css

+289
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,292 @@
22
Theme Name: blog-jquery-com
33
Template: jquery
44
*/
5+
6+
a,
7+
.title {
8+
color: #b24926;
9+
}
10+
#content a:hover {
11+
color: #333;
12+
}
13+
14+
.assistive-text,
15+
.screen-reader-text {
16+
position: absolute !important;
17+
clip: rect(1px, 1px, 1px, 1px);
18+
overflow: hidden;
19+
height: 1px;
20+
width: 1px;
21+
}
22+
23+
/* Copied from blog.jquery.com-theme.git:/jquery/css/blog.css */
24+
25+
.alignright {
26+
float: right;
27+
}
28+
.alignleft {
29+
float: left;
30+
}
31+
32+
.entry-posted {
33+
color: #999;
34+
font-size: 12px;
35+
}
36+
37+
/* =Comments
38+
----------------------------------------------- */
39+
40+
#comments-title,
41+
#content h2#comments-title {
42+
margin-top: 2.6em;
43+
text-transform: uppercase;
44+
}
45+
.nopassword,
46+
.nocomments {
47+
font-size: 24px;
48+
font-weight: 100;
49+
margin: 26px 0;
50+
}
51+
.commentlist {
52+
list-style: none;
53+
margin: 0 auto;
54+
}
55+
.content .commentlist,
56+
.page-template-sidebar-page-php .commentlist {
57+
width: 100%; /* reset the width for the one-column and sidebar page layout */
58+
}
59+
#comments .commentlist > li.comment {
60+
background: #f6f6f6;
61+
border: 1px solid #ddd;
62+
border-radius: 3px;
63+
margin: 0 0 1em 53px;
64+
padding: 1em 1.2em 0.2em 1.2em;
65+
position: relative;
66+
word-wrap: break-word;
67+
}
68+
#comments .commentlist > li.pingback {
69+
margin: 0 0 1em 53px;
70+
padding: 0 1.625em;
71+
}
72+
.commentlist .children {
73+
list-style: none;
74+
margin: 0;
75+
}
76+
.commentlist .children li.comment {
77+
background: #fff;
78+
border-left: 1px solid #ddd;
79+
border-radius: 0 3px 3px 0;
80+
margin: 1.625em 0 0;
81+
padding: 1.625em;
82+
position: relative;
83+
}
84+
.commentlist .children li.comment .fn {
85+
display: block;
86+
}
87+
.comment-meta .fn {
88+
font-style: normal;
89+
font-weight: bold;
90+
}
91+
.comment-meta {
92+
color: #666;
93+
font-size: 12px;
94+
line-height: 2.2em;
95+
}
96+
.commentlist .children li.comment .comment-meta {
97+
line-height: 1.625em;
98+
margin-left: 50px;
99+
}
100+
.commentlist .children li.comment .comment-content {
101+
margin: 1.625em 0 0;
102+
word-break: break-all;
103+
word-break: break-word;
104+
-webkit-hyphens: auto;
105+
hyphens: auto;
106+
}
107+
.commentlist .avatar {
108+
border-radius: 3px;
109+
box-shadow: 0 1px 2px #ccc;
110+
left: -82px;
111+
padding: 0;
112+
position: absolute;
113+
top: 0;
114+
}
115+
.commentlist .children .avatar {
116+
background: none;
117+
box-shadow: none;
118+
left: 2.2em;
119+
padding: 0;
120+
top: 2.2em;
121+
}
122+
a.comment-reply-link {
123+
background: #eee;
124+
border-radius: 3px;
125+
color: #666;
126+
display: inline-block;
127+
font-size: 12px;
128+
padding: 0 8px;
129+
text-decoration: none;
130+
}
131+
a.comment-reply-link:hover,
132+
a.comment-reply-link:focus,
133+
a.comment-reply-link:active {
134+
background: #888;
135+
color: #fff;
136+
}
137+
a.comment-reply-link > span {
138+
display: inline-block;
139+
position: relative;
140+
top: -1px;
141+
}
142+
143+
/* Post author highlighting */
144+
.commentlist > li.bypostauthor {
145+
background: #ddd;
146+
border-color: #d3d3d3;
147+
}
148+
.commentlist > li.bypostauthor .comment-meta {
149+
color: #575757;
150+
}
151+
152+
/* Post Author threaded comments */
153+
.commentlist .children > li.bypostauthor {
154+
background: #ddd;
155+
border-color: #d3d3d3;
156+
}
157+
158+
/* sidebar-page.php comments */
159+
/* Make sure we have room for our comment avatars */
160+
.page-template-sidebar-page-php .commentlist > li.comment,
161+
.page-template-sidebar-page-php.commentlist .pingback {
162+
margin-left: 102px;
163+
width: auto;
164+
}
165+
/* And a full-width comment form */
166+
.page-template-sidebar-page-php #respond {
167+
width: auto;
168+
}
169+
170+
/* Comment Form */
171+
#respond {
172+
background: #ddd;
173+
border: 1px solid #d3d3d3;
174+
border-radius: 3px;
175+
margin: 0 auto 1.625em;
176+
padding: 1.625em;
177+
position: relative;
178+
}
179+
#respond input[type="text"],
180+
#respond textarea {
181+
background: #fff;
182+
border: 4px solid #eee;
183+
border-radius: 5px;
184+
box-shadow: inset 0 1px 3px rgba(204,204,204,0.95);
185+
position: relative;
186+
padding: 10px;
187+
}
188+
#respond .comment-form-author,
189+
#respond .comment-form-email,
190+
#respond .comment-form-url,
191+
#respond .comment-form-comment {
192+
position: relative;
193+
}
194+
#respond .comment-form-comment label {
195+
display: block;
196+
}
197+
#respond textarea {
198+
resize: vertical;
199+
width: 95%;
200+
}
201+
#respond .comment-form-author .required,
202+
#respond .comment-form-email .required {
203+
color: #bd3500;
204+
font-size: 22px;
205+
font-weight: bold;
206+
left: -13px;
207+
top: 6px;
208+
position: absolute;
209+
z-index: 1;
210+
}
211+
#respond .comment-notes,
212+
#respond .logged-in-as {
213+
font-size: 13px;
214+
}
215+
#respond p {
216+
margin: 10px 0;
217+
}
218+
#respond .form-submit {
219+
float: right;
220+
margin: -20px 0 10px;
221+
}
222+
#respond input#submit {
223+
background: #222;
224+
border: none;
225+
border-radius: 3px;
226+
box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
227+
color: #eee;
228+
cursor: pointer;
229+
font-size: 15px;
230+
margin: 20px 0;
231+
padding: 5px 42px 5px 22px;
232+
position: relative;
233+
left: 20px;
234+
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
235+
}
236+
#respond input#submit:active {
237+
background: #1982d1;
238+
color: #bfddf3;
239+
}
240+
#respond #cancel-comment-reply-link {
241+
color: #666;
242+
margin-left: 10px;
243+
text-decoration: none;
244+
}
245+
#respond .logged-in-as a:hover,
246+
#respond #cancel-comment-reply-link:hover {
247+
text-decoration: underline;
248+
}
249+
.commentlist #respond {
250+
margin: 1.625em 0 0;
251+
width: auto;
252+
}
253+
#reply-title {
254+
color: #373737;
255+
font-size: 24px;
256+
font-weight: bold;
257+
line-height: 30px;
258+
}
259+
#cancel-comment-reply-link {
260+
color: #888;
261+
display: block;
262+
font-size: 10px;
263+
font-weight: normal;
264+
line-height: 2.2em;
265+
letter-spacing: 0.05em;
266+
position: absolute;
267+
right: 1.625em;
268+
text-decoration: none;
269+
text-transform: uppercase;
270+
top: 1.1em;
271+
}
272+
#cancel-comment-reply-link:focus,
273+
#cancel-comment-reply-link:active,
274+
#cancel-comment-reply-link:hover {
275+
color: #ff4b33;
276+
}
277+
#respond label {
278+
line-height: 2.2em;
279+
}
280+
#respond input[type=text] {
281+
display: block;
282+
height: 24px;
283+
width: 75%;
284+
}
285+
#respond p {
286+
font-size: 12px;
287+
}
288+
p.comment-form-comment {
289+
margin: 0;
290+
}
291+
.form-allowed-tags {
292+
display: none;
293+
}

0 commit comments

Comments
 (0)