<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nikola (Posts by Daniel Aleksandersen)</title><link>https://getnikola.com/</link><description></description><atom:link href="https://getnikola.com/authors/daniel-aleksandersen.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sat, 02 Dec 2023 09:00:46 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>New feature in Nikola: Sections</title><link>https://getnikola.com/blog/new-feature-in-nikola-sections.html</link><dc:creator>Daniel Aleksandersen</dc:creator><description>&lt;p class="lead"&gt;The sections feature has been removed from Nikola v8 and replaced by categories, with some features added. &lt;a href="https://getnikola.com/blog/upgrading-to-nikola-v8.html#sections-were-replaced-by-categories"&gt;Read v8 upgrade guide to find out more&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post is reproduced with permission from the author. See it in &lt;a href="https://www.aeyoun.com/devel/nikola-sections.html"&gt;the original site&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sections are like newspaper sections that let you group related content together in a collection. Every post from a section appear under a common name, folder/address, and optionally use distinct styling. They also have their own landing pages containing an index with all their posts and their own syndication feed. With sections and post collections, you can diversify your Nikola blog by writing on different topics all on the same website. Readers who are only interested in one subsection of the content you publish can subscribe to the feed of the section or sections that interest them the most.&lt;/p&gt; &lt;p&gt;In Nikola, sections are normally built automatically based on the output folders specified in the &lt;code&gt;POSTS&lt;/code&gt; option. Each output folder is a new section. The index pages and feeds for each section will be output in the same directory as the posts. Alternatively, sections can be assigned using a &lt;code&gt;section&lt;/code&gt; property in each post’s metadata. Note that this will not change the output folder or address of a post and thus lose some of the uniformity you get with having posts include their section name as part of their address.&lt;/p&gt; &lt;p&gt;The following configuration example demonstrates how three sections on different topics are created. The first argument is the source path to where the posts are stored, the second argument is the output folder and section name, and the third argument is the template to use for each section. Posts can use the same template, but you may want to customize the template for each section with bigger hero images on your food section and special star rating systems and different HTML markup for your reviews.&lt;/p&gt; &lt;figure class="figfull"&gt;&lt;pre class="code"&gt;&lt;code&gt;POSTS = {
    ('posts/blog/*.md', blog', 'post.tmpl'),
    ('posts/food/*.md', 'food', 'post_recipe.tmpl'),
    ('posts/review/*.md', 'review, 'post_reviews.tmpl'),
}&lt;/code&gt;&lt;/pre&gt; &lt;/figure&gt;&lt;p&gt;Posts cannot be added to multiple sections as this might create duplicate pages with different addresses. Duplicate pages is something you will want to avoid in most cases. If you really want a post to appear in multiple sections, you’re looking for Nikola’s tags or categories functionality.&lt;/p&gt; &lt;p&gt;Some customizations I’ve made to my own templates after reorganizing to use sections:&lt;/p&gt; &lt;ul&gt;
&lt;li&gt;Display the name and color of the section a post belongs to on the front page.&lt;/li&gt; &lt;li&gt;Display a link to syndication feed for each section as well as the everything-feed at the top of each section and post belonging to that section.&lt;/li&gt; &lt;li&gt;Breadcrumb navigations from posts to their sections and from the sections to the front page. Encourages visitors to your site to find more content from the same section.&lt;/li&gt; &lt;/ul&gt;
&lt;p&gt;Additionally, each section and every post in that section will be automatically assigned a color created by shifting the hue of the site’s THEME_COLOR option in the &lt;a href="http://www.husl-colors.org/"&gt;HUSL color space&lt;/a&gt;. This creates a visually similar color that can be used to style the posts and the sections in a uniform way, allowing each section to have a unique style of their own. The color can be called from a theme using &lt;code&gt;post.section_color()&lt;/code&gt; and can be used in an inline styles or a style element. The color manipulation functions can also be accessed directly in &lt;a href="https://getnikola.com/creating-a-theme.html#customizing-themes-to-user-color-preference-and-section-colors"&gt;theme templates&lt;/a&gt;, allowing for shifting hue, saturation, or lightness of a given color. For example, a lighter version of a section’s color can be retrieved using &lt;code&gt;color_hsl_adjust_hex( post.section_color(), adjust_l=0.05 )&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;The options for controlling the behavior of sections are better documented in &lt;samp&gt;conf.py&lt;/samp&gt; and include:&lt;/p&gt; &lt;ul&gt;
&lt;li&gt; &lt;code&gt;POSTS_SECTIONS&lt;/code&gt; for enabling or disabling sections (on by default)&lt;/li&gt; &lt;li&gt; &lt;code&gt;POSTS_SECTION_ARE_INDEXES&lt;/code&gt; for making posts lists instead of indexes&lt;/li&gt; &lt;li&gt; &lt;code&gt;POSTS_SECTION_COLOR&lt;/code&gt; for manually assigning colors to sections rather than auto-generated colors from &lt;code&gt;THEME_COLOR&lt;/code&gt; &lt;/li&gt; &lt;li&gt; &lt;code&gt;POSTS_SECTION_NAME&lt;/code&gt; for naming sections separately from their output folders&lt;/li&gt; &lt;li&gt; &lt;code&gt;POSTS_SECTION_TITLE&lt;/code&gt; for controlling the title of the section indexes&lt;/li&gt; &lt;li&gt; &lt;code&gt;POSTS_SECTION_DESCRIPTION&lt;/code&gt; for giving each section a description&lt;/li&gt; &lt;/ul&gt;
&lt;p&gt;There is currently no way of generating a list of all sections. A site is not expected to need more than three–twelve sections at the most.&lt;/p&gt; &lt;p&gt;&lt;s&gt;Sections will be available in Nikola version 7.7.0 due later this week.&lt;/s&gt;
The sections feature has been removed from Nikola v8 and replaced by categories, with some features added. &lt;a href="https://getnikola.com/blog/upgrading-to-nikola-v8.html#sections-were-replaced-by-categories"&gt;Read v8 upgrade guide to find out more&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Drop by the &lt;a href="https://getnikola.com/contact.html#help-and-support"&gt;Nikola mailing list or chat room&lt;/a&gt;if you’ve built something cool with sections or just need a little help.&lt;/p&gt; &lt;hr&gt;
&lt;section&gt;&lt;h3&gt;What on Earth is “Nikola,” anyway?&lt;/h3&gt; &lt;p&gt;Nikola is a static site generator built in Python. What that means, is that it can turn a collection of text files into a beautiful website using templates and a collection of ready-made themes. This website, even this very page!, was built using Nikola. Learn more at the &lt;a href="https://getnikola.com/"&gt;Nikola website&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I’ve &lt;a href="https://www.aeyoun.com/projects/nikola/index.html"&gt;contributed to the development of Nikola&lt;/a&gt; for the last two years — the new sectioning system only in the last week — and I’m really happy with how Nikola works, the community, and especially how it has helped me build a great website that I’m really proud of.&lt;/p&gt; &lt;/section&gt;</description><guid>https://getnikola.com/blog/new-feature-in-nikola-sections.html</guid><pubDate>Thu, 03 Sep 2015 14:01:57 GMT</pubDate></item><item><title>6333 commits to Nikola (2012-2015), visualized</title><link>https://getnikola.com/blog/6333-commits-to-nikola-visualized.html</link><dc:creator>Daniel Aleksandersen</dc:creator><description>&lt;p&gt;From &lt;a class="reference external" href="https://www.aeyoun.com/"&gt;Daniel Aleksandersen (Aeyoun)&lt;/a&gt;, on the &lt;a class="reference external" href="https://groups.google.com/forum/#!topic/nikola-discuss/KmxGfkg1nV4"&gt;mailing list&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nikola currently has more than 6333 commits (averaging at 5.2 commits per day!) from 121 contributors. That is a lot to wrap one’s mind around! I made is a visualization with gource to see the project activity using all the commits covering the period from the beginning of the project in 2012-03-31 all the way up to 2015-07-29.&lt;/p&gt;
&lt;iframe width="853" height="480" src="https://www.youtube.com/embed/DRaGA0ic8Io?rel=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;p&gt;Expand the description on YouTube to get clickable links to see the first commit from each of the top ten contributors (by commits, as tracked by GitHub).&lt;/p&gt;
&lt;p&gt;Please all keep on making Nikola the best static site generator out there! A personal thank you to everyone who have contributed. You’ve all helped me build a website for myself that I’m really happy with. ^___^&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Throughout the years, there were &lt;a class="reference external" href="https://github.com/getnikola/nikola/graphs/contributors"&gt;112 contributors&lt;/a&gt; to Nikola, with a total
of &lt;a class="reference external" href="https://github.com/getnikola/nikola/releases"&gt;49 releases&lt;/a&gt;. &lt;a class="reference external" href="https://github.com/getnikola/nikola/issues"&gt;1917 issues and PRs&lt;/a&gt; were opened, 1856 of which have
been resolved.&lt;/p&gt;
&lt;p&gt;And now: a blast from the past, the &lt;a class="reference external" href="https://getnikola.com/nikola-1.1/"&gt;Nikola v1.1 demo site&lt;/a&gt; (available since
the &lt;a class="reference external" href="https://getnikola.com/blog/5000-commits.html"&gt;5000 commits&lt;/a&gt; milestone):&lt;/p&gt;
&lt;a href="https://getnikola.com/nikola-1.1/" class="thumbnail"&gt;
    &lt;img src="https://getnikola.com/nikola-1.1/thumbnail.png" alt="Nikola v1.1 Demo Site" title="Nikola v1.1 Demo Site"&gt;
&lt;/a&gt;</description><category>milestone</category><category>nikola</category><category>planet</category><category>programming</category><category>python</category><guid>https://getnikola.com/blog/6333-commits-to-nikola-visualized.html</guid><pubDate>Thu, 30 Jul 2015 11:00:00 GMT</pubDate></item></channel></rss>