Thanks to visit codestin.com
Credit goes to github.com

Skip to content

search for posts in sub-directories#12

Merged
tesar-tech merged 7 commits into
BlazorStatic:masterfrom
junovell:feature/search-subdirs
May 30, 2024
Merged

search for posts in sub-directories#12
tesar-tech merged 7 commits into
BlazorStatic:masterfrom
junovell:feature/search-subdirs

Conversation

@junovell

Copy link
Copy Markdown
Contributor

Just makes the program look for posts in sub-directories created under the content path which is how jekyll works.

This will help with organizing posts visually.

example (this doesn't wok on master):

Content/blog/
   - graphics/
       - how-to-do-physics-based-rendering.md
   - web/
       - starting-with-blazorstatic.md
   - linux/
       - setting-up-arch.md

One more thing that can be changed is the value of FileNameNoExtension, instead of just the file's name it can also contain it's relative path to the content folder (eg. linux/setting-up-arch instead of just setting-up-arch).
Or the user can choose to add a field to their FrontMatter class to differentiate between posts.

@netlify

netlify Bot commented May 29, 2024

Copy link
Copy Markdown

Deploy Preview for blazorstatic ready!

Name Link
🔨 Latest commit 5398e90
🔍 Latest deploy log https://app.netlify.com/sites/blazorstatic/deploys/6658d2be68cf450008d9c7d1
😎 Deploy Preview https://deploy-preview-12--blazorstatic.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

…ubfolder/post-in-subfolder` will result in filename `blog/subfolder/post-in-subfolder`)
…ll correspond to url and original structure.
@tesar-tech

Copy link
Copy Markdown
Collaborator

Nice, thanks for the addition.

  • I made the FileNameNoExtension into relative path of file with no extension to content path by function. Now the posts are located in respective folders (/blog/subfolder/post-in-subfolder has its origin in Content/Blob/subfolder/post-in-subfolder.md)
  • I changed the BlogPage to accept multiple segments in parameter (using wildcard).
  • Test post is there.

Does that suit your needs now?

How should we name the FileNameNoExtension, it is basically url for the future post...

@junovell

junovell commented May 29, 2024

Copy link
Copy Markdown
Contributor Author

I think it can be renamed to just name, path or url (like jekyll).

Also will this work with the media folder? i didn't use any media in my project so far so i didn't test if i can have subddirs there or not.

@tesar-tech

tesar-tech commented May 30, 2024

Copy link
Copy Markdown
Collaborator

Url it is.

The media folder works, it just copies the whole folder.

Do you wish to add yourself as a co-author to the blog/subfolder/post-in-subfolder post?

@junovell

Copy link
Copy Markdown
Contributor Author

no that's fine, thanks for the help with this.

@tesar-tech tesar-tech merged commit c83d3ef into BlazorStatic:master May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants