jekyll github page multiple post type connection - github

Recently building my github page with Jekyll.
I wanted to have a few types of post, mainly blog and study note.
I found a way to make the url the way I want them to be, however the connection is way off.
I used 2 methods, first I tried with create subfolder under _post folder
-_post
--blog
---first_post.md
--studynote
---first_note.md
I also tried create _post folder as subfolder:
-blog
--_post
---first_post.md
-studynote
--_post
---first_note.md
but no matter how I put them, they only show up in username.github.io/blog/
however their url is correct.
What should I look into to gain better understanding to Jekyll's syntax? Ruby?

Instead of putting your posts in subfolders, use categories. From the jekyll docs:
Instead of placing posts inside of folders, you can specify one or more categories that the post belongs to. When the site is generated the post will act as though it had been set with these categories normally. Categories (plural key) can be specified as a YAML list or a space-separated string.
This way, you can write a post in the _posts folder, set its category to either blog or studynote (or whatever you want it to be) and then that post will show up at username.github.io/category/post-permalink.
Also make sure that baseurl in your config file isn't set to /blog, because then everything on your site will appear under /blog. Hopefully this helps!

Related

Raw urls on GitHub keep changing

I need a Markdown file to be able to refer to diagrams in my repository and for the links to remain valid as the diagrams are updated. I am finding that the url I get when I right-click the Raw button and copy the link varies between these two forms:
https://github.com/user/repo/raw/branch/folder/file.png
https://raw.github.com/user/repo/branch/folder/file.png
Note the change in the position of "raw".
Could anyone explain, please, what is happening?
One of these URLs is a redirect to the other, or they're both in a redirect chain to a third link. It's possible your browser has prefetched one and knows the destination already in some cases, and not in others.
I'd take either one to a command-line prompt and give it to curl -Lv and see where the final one ends up. Alternately, you can use the API to query for the raw link for this object, and whatever it gives you should be correct.
I will tell you that the latter domain name is probably not correct; I would suspect that the right URL is at the domain raw.githubusercontent.com, but I'd ask the API to be sure.

internal links in Lektor's markdown blocks

I want to build a website, maybe similar to a movie database, where every page has, say, actors, director, year (it seems that Lektor can deal very well with such structured metadata), and I am thinking about how to realize internal links between pages on that site.
Say I have a text such as
just like in [his previous movie](link), he shows again ...
then I guess I could use the absolute path of the linked page as link target, but that makes me very inflexible with respect to changing URL structure. Can I somehow just use the ID of the target content?
Or, better yet, can I somehow automatically obtain the title of the linked page?
just like in his previous movie <<link:title>>, he shows again ...
Can I use the standard Markdown blocks for that or would I have to add some handcrafted database lookup logic?
if some contents will be changed in future. I think you can use the databag feature to implement it. you just modify the databg in case changed is need.

DokuWiki: Automatic keyword detection and linking to existing pages

I have a portable DokuWiki set up on my computer. Release 2014-09-29d "Hrun".
I have range of pages already created on multiple topics. I wanted to know whether it is possible for the Wiki/Plugin to automatically detect keywords and link them to existing pages.
For example: If I have a page name "cat" then if I mention "cat" anywhere on a new page I would like it to link the keyword to that page. Is this possible?
I have tried to use AutoLink3 however I was unsuccessful as it doesn't seem to work as described.
Maybe CamelCase links is what you are looking for.

Does a what-links-here report for Gollum exist?

Is there any existing way to generate a what-links-here report for a gollum wiki? In other words, a list of the pages within the same wiki that link to the current page: a list of the local inbound links.
I wasn't able to spot any feature like this, nor find anything suitable in the API, but I may have missed it. Is there a third party add-on for it?
I do understand the reason it probably doesn't exist in the core: as these are plain text files, there isn't any table of links maintained anywhere. For the same reason, when a page is renamed it breaks all the inbound links to that page from other pages.
A function for this could use the API to read the generated source of each page (so that only html with normalized names needs to be parsed), producing a list of the local links from each page and the page they are on. Cache the results at page level until the next commit of that page.
This could be used to enhance the existing page rename feature as well. Has anybody already done this?

modx replacing article link with a link of categories

I've got a staging and live site I'm working on (not my code base). I've accidentally replaced the live server with some staging code (no backup (slap me)) and I'm getting weird urls for articles on the sites 'blog' page.
Basically everything's being called into the page correctly but the page header link is being screwed.
Rather than being
http://www.example.com/a-nice-url
it's giving me
http://www.example.com/news,recent,pr,etc
which appears to be the list of categories of the article.
Where/How can I easily fix this?
I'm only calling [[*content]] and can't find where that is.
Linking to an article I know is there with the correct url works still.
any ideas would be greatly appreciated.
I assume your blog page has some sort of listing somewhere, maybe a getResources call? If you can't find it in your blog list template (as you're saying you only see a *content), it means the list is probably "hardcoded" in the blog list resource content field.
You'll want to find the chunks being used to output each blog entry on the lists and check which page parameter is used to construct the link. It should probably be *alias, and if it is and your aliases are correct you have some deeper trouble going on.