Skip to content

fixes learn #43, add feedback link to github page for content #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

johnkpaul
Copy link
Contributor

I've added a function in themes/jquery/functions.jquery.php that will convert the current URL into the URL of the markdown page of github. I've also added it to the theme for learn.jquery.com.

@jzaefferer
Copy link
Member

Just checked this out, getting Parse error: parse error in /Users/jza/dev/wordpress-3.4/web-base-template/themes/jquery/functions.jquery.php on line 101

@johnkpaul
Copy link
Contributor Author

Arg. What version of PHP is this intended to support? Sorry @jzaefferer, I accidentally used some 5.4 syntax.

@jzaefferer
Copy link
Member

I'm on 5.3, I don't know what the minimum is we support.

@jzaefferer
Copy link
Member

Okay, but we'd still have to add it to each page template where we want it, as you only added it to the learn site, right?

@johnkpaul
Copy link
Contributor Author

Yes, I added the function to the base template and it can be used anywhere. I only used it from the learn site and added the styling there.

@jzaefferer
Copy link
Member

Could you add it to the qunitjs.com site as well, as a reference for the rest?

@jzaefferer
Copy link
Member

See also #49

@johnkpaul
Copy link
Contributor Author

@jzaefferer You should now see the suggestions link everywhere that uses the base page.php.

@jzaefferer
Copy link
Member

That works, nice! Can we make it a little more subtle? See http://bassistance.de/i/71700c.png

@johnkpaul
Copy link
Contributor Author

Sure, I just took the styling directly from the learn site. Is that screenshot how you want it to look?

@jzaefferer
Copy link
Member

No, that's what it would look like after landing your changes. I'd like it to be more subtle: Smaller or no header, smaller button. Maybe center it? Probably a good idea to find a designer like @jonlongnecker instead of asking me.

@ajpiano
Copy link
Member

ajpiano commented Oct 15, 2012

Yeah, this is from the latest comp for the learn site that I have from @jonlongnecker but there might be something subsequent

@jzaefferer
Copy link
Member

Well, it makes more sense on the learn site, as that has long articles with a different layout. It looks bad on the QUnit site.

@johnkpaul
Copy link
Contributor Author

I just got qunitjs.com setup in my local environment and I see what you mean @jzaefferer. Additionally though, there is a problem with my implementation. I assumed that all of the sites used markdown to create the content pages, but that is not the case. Since it is not standardized, my function cannot be used as generically as I thought.

@scottgonzalez
Copy link
Member

Not only do some sites not use markdown, there's no required directory structure for the raw content.

@johnkpaul
Copy link
Contributor Author

In that case, I don't think there is a possibility of generalizing this. For learn, I can make assumptions about the github path based on the URL, but I can't make those assumptions everywhere else.

@scottgonzalez
Copy link
Member

We could potentially do this with a custom field in WordPres set to the path of the source file during build time.

@jzaefferer
Copy link
Member

Let's sit together tomorrow and work through that. This thread is already long enough.

@jzaefferer
Copy link
Member

Add this:

post.customFields = post.customFields || [];
post.customFields.push({
    key: "source_path",
    value: fileName
});

to the build-pages task in grunt-jquery-content, before writing targetFileName.

See also http://codex.wordpress.org/XML-RPC_WordPress_API/Posts#wp.newPost

To retrieve that within a WordPress theme template: get_post_meta( $post->ID, "source_path" )

@johnkpaul
Copy link
Contributor Author

This should only be merged after a new version of grunt jquery wordpress is released that includes this PR jquery/grunt-jquery-content#15

@jzaefferer
Copy link
Member

Landed in c0eb873 - fixed the PHP 5.3 incompability. Requires a new grunt-jquery-content (0.5.5.)

@jzaefferer jzaefferer closed this Oct 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants