congo/docs/homepage-layout/index.html

124 lines
7.6 KiB
HTML

<!doctype html><html lang=en-au><head>
<meta charset=utf-8>
<meta http-equiv=content-language content="en-AU">
<meta name=viewport content="width=device-width,initial-scale=1">
<meta http-equiv=x-ua-compatible content="ie=edge">
<title>Homepage Layout &#183; Congo</title>
<meta name=title content="Homepage Layout &#183; Congo">
<meta name=description content="Configuring the homepage layout in the Congo theme.">
<link rel=canonical href=https://jpanther.github.io/Congo/docs/homepage-layout/>
<link type=text/css rel=stylesheet href=https://jpanther.github.io/Congo/css/main.css>
<link rel=apple-touch-icon sizes=180x180 href=https://jpanther.github.io/apple-touch-icon.png>
<link rel=icon type=image/png sizes=32x32 href=https://jpanther.github.io/favicon-32x32.png>
<link rel=icon type=image/png sizes=16x16 href=https://jpanther.github.io/favicon-16x16.png>
<link rel=manifest href=https://jpanther.github.io/site.webmanifest>
<meta property="og:title" content="Homepage Layout">
<meta property="og:description" content="Configuring the homepage layout in the Congo theme.">
<meta property="og:type" content="article">
<meta property="og:url" content="https://jpanther.github.io/Congo/docs/homepage-layout/"><meta property="article:section" content="docs">
<meta property="article:published_time" content="2020-08-13T00:00:00+00:00">
<meta property="article:modified_time" content="2020-08-13T00:00:00+00:00">
<meta name=twitter:card content="summary">
<meta name=twitter:title content="Homepage Layout">
<meta name=twitter:description content="Configuring the homepage layout in the Congo theme.">
<meta itemprop=name content="Homepage Layout">
<meta itemprop=description content="Configuring the homepage layout in the Congo theme."><meta itemprop=datePublished content="2020-08-13T00:00:00+00:00">
<meta itemprop=dateModified content="2020-08-13T00:00:00+00:00">
<meta itemprop=wordCount content="422">
<meta itemprop=keywords content="homepage,layouts,docs,">
<meta name=generator content="Hugo 0.87.0">
<meta name=author content="Congo">
<link href=https://twitter.com/ rel=me>
<link href=https://facebook.com/ rel=me>
<link href=https://linkedin.com/ rel=me>
<link href=https://youtube.com/ rel=me>
</head>
<body class="flex flex-col h-screen px-6 m-auto text-lg leading-7 bg-white text-grey-900 sm:px-14 md:px-24 lg:px-32 dark:bg-gray-800 dark:text-white max-w-7xl"><header class="flex justify-between py-6 font-semibold sm:py-10">
<div>
<a class=hover:underline rel=me href=https://jpanther.github.io/Congo/>Congo</a>
</div>
<nav>
<ul class="flex flex-col list-none sm:flex-row">
<li class="text-right sm:mr-7 sm:last:mr-0">
<a class=hover:underline href=/Congo/docs/ title=Documentation>Docs</a>
</li>
<li class="text-right sm:mr-7 sm:last:mr-0">
<a class=hover:underline href=/Congo/samples/ title="Content Samples">Samples</a>
</li>
<li class="text-right sm:mr-7 sm:last:mr-0">
<a class=hover:underline href=https://github.com/jpanther/Congo title>GitHub</a>
</li>
</ul>
</nav>
</header>
<main class=flex-grow>
<article class=max-w-prose>
<header>
<h1 class="mt-0 text-4xl font-extrabold">Homepage Layout</h1>
<div class="mt-8 mb-12 text-base text-gray-400 dark:text-gray-500">
<span title="Reading time">
2
mins
</span>
</div>
</header>
<section class="prose dark:prose-light">
<p>Congo provides a fully flexible homepage layout. There are two main templates to choose from with additional settings to adjust the design. Alternatively, you can also provide your own template and have complete control over the homepage content.</p>
<p>The layout of the homepage is controlled by the <code>homepage.layout</code> setting in the <code>params.toml</code> configuration file. Additionally, all layouts have the option to include a listing of recent articles.</p>
<h2 id=page-layout>Page layout <a class=heading-anchor href=#page-layout aria-label=Anchor>#</a></h2>
<p>The default layout is the page layout. It&rsquo;s simply a normal content page that displays your Markdown content. It&rsquo;s great for static websites and provides a lot of flexibility.</p>
<p><img src=home-page.jpg alt="Profile layout"></p>
<p>To enable the page layout, set <code>homepage.layout = "page"</code> in the <code>params.toml</code> configuration file.</p>
<h2 id=profile-layout>Profile layout <a class=heading-anchor href=#profile-layout aria-label=Anchor>#</a></h2>
<p>The profile layout is great for personal websites and blogs. It puts the author&rsquo;s details front and centre by providing an image and links to social profiles.</p>
<p>The author information is provided in the <code>author.toml</code> configuration file. Additionally, any Markdown content that is provided in the homepage content will be placed below the author profile. This allows extra flexibility for displaying a bio or other custom content using shortcodes.</p>
<p><img src=home-profile.jpg alt="Profile layout"></p>
<p>To enable the profile layout, set <code>homepage.layout = "profile"</code> in the <code>params.toml</code> configuration file.</p>
<h2 id=custom-layout>Custom layout <a class=heading-anchor href=#custom-layout aria-label=Anchor>#</a></h2>
<p>If the built-in homepage layouts aren&rsquo;t sufficient for your needs, you have the option to provide your own custom layout. This allows you to have total control over the page content and essentially gives you a blank slate to work with.</p>
<p>To enable the custom layout, set <code>homepage.layout = "custom"</code> in the <code>params.toml</code> configuration file.</p>
<p>With the configuration value set, create a new <code>custom.html</code> file and place it in <code>layouts/partials/home/custom.html</code>. Now whatever is in the <code>custom.html</code> file will be placed in the content area of the site homepage. You can use whatever HTML, Tailwind, or Hugo templating functions to define your layout.</p>
<h2 id=recent-articles>Recent articles <a class=heading-anchor href=#recent-articles aria-label=Anchor>#</a></h2>
<p>All homepage layouts have the option of displaying recent articles below the main page content. To enable this, simply set the <code>homepage.showList</code> setting to <code>true</code> in the <code>params.toml</code> configuration file.</p>
<p><img src=home-profile-list.jpg alt="Profile layout with recent articles"></p>
<p>The articles listed in this section are derived from the <code>homepage.listSections</code> setting which allows for whatever content types you are using on your website. For instance, if you had content sections for <em>posts</em> and <em>projects</em> you could set this setting to <code>["posts", "projects"]</code> and all the articles in these two sections would be used to populate the recent list. The theme expects this setting to be an array so if you only use one section for all your content, you should set this accordingly: <code>["blog"]</code>.</p>
</section>
<footer class=pt-8>
<div class=pt-8>
<hr class="border-gray-300 border-dotted dark:border-gray-600">
<div class="flex justify-between pt-3">
<span>
<a class=flex href=https://jpanther.github.io/Congo/docs/configuration/>
<span class=mr-3>&larr;</span>
<span class="flex flex-col">
<span class=button__text>Configuration</span>
</span>
</a>
</span>
<span>
<a class="flex text-right" href=https://jpanther.github.io/Congo/docs/front-matter/>
<span class="flex flex-col">
<span>Front Matter</span>
</span>
<span class=ml-3>&rarr;</span>
</a>
</span>
</div>
</div>
</footer>
</article>
</main><footer class="py-10 text-sm">
<p class="text-gray-400 dark:text-gray-500">
&copy;
2021
Congo
</p>
<p class="text-xs text-gray-300 dark:text-gray-600">
Powered by
<a class=hover:underline href=https://gohugo.io/ target=_blank>Hugo</a>
&
<a class=hover:underline href=https://git.io/hugo-congo target=_blank>Congo</a>
</p>
</footer>
</body>
</html>