Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to the Power Users community on Codidact!

Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.

With Datenstrom Yellow SSG, how do I generate lists of tags and recent posts for my blog?

+4
−0

I would like to use a static site generator to create a personal blog. I'm new to SSGs (but not to blogs). Following some initial research and recommendations, I chose Datenstrom Yellow for its apparent simplicity (Markdown source and an easy "build" step to generate HTML, which I can then upload to my server when ready). I'm stuck at page layout.

I'm using the blog extension and can run the example just fine. The documentation on that page shows example Markdown for (a) a list of latest posts and (b) a list of tags. What I can't figure out from the documentation, or experimentation, is where to insert that Markdown to produce the desired effects.

From their readme:

Showing list of tags:

[blogtags /blog/]
[blogtags /blog/ 3]
[blogtags /blog/ 10]

Showing list of pages:

[blogpages /blog/]
[blogpages /blog/ 10 Datenstrom]
[blogpages /blog/ 10 - example]

There is also a layouts directory, which contains a likely target, blogpages.html, which the description says is the layout for the main page. Two problems: first, that's HTML not Markdown, and second, it's actually full of PHP (which is Greek to me).

What do I edit to cause the lists of tags and recent posts to show up on the blog page? A search took me to this example site, built with this tool, that has these lists (in the right column), but I can't find source to look at. That site looks to be the work of a beginner who's a little ahead of me on the learning curve; it's not a production site.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+1
−0

The answer turns out to be to add a sidebar, which is a separate element. First, you have to use the Berlin theme, not the default. This theme adds a line to system/layouts/default.html:

<div class="<?php echo "content".($this->yellow->page->isPage("sidebar") ? " with-sidebar" : "") ?>">

For some reason the blog templates don't get updated when you switch to this theme, so edit that line into blog.html and blogpages.html.

Next, you need to create the actual sidebar page. In the shared content folder, add sidebar.md as in the following example:

---
Title: Sidebar
Status: shared
BlogLocation: /blog/
BlogNewLocation: /blog/@year/@month
---

Tags

[blogtags /blog/ 10]

Archive

[blogarchive /blog/ 50]

In blogtags and blogarchive, the last argument is the number of entries to show. I haven't yet figured out how to show all tags, or all archive months, on one page.

These changes add the sidebar to all pages on the web site. Mine is, first and foremost, a blog, but if you have other types of content in their own sections, you might not want your blog archives to show up in, say, your portfolio. I suspect that deleting that line from default.html, so only the blog templates have it, would accomplish that, but I haven't tried it.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »