Semantic Media Wiki Categories for Templates - mediawiki

We are running MediaWiki 1.34.2 with SMW 3.2.0 and want to query (ask) for all templates of a certain Category. The category is shown on the template page and the template is shown on the category page. But when using Special Page Browse wiki, the category is not shown. When printing the response of the query, the list is not complete and no template has a category. We added the required namespaces and tried to rebuild the wiki.
Template:
<noinclude>
[[Category:Test]]
<pre>
{{Device
|Name=
}}
</pre>
</noinclude>
<includeonly>
{| class="wikitable"
! Name
| {{{Name|}}}
|}
[[Category:TestInt]]
</includeonly>
Ask:
{{#ask:
[[Template:+]] | ?Category
}}

To ask for templates in a certain category, you need to ask for the category like
{{#ask:
[[Template:+]][[Category:Some Category Name]]
}}
See also https://www.semantic-mediawiki.org/wiki/Help:Inline_queries

Related

Displaying short description of post under post name using Jekyll

I'm using jekyll with GitHub pages for my blog. How can I display a short sentence right below my post title in the index/ home page? As an example, I am trying to write text between the red brackets:
example image
I've seen other posts on this site that ask a similar question, but they are very old and it seems that jekyll has changed since then. Any help would be appreciated.
If these are posts you should be able to use {{ post.excerpt }}. You can see more in the docs: https://jekyllrb.com/docs/posts/
If it's a page (and not a post) you'll need to use {{ page.content | truncatewords: 30 }}. See more in the docs: https://shopify.github.io/liquid/filters/truncatewords/
A note about page.content: if that page is HTML code you'll need to use the strip_html filter. If that page has liquid, there is no filter to strip that and you will need to add the excerpt to the front matter. Something like this:
---
title: This is a post title
description: This is a post description.
excerpt: This is the post excerpt.
---
{{ page.excerpt }}

In Pelican, how do I display the full latest article/post on the home page?

I'm using Pelican 4.2.0, and I'd like to always display the full text of my latest blog post on the 'home' page, then have other posts listed on a separate 'Articles' page. Is this a setting, a template configuration, or...?
Full-content versus summary display behavior is entirely managed in theme templates. The default notmyidea theme included with Pelican, for example, has an index.html template that shows the most recent full-content article at the top, followed by summaries of previous articles below. The relevant line that displays the full article content contains the following template variable:
{{ article.content }}
… whereas the line that shows article summaries instead uses the following template variable:
{{ article.summary }}

Evaluate format template content in (Semantic-)Mediawiki

I am using semantic mediawiki to store and describe information about scientific papers. In this context I would like to build a citation template that links to the page where the paper is described.
Every Paper has an identifier which is a combination of first author and year with the property like this: [[Has citekey:someauthor2019]]. I use a template to cite this paper as {{Cite | someauthor2019}} and combine the Cite template with a format template to render it as a link to the page with the name of the citekey.
The problem is that when I do it with the templates below, it will actually display the wikitext:
[[Name of the page | someauthor2019 ]]
instead of evaluating it to appear as the named link:
someauthor2019
This is the semantic-mediawiki ask query to get the paper information:
Template:Cite
{{#ask: [[Has citekey::{{{1}}}]]
|?Has citekey
|format=template
|template=Cite Text
}}
This is the format template to deal with the results of the query:
Template:Cite_Text
[[{{{1}}} | {{{2}}}]]
How can I get the avaluated result of a named link to be displayed instead of the wikitext?
Thank you in advance for any help!
Try to use
|link=none
this will pass {{{1}}} result as raw text to your template
You request becomes :
{{#ask: [[Has citekey::{{{1}}}]]
|?Has citekey
|format=template
|template=Cite Text
|link=none
}}
Source :
https://www.semantic-mediawiki.org/wiki/Help:Inline_queries#Standard_parameters_for_inline_queries

Can I have separate category slug and title for a Jekyll blog?

I am building a Jekyll website where I will have categorized pages. A page might have a category called "Introduction to programming" but I want the category slug to be "cse110" so as to keep my URLs short.
Is there any way I can achieve this? Thanks in advance.
Use cse110 as category. That should take care of the URL part.
Now for the title, write a condition that whenever the category is cse110, it should show "Introduction to Programming"
{% if page.categories == 'cse110' %}
<span>Introsuction to Programming</span>
{% endif %}
Something like that should work.
You can use the permlink in the frontmatter to manipulate the output directory. Your category page will look something like this:
---
title: Introduction to programming
permalink: /cse110/
---

Categories in Jekyll

Question 1: I'm trying to create two distinct sections on my blog using Jekyll, similarly to how categories work in Wordpress. I'd like to have my main blog with posts, and then have a separate page for my portfolio/photography.
So far, I've got the basic page structure on my site, but I don't know how to work the logic out using Jekyll.
Question 2: As you can see on my photos page, I have it set up to where there are thumbnails created. I'd like to populate those thumbnails with photos from each new portfolio post (similar to featured images, in Wordpress), based on a link in the front-matter of each portfolio post. Or is there a better way to do that?
If I'm not making sense, I'm kind of picturing something like this as far as the front matter goes:
---
title: My Title
layout: photo
thumbnailurl: /images/photo2.jpg
---
Answer one
The basic way to sort post depending of the category is :
{% assign blogPosts = site.posts | where:'category', 'blog' %}
{% assign photoPosts = site.posts | where:'category', 'photo' %}
The drawback here is that you will have blog or photo categories in the post's categories, which is not necessarily useful when you want to expose categories for a post.
Instead, you can just put a front matter variable like group: post or group: photo.
You are then able to sort posts like this :
{% assign blogPosts = site.posts | where: 'group', 'blog' %}
{% for item in blogPosts %}
<p>{{item.title}}</p>
{%endfor%}
It's up to you.
Answer two
Yes the way you do it the right one. Thumbnail url in the front matter.