Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixed blog order#147

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ikoevska wants to merge14 commits intonativescript-vue:v2
base:v2
Choose a base branch
Loading
fromikoevska:fix-blog-order

Conversation

ikoevska
Copy link
Contributor

@ikoevskaikoevska commentedMay 27, 2018
edited
Loading

What I did:

  • ordered the collection by the custom 'order'
  • extended the functionality of the custom order plugin to capture the date properly, not only the first number sequence in the file name
  • extended the functionality of the custom order plugin to the blog folder as well

Attempts to solve:#55

@nativescript-vue-bot
Copy link

nativescript-vue-bot commentedMay 27, 2018
edited
Loading

Deploy preview fornativescript-vue ready!

Built with commit9f5386a

https://deploy-preview-147--nativescript-vue.netlify.com

@ikoevskaikoevska changed the titleChanged regex that captures dateFixed blog orderMay 27, 2018
@ikoevska
Copy link
ContributorAuthor

@rigor789 Can you take a look?

@rigor789
Copy link
Member

@ikoevska just checked but I'm not sure if this solves the problem (which seems to only happen sometimes), from a quick test

constt="2018-02-12-nativescript-vue-1.0-and-a-new-site.md"consta=t.match(/^(\d+)-/)constb=t.match(/^((\d+)-)+/)console.log(a[1])// 2018console.log(b[1])// 12-

I don't think the order will be accurate when it's set to12-

Maybe we could convert the date to a timestamp, which can then be sorted/ordered

@ikoevska
Copy link
ContributorAuthor

Weird. I'll get back to the drawing board :D

rigor789 reacted with hooray emoji

@ikoevska
Copy link
ContributorAuthor

Hey@rigor789 second attempt :) This time it seems like it would work.

Turned out res[0] is what got the right match that we needed. I am stripping the hyphens from it and passing it along.

const t = "2018-02-12-nativescript-vue-1.0-and-a-new-site.md"const a = t.match(/^(\d+)-/)const b = t.match(/^((\d+)-)+/)console.log(a[0].replace(/-/g, '')) //2018console.log(b[0].replace(/-/g, '')) //20180212
const y = "03-some-ordered-file-name.md"const c = y.match(/^(\d+)-/)const d = y.match(/^((\d+)-)+/)console.log(c[0].replace(/-/g, '')) //03console.log(d[0].replace(/-/g, '')) //03

Use non-capturing groups because we don't need to manipulate the groups separately
@rigor789
Copy link
Member

This looks good - and I think it should be working, but for some reason the order is still wrong in the build :/

https://deploy-preview-147--nativescript-vue.netlify.com/blog/using-fonticons/ (April 07)
is before
https://deploy-preview-147--nativescript-vue.netlify.com/blog/using-parse-in-nativescript-vue/ (February 28)

I can dig a little deeper next week, don't waste any more time on this - could be a bug inmetalsmith-collections!

@ikoevska
Copy link
ContributorAuthor

Oh, well, I'm still interested in making this one work but I'll be abandoning it for now.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ikoevska@nativescript-vue-bot@rigor789

[8]ページ先頭

©2009-2025 Movatter.jp