diff --git a/README.md b/README.md index f601bd72..27440aed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Congo -Congo is designed to be a simple, lightweight theme for [Hugo](https://gohugo.io). It's built using Tailwind CSS with a clean and minimalist design that prioritises to your content. +Congo is designed to be a powerful, lightweight theme for [Hugo](https://gohugo.io). It's built using Tailwind CSS with a clean and minimalist design that prioritises to your content. 🌏 [Demo site](https://jpanther.github.io/congo/) 📑 [Theme documentation](https://jpanther.github.io/congo/docs/) @@ -11,7 +11,7 @@ Congo is designed to be a simple, lightweight theme for [Hugo](https://gohugo.io ## Features -- Fully responsive layout built with Tailwind CSS v3 +- Fully responsive layout built with Tailwind CSS 3.0 - Multiple colour schemes (or fully customise your own) - Dark mode (forced on/off or auto-switching with user toggle) - Highly customisable configuration @@ -19,20 +19,20 @@ Congo is designed to be a simple, lightweight theme for [Hugo](https://gohugo.io - Flexible with any content types, taxonomies and menus - Multilingual content support inlcuding support for RTL languages - Ability to link to posts on third-party websites +- Client-side site search powered by Fuse.js - Diagrams and visualisations using Mermaid - Charts using Chart.js - Mathematical notation using KaTeX - SVG icons from FontAwesome 5 -- Heading anchors, Buttons, Badges and more +- Automatic image resizing using Hugo Pipes +- Heading anchors, Tables of Contents, Buttons, Badges and more - HTML and Emoji support in articles 🎉 - SEO friendly with links for sharing to social media -- RSS feeds - Fathom Analytics and Google Analytics support -- Favicons support -- Comments support +- RSS feeds, Favicons and comments support - Advanced customisation using simple Tailwind colour definitions and styles -- Fully documented -- Regular updates with fixes and new features +- Optimised for performance and accessibility with perfect Lighthouse scores +- Fully documented with regular updates --- diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index ddb0092f..89159701 100755 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -4,15 +4,17 @@ description: "This is a demo of the Congo theme for Hugo." --- {{< lead >}} -A simple, lightweight theme for Hugo built with Tailwind CSS. +A powerful, lightweight theme for Hugo built with Tailwind CSS. {{< /lead >}} +This is a demo site built entirely using Congo. It also contains a complete set of [theme documentation]({{< ref "docs" >}}). Congo is flexible and is great for both static page-based content (like this demo) or a traditional blog with a feed of recent posts. +
{{< icon "exclamation-triangle" >}} - This is a demo of the page layout. + This is a demo of the page layout.
-This is a demo site built entirely using Congo. It also contains a complete set of [theme documentation]({{< ref "docs" >}}). Congo is flexible and is great for both static page-based content (like this demo) or a traditional blog with a feed of recent posts. - Explore the [sample pages]({{< ref "samples" >}}) to get a feel for what Congo can do. If you like what you see, check out the project on [Github](https://github.com/jpanther/congo) or read the [Installation guide]({{< ref "docs/installation" >}}) to get started. ![A stylised photograph of a purple squid on a pink backdrop.](squid.jpg "Photo by [Jippe Joosten](https://unsplash.com/@jippe_joosten?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/vibrant-purple?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText).") diff --git a/exampleSite/content/docs/version-2/_index.md b/exampleSite/content/docs/version-2/_index.md new file mode 100644 index 00000000..03763c66 --- /dev/null +++ b/exampleSite/content/docs/version-2/_index.md @@ -0,0 +1,92 @@ +--- +title: "What's New in 2.0 ✨" +date: 2022-01-19 +draft: false +description: "Discover what's new in Congo version 2.0." +tags: ["new", "docs"] +--- + +{{< lead >}} +Congo 2.0 is packed with tons of new features and optimisations. +{{< /lead >}} + +The original aim of Congo was to develop a theme that was simple and lightweight. Version 2 takes this one step further and makes the theme even more powerful while still maintaining its lightweight footprint. + +Continue reading below to discover what's new. When you're ready to upgrade, check out the [guide to upgrading]({{< ref "upgrade" >}}). + +## Tailwind CSS 3.0 + +Tailwind CSS is at the heart of Congo and this new release contains the very latest [Tailwind CSS version 3](https://tailwindcss.com/blog/tailwindcss-v3). It brings with it performance optimisations and support for some great new CSS features. + +{{< youtube "TmWIrBPE6Bc" >}} + +Implementing this new version has also removed some Tailwind plugin dependencies from the theme, allowing the overall footprint to remain lightweight. + +## Multilingual support + +A highly requested feature, Congo is now multilingual! If you publish your content in multiple languages, the site will be built with all the translations available. + +
:flag-au: :de: :fr: :es: :brazil: :cn:
+ +Thanks to submissions from the community, Congo has already been translated into [six languages](https://github.com/jpanther/tree/dev/i18n) with more to be added over time. By the way, pull requests for new languages are always welcome! + +## RTL language support + +One of the benefits of the new Tailwind and Multilingual features is the ability to add RTL language support. When enabled, the entire site will reflow content from right-to-left. Every element in the theme has been restyled to ensure it looks great in this mode which aids authors who wish to generate content in RTL languages. + +RTL is controlled on a per-language basis so you can mix and match both RTL and LTR content in your projects and the theme will respond accordingly. + +## Automatic image resizing + +A big change in Congo 2.0 is the addition of automatic image resizing. Using the power of Hugo Pipes, images in Markdown content are now automatically scaled to different output sizes. These are then presented using HTML `srcset` attributes enabling optimised file sizes to be served to your site visitors. + +![](image-resizing.png) + +```html + +My image +``` + +Best of all there's nothing you need to change! Simply insert standard Markdown image syntax and let the theme do the rest. If you want a little more control, the `figure` shortcode has been completely rewritten to provide the same resizing benefits. + +## Performance improvements + +This update packs performance improvements throughout. A key objective for this release was to improve Lighthouse scores and Congo now scores a perfect 100 on all four metrics. + +{{< screenshot src="lighthouse.jpg" >}} + +There's too many individual changes to highlight them here but the results speak for themselves. If you want to dig deeper, you can [view the Lighthouse report](lighthouse.html). Real world performance will vary based upon server configuration. + +## Site search + +Powered by [Fuse.js](https://fusejs.io), site search allows visitors to quickly and easily find your content. All searches are performed client-side meaning there's nothing to configure on the server and queries are performed super fast. Simply enable the feature in your site configuration and you're all set. Oh, and it also supports full keyboard navigation! + +## Tables of contents + +A highly requested feature, Congo now supports tables of contents on article pages. You can see it in action on this page. The contents are fully responsive and will adjust to take advantage of the space available at different screen resolutions. + +Available on a global or per article basis, the table of contents can be fully customised using standard Hugo configuration values, allowing you to adjust the behaviour to suit your project. + +## Accessibility improvements + +From adding ARIA descriptions to more items or simply adjusting the contrast of certain text elements, this release is the most accessible yet. + +Version 2 also introduces "skip to content" and "scroll to top" links that enable quick navigation. There's also keyboard shortcuts for enabling items like search without reaching for the mouse. + +The new image resizing features also provide full control over `alt` and `title` elements enabling an accessible experience for all visitors. + +## A whole lot more + +There's countless other minor changes to explore. From being able to display taxonomies on articles and list pages, to using the new `headline` author parameter to customise your homepage. There's also improved JSON-LD strucured data which further optimises SEO performance. Plus the entire theme has had extra polish to ensure a consistent design language. + +If you're ready to upgrade, read the [upgrading from version 1 guide]({{< ref "upgrade" >}}) to get started. If you're new to Congo, check out the [Installation guide]({{< ref "docs/installation" >}}) to begin a new project. + +--- diff --git a/exampleSite/content/docs/version-2/image-resizing.png b/exampleSite/content/docs/version-2/image-resizing.png new file mode 100644 index 00000000..396f2fae Binary files /dev/null and b/exampleSite/content/docs/version-2/image-resizing.png differ diff --git a/exampleSite/content/docs/version-2/lighthouse.html b/exampleSite/content/docs/version-2/lighthouse.html new file mode 100644 index 00000000..1a72b63c --- /dev/null +++ b/exampleSite/content/docs/version-2/lighthouse.html @@ -0,0 +1,11700 @@ + + + + + Lighthouse Report + + + + + + +
+ + +
+ + + + http://localhost:8008/congo/samples/emoji/ + + +
+
+ + +
+ + +
+
+
+
+
+
+
+ + +
+ + + + +
+
100
+ +
Performance
+
+ + + +
+ + + + +
+
100
+ +
Accessibility
+
+ + + +
+ + + + +
+
100
+ +
Best Practices
+
+ + + +
+ + + + +
+
100
+ +
SEO
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Progressive Web App
+
+
+
+ 0–49 + 50–89 + 90–100 +
+
+
+ +
+
+ +
Metrics
+ + +
+
+ First Contentful Paint +
1.4 s
+
First Contentful Paint marks the time at which the first text or image is painted. Learn more.
+
+
+
+ Speed Index +
1.4 s
+
Speed Index shows how quickly the contents of a page are visibly populated. Learn more.
+
+
+
+ Largest Contentful Paint +
1.5 s
+
Largest Contentful Paint marks the time at which the largest text or image is painted. Learn more
+
+
+
+ Time to Interactive +
1.4 s
+
Time to interactive is the amount of time it takes for the page to become fully interactive. Learn more.
+
+
+
+ Total Blocking Time +
10 ms
+
Sum of all time periods between FCP and Time to Interactive, when task length exceeded 50ms, expressed in milliseconds. Learn more.
+
+
+
+ Cumulative Layout Shift +
0
+
Cumulative Layout Shift measures the movement of visible elements within the viewport. Learn more.
+
+
Values are estimated and may vary. The performance score is calculated directly from these metrics.See calculator.
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Show audits relevant to:
OpportunitiesThese suggestions can help your page load faster. They don't directly affect the Performance score.
+
Opportunity
+
Estimated Savings
+
+
+ +
+
+
+ +
Reduce unused CSS
+
+
+
+
+
+
0.29 s
+
+ + + + +
+
+
+
+
+
Reduce unused rules from stylesheets and defer CSS not used for above-the-fold content to decrease bytes consumed by network activity. Learn more.FCPLCP
+
+ + +
+ +
+
URL
Transfer Size
Potential Savings
39.7 KiB
27.9 KiB
+
+
+ +
+
+
+ +
Reduce unused JavaScript
+
+
+
+
+
+
0.15 s
+
+ + + + +
+
+
+
+
+
Reduce unused JavaScript and defer loading scripts until they are required to decrease bytes consumed by network activity. Learn more.LCP
+
+ + +
+ +
+
URL
Transfer Size
Potential Savings
27.2 KiB
21.4 KiB
+
DiagnosticsMore information about the performance of your application. These numbers don't directly affect the Performance score.
+
+ +
+ + + Avoid chaining critical requests + 1 chain found + +
+ + + + +
+
+
+
The Critical Request Chains below show you what resources are loaded with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load. Learn more.FCPLCP
+
+
+ +
+
+ Maximum critical path latency: 20 ms +
+
+
+
Initial Navigation
+ + + +
+ + + + + +
…samples/emoji
(localhost)
+
+ +
+ + + + + + - 0 ms, 39.71 KiB +
+
+
+
+
+ +
+ + + Keep request counts low and transfer sizes small + 4 requests • 92 KiB + +
+ + + + +
+
+
+
To set budgets for the quantity and size of page resources, add a budget.json file. Learn more.
+
+
Resource Type
Requests
Transfer Size
Total
4
91.7 KiB
Stylesheet
1
39.7 KiB
Script
1
27.2 KiB
Document
1
17.0 KiB
Image
1
7.7 KiB
Media
0
0.0 KiB
Font
0
0.0 KiB
Other
0
0.0 KiB
Third-party
0
0.0 KiB
+
+
+ +
+ + + Largest Contentful Paint element + 1 element found + +
+ + + + +
+
+
+
This is the largest contentful element painted within the viewport. Learn MoreLCP
+
+
Element
Note: The rendering of these glyphs depends on the browser and the platform. To…
<span class="dark:text-neutral-300">
+
+
+ +
+ + + Avoid long main-thread tasks + 2 long tasks found + +
+ + + + +
+
+
+
Lists the longest tasks on the main thread, useful for identifying worst contributors to input delay. Learn moreTBT
+
+ + +
+ +
+
URL
Start Time
Duration
…samples/emoji
(localhost)
785 ms
584 ms
…samples/emoji
(localhost)
1,369 ms
61 ms
+
+
+ +
+ + + Avoid non-composited animations + 18 animated elements found + +
+ + + + +
+
+
+
Animations which are not composited can be janky and increase CLS. Learn moreCLS
+
+
Element
Name
↓Skip to main content
<a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 dark:bg-neutr…" href="#main-content">
Unsupported CSS Property: background-color
background-color
Unsupported CSS Property: color
color
Congo
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:unde…" rel="me" href="/congo/">
Unsupported CSS Property: color
color
Docs
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:unde…" href="/congo/docs/">
Unsupported CSS Property: color
color
Samples
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:unde…" href="/congo/samples/">
Unsupported CSS Property: color
color
Users
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:unde…" href="/congo/users/">
Unsupported CSS Property: color
color
GitHub
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:unde…" href="https://github.com/jpanther/congo">
Unsupported CSS Property: color
color
button
<button id="search-button" class="text-base hover:text-primary-600 dark:hover:text-primary-400">
Unsupported CSS Property: color
color
Content Samples
<a class="hover:underline hover:decoration-neutral-300 dark:underline-neutral-600" href="/congo/samples/">
Unsupported CSS Property: color
color
site configuration
<a href="http://localhost:8008/congo/docs/configuration/#site-configuration">
Unsupported CSS Property: color
color
Unsupported CSS Property: text-decoration-color
text-decoration-color
Emoji cheat sheet
<a href="http://www.emoji-cheat-sheet.com/">
Unsupported CSS Property: color
color
Unsupported CSS Property: text-decoration-color
text-decoration-color
Twitter
<a class="px-1 hover:text-primary-700 dark:hover:text-primary-400" href="https://twitter.com/" target="_blank" aria-label="Twitter" rel="me noopener noreferrer">
Unsupported CSS Property: color
color
Facebook
<a class="px-1 hover:text-primary-700 dark:hover:text-primary-400" href="https://facebook.com/" target="_blank" aria-label="Facebook" rel="me noopener noreferrer">
Unsupported CSS Property: color
color
Linkedin
<a class="px-1 hover:text-primary-700 dark:hover:text-primary-400" href="https://linkedin.com/" target="_blank" aria-label="Linkedin" rel="me noopener noreferrer">
Unsupported CSS Property: color
color
Youtube
<a class="px-1 hover:text-primary-700 dark:hover:text-primary-400" href="https://youtube.com/" target="_blank" aria-label="Youtube" rel="me noopener noreferrer">
Unsupported CSS Property: color
color
← +Diagrams and Flowcharts +6 March 2019
<a class="flex" href="/congo/samples/diagrams-flowcharts/">
Unsupported CSS Property: color
color
button
<button id="close-search-button" class="flex items-center justify-center w-8 h-8 text-neutral-700 dark:text-neutra…">
Unsupported CSS Property: color
color
Hugo
<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500" href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">
Unsupported CSS Property: color
color
Congo
<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500" href="https://git.io/hugo-congo" target="_blank" rel="noopener noreferrer">
Unsupported CSS Property: color
color
+
+ +
+
+ Passed audits + (28) + + +
+
+ + + + + +
+
+
+
+ +
+ + + Eliminate render-blocking resources + Potential savings of 0 ms + +
+ + + + +
+
+
+
Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles. Learn more.FCPLCP
+
+ + +
+ +
+
URL
Transfer Size
Potential Savings
39.7 KiB
480 ms
+
+
+ +
+ + + Properly size images + + +
+ + + + +
+
+
+
Serve images that are appropriately-sized to save cellular data and improve load time. Learn more.
+
+
+
+
+ +
+ + + Defer offscreen images + + +
+ + + + +
+
+
+
Consider lazy-loading offscreen and hidden images after all critical resources have finished loading to lower time to interactive. Learn more.
+
+
+
+
+ +
+ + + Minify CSS + + +
+ + + + +
+
+
+
Minifying CSS files can reduce network payload sizes. Learn more.FCPLCP
+
+
+
+
+ +
+ + + Minify JavaScript + + +
+ + + + +
+
+
+
Minifying JavaScript files can reduce payload sizes and script parse time. Learn more.FCPLCP
+
+
+
+
+ +
+ + + Efficiently encode images + + +
+ + + + +
+
+
+
Optimized images load faster and consume less cellular data. Learn more.
+
+
+
+
+ +
+ + + Serve images in next-gen formats + + +
+ + + + +
+
+
+
Image formats like JPEG 2000, JPEG XR, and WebP often provide better compression than PNG or JPEG, which means faster downloads and less data consumption. Learn more.
+
+
+
+
+ +
+ + + Preconnect to required origins + + +
+ + + + +
+
+
+
Consider adding `preconnect` or `dns-prefetch` resource hints to establish early connections to important third-party origins. Learn more.FCPLCP
+
+
+
+
+ +
+ + + Initial server response time was short + Root document took 0 ms + +
+ + + + +
+
+
+
Keep the server response time for the main document short because all other requests depend on it. Learn more.FCPLCP
+
+ + +
+ +
+
URL
Time Spent
…samples/emoji
(localhost)
0 ms
+
+
+ +
+ + + Avoid multiple page redirects + + +
+ + + + +
+
+
+
Redirects introduce additional delays before the page can be loaded. Learn more.FCPLCP
+
+
+
+
+ +
+ + + Preload key requests + + +
+ + + + +
+
+
+
Consider using `<link rel=preload>` to prioritize fetching resources that are currently requested later in page load. Learn more.FCPLCP
+
+
+
+
+ +
+ + + Use HTTP/2 + + +
+ + + + +
+
+
+
HTTP/2 offers many benefits over HTTP/1.1, including binary headers and multiplexing. Learn more.
+
+
+
+
+ +
+ + + Use video formats for animated content + + +
+ + + + +
+
+
+
Large GIFs are inefficient for delivering animated content. Consider using MPEG4/WebM videos for animations and PNG/WebP for static images instead of GIF to save network bytes. Learn moreLCP
+
+
+
+
+ +
+ + + Remove duplicate modules in JavaScript bundles + + +
+ + + + +
+
+
+
Remove large, duplicate JavaScript modules from bundles to reduce unnecessary bytes consumed by network activity. TBT
+
+
+
+
+ +
+ + + Avoid serving legacy JavaScript to modern browsers + Potential savings of 0 KiB + +
+ + + + +
+
+
+
Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren't necessary for modern browsers. For your bundled JavaScript, adopt a modern script deployment strategy using module/nomodule feature detection to reduce the amount of code shipped to modern browsers, while retaining support for legacy browsers. Learn MoreTBT
+
+ + +
+ +
+
URL
Potential Savings
0.2 KiB
@babel/plugin-transform-classes
+
+
+ +
+ + + Preload Largest Contentful Paint image + + +
+ + + + +
+
+
+
Preload the image used by the LCP element in order to improve your LCP time. Learn more.LCP
+
+
+
+
+ +
+ + + Avoids enormous network payloads + Total size was 92 KiB + +
+ + + + +
+
+
+
Large network payloads cost users real money and are highly correlated with long load times. Learn more.LCP
+
+ + +
+ +
+
URL
Transfer Size
39.7 KiB
27.2 KiB
…samples/emoji
(localhost)
17.0 KiB
7.7 KiB
+
+
+ +
+ + + Avoids an excessive DOM size + 120 elements + +
+ + + + +
+
+
+
A large DOM will increase memory usage, cause longer style calculations, and produce costly layout reflows. Learn more.TBT
+
+
Statistic
Element
Value
Total DOM Elements
120
Maximum DOM Depth
path
<path fill="currentcolor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645.0 138.72-105.583 298.558-2…">
12
Maximum Child Elements
body
<body class="flex flex-col h-screen px-6 m-auto text-lg leading-7 bg-neutral text-neutr…">
5
+
+
+ +
+ + + User Timing marks and measures + + +
+ + + + +
+
+
+
Consider instrumenting your app with the User Timing API to measure your app's real-world performance during key user experiences. Learn more.
+
+
+
+
+ +
+ + + JavaScript execution time + 0.0 s + +
+ + + + +
+
+
+
Consider reducing the time spent parsing, compiling, and executing JS. You may find delivering smaller JS payloads helps with this. Learn more.TBT
+
+ + +
+ +
+
URL
Total CPU Time
Script Evaluation
Script Parse
…samples/emoji
(localhost)
1,411 ms
4 ms
1 ms
+
+
+ +
+ + + Minimizes main-thread work + 1.5 s + +
+ + + + +
+
+
+
Consider reducing the time spent parsing, compiling and executing JS. You may find delivering smaller JS payloads helps with this. Learn moreTBT
+
+
Category
Time Spent
Style & Layout
1,117 ms
Rendering
252 ms
Other
53 ms
Script Evaluation
20 ms
Parse HTML & CSS
8 ms
Script Parsing & Compilation
3 ms
+
+
+ +
+ + + All text remains visible during webfont loads + + +
+ + + + +
+
+
+
Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. Learn more.FCPLCP
+
+
+
+
+ +
+ + + Minimize third-party usage + + +
+ + + + +
+
+
+
Third-party code can significantly impact load performance. Limit the number of redundant third-party providers and try to load third-party code after your page has primarily finished loading. Learn more.TBT
+
+
+
+
+ +
+ + + Lazy load third-party resources with facades + + +
+ + + + +
+
+
+
Some third-party embeds can be lazy loaded. Consider replacing them with a facade until they are required. Learn more.TBT
+
+
+
+
+ +
+ + + Avoid large layout shifts + + +
+ + + + +
+
+
+
These DOM elements contribute most to the CLS of the page.CLS
+
+
+
+
+ +
+ + + Uses passive listeners to improve scrolling performance + + +
+ + + + +
+
+
+
Consider marking your touch and wheel event listeners as `passive` to improve your page's scroll performance. Learn more.
+
+
+
+
+ +
+ + + Avoids document.write() + + +
+ + + + +
+
+
+
For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. Learn more.
+
+
+
+
+ +
+ + + Image elements have explicit width and height + + +
+ + + + +
+
+
+
Set an explicit width and height on image elements to reduce layout shifts and improve CLS. Learn moreCLS
+
+
+
+
+ +
These checks highlight opportunities to improve the accessibility of your web app. Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.
+
+
+ +
+
+ Additional items to manually check + (10) + + + These items address areas which an automated testing tool cannot cover. Learn more in our guide on conducting an accessibility review.
+
+ + + + + +
+
+
+
+ +
+ + + The page has a logical tab order + + +
+ + + + +
+
+
+
Tabbing through the page follows the visual layout. Users cannot focus elements that are offscreen. Learn more.
+
+
+
+
+ +
+ + + Interactive controls are keyboard focusable + + +
+ + + + +
+
+
+
Custom interactive controls are keyboard focusable and display a focus indicator. Learn more.
+
+
+
+
+ +
+ + + Interactive elements indicate their purpose and state + + +
+ + + + +
+
+
+
Interactive elements, such as links and buttons, should indicate their state and be distinguishable from non-interactive elements. Learn more.
+
+
+
+
+ +
+ + + The user's focus is directed to new content added to the page + + +
+ + + + +
+
+
+
If new content, such as a dialog, is added to the page, the user's focus is directed to it. Learn more.
+
+
+
+
+ +
+ + + User focus is not accidentally trapped in a region + + +
+ + + + +
+
+
+
A user can tab into and out of any control or region without accidentally trapping their focus. Learn more.
+
+
+
+
+ +
+ + + Custom controls have associated labels + + +
+ + + + +
+
+
+
Custom interactive controls have associated labels, provided by aria-label or aria-labelledby. Learn more.
+
+
+
+
+ +
+ + + Custom controls have ARIA roles + + +
+ + + + +
+
+
+
Custom interactive controls have appropriate ARIA roles. Learn more.
+
+
+
+
+ +
+ + + Visual order on the page follows DOM order + + +
+ + + + +
+
+
+
DOM order matches the visual order, improving navigation for assistive technology. Learn more.
+
+
+
+
+ +
+ + + Offscreen content is hidden from assistive technology + + +
+ + + + +
+
+
+
Offscreen content is hidden with display: none or aria-hidden=true. Learn more.
+
+
+
+
+ +
+ + + HTML5 landmark elements are used to improve navigation + + +
+ + + + +
+
+
+
Landmark elements (<main>, <nav>, etc.) are used to improve the keyboard navigation of the page for assistive technology. Learn more.
+
+
+
+ +
+
+ Passed audits + (18) + + +
+
+ + + + + +
+
+
+
+ +
+ + + [aria-*] attributes match their roles + + +
+ + + + +
+
+
+
Each ARIA `role` supports a specific subset of `aria-*` attributes. Mismatching these invalidates the `aria-*` attributes. Learn more.
+
+
+
+
+ +
+ + + [aria-hidden="true"] is not present on the document <body> + + +
+ + + + +
+
+
+
Assistive technologies, like screen readers, work inconsistently when `aria-hidden="true"` is set on the document `<body>`. Learn more.
+
+
+
+
+ +
+ + + [aria-hidden="true"] elements do not contain focusable descendents + + +
+ + + + +
+
+
+
Focusable descendents within an `[aria-hidden="true"]` element prevent those interactive elements from being available to users of assistive technologies like screen readers. Learn more.
+
+
+
+
+ +
+ + + [aria-*] attributes have valid values + + +
+ + + + +
+
+
+
Assistive technologies, like screen readers, can't interpret ARIA attributes with invalid values. Learn more.
+
+
+
+
+ +
+ + + [aria-*] attributes are valid and not misspelled + + +
+ + + + +
+
+
+
Assistive technologies, like screen readers, can't interpret ARIA attributes with invalid names. Learn more.
+
+
+
+
+ +
+ + + Buttons have an accessible name + + +
+ + + + +
+
+
+
When a button doesn't have an accessible name, screen readers announce it as "button", making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + The page contains a heading, skip link, or landmark region + + +
+ + + + +
+
+
+
Adding ways to bypass repetitive content lets keyboard users navigate the page more efficiently. Learn more.
+
+
+
+
+ +
+ + + Background and foreground colors have a sufficient contrast ratio + + +
+ + + + +
+
+
+
Low-contrast text is difficult or impossible for many users to read. Learn more.
+
+
+
+
+ +
+ + + Document has a <title> element + + +
+ + + + +
+
+
+
The title gives screen reader users an overview of the page, and search engine users rely on it heavily to determine if a page is relevant to their search. Learn more.
+
+
+
+
+ +
+ + + [id] attributes on active, focusable elements are unique + + +
+ + + + +
+
+
+
All focusable elements must have a unique `id` to ensure that they're visible to assistive technologies. Learn more.
+
+
+
+
+ +
+ + + Heading elements appear in a sequentially-descending order + + +
+ + + + +
+
+
+
Properly ordered headings that do not skip levels convey the semantic structure of the page, making it easier to navigate and understand when using assistive technologies. Learn more.
+
+
+
+
+ +
+ + + <html> element has a [lang] attribute + + +
+ + + + +
+
+
+
If a page doesn't specify a lang attribute, a screen reader assumes that the page is in the default language that the user chose when setting up the screen reader. If the page isn't actually in the default language, then the screen reader might not announce the page's text correctly. Learn more.
+
+
+
+
+ +
+ + + <html> element has a valid value for its [lang] attribute + + +
+ + + + +
+
+
+
Specifying a valid BCP 47 language helps screen readers announce text properly. Learn more.
+
+
+
+
+ +
+ + + Image elements have [alt] attributes + + +
+ + + + +
+
+
+
Informative elements should aim for short, descriptive alternate text. Decorative elements can be ignored with an empty alt attribute. Learn more.
+
+
+
+
+ +
+ + + Lists contain only <li> elements and script supporting elements (<script> and <template>). + + +
+ + + + +
+
+
+
Screen readers have a specific way of announcing lists. Ensuring proper list structure aids screen reader output. Learn more.
+
+
+
+
+ +
+ + + List items (<li>) are contained within <ul> or <ol> parent elements + + +
+ + + + +
+
+
+
Screen readers require list items (`<li>`) to be contained within a parent `<ul>` or `<ol>` to be announced properly. Learn more.
+
+
+
+
+ +
+ + + [user-scalable="no"] is not used in the <meta name="viewport"> element and the [maximum-scale] attribute is not less than 5. + + +
+ + + + +
+
+
+
Disabling zooming is problematic for users with low vision who rely on screen magnification to properly see the contents of a web page. Learn more.
+
+
+
+ +
+
+ Not applicable + (26) + + +
+
+ + + + + +
+
+
+
+ +
+ + + [accesskey] values are unique + + +
+ + + + +
+
+
+
Access keys let users quickly focus a part of the page. For proper navigation, each access key must be unique. Learn more.
+
+
+
+
+ +
+ + + button, link, and menuitem elements have accessible names + + +
+ + + + +
+
+
+
When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + ARIA input fields have accessible names + + +
+ + + + +
+
+
+
When an input field doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + ARIA meter elements have accessible names + + +
+ + + + +
+
+
+
When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + ARIA progressbar elements have accessible names + + +
+ + + + +
+
+
+
When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + [role]s have all required [aria-*] attributes + + +
+ + + + +
+
+
+
Some ARIA roles have required attributes that describe the state of the element to screen readers. Learn more.
+
+
+
+
+ +
+ + + Elements with an ARIA [role] that require children to contain a specific [role] have all required children. + + +
+ + + + +
+
+
+
Some ARIA parent roles must contain specific child roles to perform their intended accessibility functions. Learn more.
+
+
+
+
+ +
+ + + [role]s are contained by their required parent element + + +
+ + + + +
+
+
+
Some ARIA child roles must be contained by specific parent roles to properly perform their intended accessibility functions. Learn more.
+
+
+
+
+ +
+ + + [role] values are valid + + +
+ + + + +
+
+
+
ARIA roles must have valid values in order to perform their intended accessibility functions. Learn more.
+
+
+
+
+ +
+ + + ARIA toggle fields have accessible names + + +
+ + + + +
+
+
+
When a toggle field doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + ARIA tooltip elements have accessible names + + +
+ + + + +
+
+
+
When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + ARIA treeitem elements have accessible names + + +
+ + + + +
+
+
+
When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more.
+
+
+
+
+ +
+ + + <dl>'s contain only properly-ordered <dt> and <dd> groups, <script>, <template> or <div> elements. + + +
+ + + + +
+
+
+
When definition lists are not properly marked up, screen readers may produce confusing or inaccurate output. Learn more.
+
+
+
+
+ +
+ + + Definition list items are wrapped in <dl> elements + + +
+ + + + +
+
+
+
Definition list items (`<dt>` and `<dd>`) must be wrapped in a parent `<dl>` element to ensure that screen readers can properly announce them. Learn more.
+
+
+
+
+ +
+ + + ARIA IDs are unique + + +
+ + + + +
+
+
+
The value of an ARIA ID must be unique to prevent other instances from being overlooked by assistive technologies. Learn more.
+
+
+
+
+ +
+ + + No form fields have multiple labels + + +
+ + + + +
+
+
+
Form fields with multiple labels can be confusingly announced by assistive technologies like screen readers which use either the first, the last, or all of the labels. Learn more.
+
+
+
+
+ +
+ + + <frame> or <iframe> elements have a title + + +
+ + + + +
+
+
+
Screen reader users rely on frame titles to describe the contents of frames. Learn more.
+
+
+
+
+ +
+ + + <input type="image"> elements have [alt] text + + +
+ + + + +
+
+
+
When an image is being used as an `<input>` button, providing alternative text can help screen reader users understand the purpose of the button. Learn more.
+
+
+
+
+ +
+ + + Form elements have associated labels + + +
+ + + + +
+
+
+
Labels ensure that form controls are announced properly by assistive technologies, like screen readers. Learn more.
+
+
+
+
+ +
+ + + The document does not use <meta http-equiv="refresh"> + + +
+ + + + +
+
+
+
Users do not expect a page to refresh automatically, and doing so will move focus back to the top of the page. This may create a frustrating or confusing experience. Learn more.
+
+
+
+
+ +
+ + + <object> elements have [alt] text + + +
+ + + + +
+
+
+
Screen readers cannot translate non-text content. Adding alt text to `<object>` elements helps screen readers convey meaning to users. Learn more.
+
+
+
+
+ +
+ + + No element has a [tabindex] value greater than 0 + + +
+ + + + +
+
+
+
A value greater than 0 implies an explicit navigation ordering. Although technically valid, this often creates frustrating experiences for users who rely on assistive technologies. Learn more.
+
+
+
+
+ +
+ + + Cells in a <table> element that use the [headers] attribute refer to table cells within the same table. + + +
+ + + + +
+
+
+
Screen readers have features to make navigating tables easier. Ensuring `<td>` cells using the `[headers]` attribute only refer to other cells in the same table may improve the experience for screen reader users. Learn more.
+
+
+
+
+ +
+ + + <th> elements and elements with [role="columnheader"/"rowheader"] have data cells they describe. + + +
+ + + + +
+
+
+
Screen readers have features to make navigating tables easier. Ensuring table headers always refer to some set of cells may improve the experience for screen reader users. Learn more.
+
+
+
+
+ +
+ + + [lang] attributes have a valid value + + +
+ + + + +
+
+
+
Specifying a valid BCP 47 language on elements helps ensure that text is pronounced correctly by a screen reader. Learn more.
+
+
+
+
+ +
+ + + <video> elements contain a <track> element with [kind="captions"] + + +
+ + + + +
+
+
+
When a video provides a caption it is easier for deaf and hearing impaired users to access its information. Learn more.
+
+
+
+ +
Trust and Safety
+
+ +
+ + + Ensure CSP is effective against XSS attacks + + +
+ + + + +
+
+
+
A strong Content Security Policy (CSP) significantly reduces the risk of cross-site scripting (XSS) attacks. Learn more
+
+
Description
Directive
Severity
No CSP found in enforcement mode
High
+
+ +
+
+ Passed audits + (17) + + +
+
+ + + + + +
+
+
+
+ +
+ + + Uses HTTPS + + +
+ + + + +
+
+
+
All sites should be protected with HTTPS, even ones that don't handle sensitive data. This includes avoiding mixed content, where some resources are loaded over HTTP despite the initial request being served over HTTPS. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. Learn more.
+
+
+
+
+ +
+ + + Links to cross-origin destinations are safe + + +
+ + + + +
+
+
+
Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve performance and prevent security vulnerabilities. Learn more.
+
+
+
+
+ +
+ + + Avoids requesting the geolocation permission on page load + + +
+ + + + +
+
+
+
Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to a user action instead. Learn more.
+
+
+
+
+ +
+ + + Avoids requesting the notification permission on page load + + +
+ + + + +
+
+
+
Users are mistrustful of or confused by sites that request to send notifications without context. Consider tying the request to user gestures instead. Learn more.
+
+
+
+
+ +
+ + + Avoids front-end JavaScript libraries with known security vulnerabilities + + +
+ + + + +
+
+
+
Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers. Learn more.
+
+
+
+
+ +
+ + + Allows users to paste into password fields + + +
+ + + + +
+
+
+
Preventing password pasting undermines good security policy. Learn more.
+
+
+
+
+ +
+ + + Displays images with correct aspect ratio + + +
+ + + + +
+
+
+
Image display dimensions should match natural aspect ratio. Learn more.
+
+
+
+
+ +
+ + + Serves images with appropriate resolution + + +
+ + + + +
+
+
+
Image natural dimensions should be proportional to the display size and the pixel ratio to maximize image clarity. Learn more.
+
+
+
+
+ +
+ + + Page has the HTML doctype + + +
+ + + + +
+
+
+
Specifying a doctype prevents the browser from switching to quirks-mode. Learn more.
+
+
+
+
+ +
+ + + Properly defines charset + + +
+ + + + +
+
+
+
A character encoding declaration is required. It can be done with a `<meta>` tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. Learn more.
+
+
+
+
+ +
+ + + Avoids unload event listeners + + +
+ + + + +
+
+
+
The `unload` event does not fire reliably and listening for it can prevent browser optimizations like the Back-Forward Cache. Consider using the `pagehide` or `visibilitychange` events instead. Learn more
+
+
+
+
+ +
+ + + Avoids Application Cache + + +
+ + + + +
+
+
+
Application Cache is deprecated. Learn more.
+
+
+
+
+ +
+ + + Detected JavaScript libraries + + +
+ + + + +
+
+
+
All front-end JavaScript libraries detected on the page. Learn more.
+
+
Name
Version
FuseJS
+
+
+ +
+ + + Avoids deprecated APIs + + +
+ + + + +
+
+
+
Deprecated APIs will eventually be removed from the browser. Learn more.
+
+
+
+
+ +
+ + + No browser errors logged to the console + + +
+ + + + +
+
+
+
Errors logged to the console indicate unresolved problems. They can come from network request failures and other browser concerns. Learn more
+
+
+
+
+ +
+ + + Page has valid source maps + + +
+ + + + +
+
+
+
Source maps translate minified code to the original source code. This helps developers debug in production. In addition, Lighthouse is able to provide further insights. Consider deploying source maps to take advantage of these benefits. Learn more.
+
+
+
+
+ +
+ + + No issues in the Issues panel in Chrome Devtools + + +
+ + + + +
+
+
+
Issues logged to the `Issues` panel in Chrome Devtools indicate unresolved problems. They can come from network request failures, insufficient security controls, and other browser concerns. Open up the Issues panel in Chrome DevTools for more details on each issue.
+
+
+
+ +
+
+ Not applicable + (1) + + +
+
+ + + + + +
+
+
+
+ +
+ + + Fonts with font-display: optional are preloaded + + +
+ + + + +
+
+
+
Preload `optional` fonts so first-time visitors may use them. Learn more
+
+
+
+
+ +
These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. Learn more.
+
+
+ +
+
+ Additional items to manually check + (1) + + + Run these additional validators on your site to check additional SEO best practices.
+
+ + + + + +
+
+
+
+ +
+ + + Structured data is valid + + +
+ + + + +
+
+
+
Run the Structured Data Testing Tool and the Structured Data Linter to validate structured data. Learn more.
+
+
+
+ +
+
+ Passed audits + (13) + + +
+
+ + + + + +
+
+
+
+ +
+ + + Has a <meta name="viewport"> tag with width or initial-scale + + +
+ + + + +
+
+
+
Add a `<meta name="viewport">` tag to optimize your app for mobile screens. Learn more.
+
+
+
+
+ +
+ + + Document has a <title> element + + +
+ + + + +
+
+
+
The title gives screen reader users an overview of the page, and search engine users rely on it heavily to determine if a page is relevant to their search. Learn more.
+
+
+
+
+ +
+ + + Document has a meta description + + +
+ + + + +
+
+
+
Meta descriptions may be included in search results to concisely summarize page content. Learn more.
+
+
+
+
+ +
+ + + Page has successful HTTP status code + + +
+ + + + +
+
+
+
Pages with unsuccessful HTTP status codes may not be indexed properly. Learn more.
+
+
+
+
+ +
+ + + Links are crawlable + + +
+ + + + +
+
+
+
Search engines may use `href` attributes on links to crawl websites. Ensure that the `href` attribute of anchor elements links to an appropriate destination, so more pages of the site can be discovered. Learn More
+
+
+
+
+ +
+ + + Page isn’t blocked from indexing + + +
+ + + + +
+
+
+
Search engines are unable to include your pages in search results if they don't have permission to crawl them. Learn more.
+
+
+
+
+ +
+ + + Image elements have [alt] attributes + + +
+ + + + +
+
+
+
Informative elements should aim for short, descriptive alternate text. Decorative elements can be ignored with an empty alt attribute. Learn more.
+
+
+
+
+ +
+ + + Document has a valid hreflang + + +
+ + + + +
+
+
+
hreflang links tell search engines what version of a page they should list in search results for a given language or region. Learn more.
+
+
+
+
+ +
+ + + Document has a valid rel=canonical + + +
+ + + + +
+
+
+
Canonical links suggest which URL to show in search results. Learn more.
+
+
+
+
+ +
+ + + Document uses legible font sizes + 99.75% legible text + +
+ + + + +
+
+
+
Font sizes less than 12px are too small to be legible and require mobile visitors to “pinch to zoom” in order to read. Strive to have >60% of page text ≥12px. Learn more.
+
+ + +
+ +
+
Source
Selector
% of Page Text
Font Size
.text-\[0\.6rem\]
0.25%
9.6px
Legible text
99.75%
≥ 12px
+
+
+ +
+ + + Document avoids plugins + + +
+ + + + +
+
+
+
Search engines can't index plugin content, and many devices restrict plugins or don't support them. Learn more.
+
+
+
+
+ +
+ + + Tap targets are sized appropriately + 100% appropriately sized tap targets + +
+ + + + +
+
+
+
Interactive elements like buttons and links should be large enough (48x48px), and have enough space around them, to be easy enough to tap without overlapping onto other elements. Learn more.
+
+
+
+ +
+
+ Not applicable + (1) + + +
+
+ + + + + +
+
+
+
+ +
+ + + robots.txt is valid + + +
+ + + + +
+
+
+
If your robots.txt file is malformed, crawlers may not be able to understand how you want your website to be crawled or indexed. Learn more.
+
+
+
+ +
Installable
+
+ +
+ + + Web app manifest and service worker meet the installability requirements + + +
+ + + + +
+
+
+
Service worker is the technology that enables your app to use many Progressive Web App features, such as offline, add to homescreen, and push notifications. With proper service worker and manifest implementations, browsers can proactively prompt users to add your app to their homescreen, which can lead to higher engagement. Learn more.
+
+
+
PWA Optimized
+
+ +
+ + + Does not register a service worker that controls page and start_url + + +
+ + + + +
+
+
+
The service worker is the technology that enables your app to use many Progressive Web App features, such as offline, add to homescreen, and push notifications. Learn more.
+
+
+
+
+ +
+ + + Redirects HTTP traffic to HTTPS + + +
+ + + + +
+
+
+
If you've already set up HTTPS, make sure that you redirect all HTTP traffic to HTTPS in order to enable secure web features for all your users. Learn more.
+
+
+
+
+ +
+ + + Configured for a custom splash screen + + +
+ + + + +
+
+
+
A themed splash screen ensures a high-quality experience when users launch your app from their homescreens. Learn more.
+
+
+
+
+ +
+ + + Does not set a theme color for the address bar.
Failures: No `<meta name="theme-color">` tag found.
+ +
+
+ + + + +
+
+
+
The browser address bar can be themed to match your site. Learn more.
+
+
+
+
+ +
+ + + Content is sized correctly for the viewport + + +
+ + + + +
+
+
+
If the width of your app's content doesn't match the width of the viewport, your app might not be optimized for mobile screens. Learn more.
+
+
+
+
+ +
+ + + Has a <meta name="viewport"> tag with width or initial-scale + + +
+ + + + +
+
+
+
Add a `<meta name="viewport">` tag to optimize your app for mobile screens. Learn more.
+
+
+
+
+ +
+ + + Provides a valid apple-touch-icon + + +
+ + + + +
+
+
+
For ideal appearance on iOS when users add a progressive web app to the home screen, define an `apple-touch-icon`. It must point to a non-transparent 192px (or 180px) square PNG. Learn More.
+
+
+
+
+ +
+ + + Manifest has a maskable icon + + +
+ + + + +
+
+
+
A maskable icon ensures that the image fills the entire shape without being letterboxed when installing the app on a device. Learn more.
+
+
+
+ +
+
+ Additional items to manually check + (3) + + + These checks are required by the baseline PWA Checklist but are not automatically checked by Lighthouse. They do not affect your score but it's important that you verify them manually.
+
+ + + + + +
+
+
+
+ +
+ + + Site works cross-browser + + +
+ + + + +
+
+
+
To reach the most number of users, sites should work across every major browser. Learn more.
+
+
+
+
+ +
+ + + Page transitions don't feel like they block on the network + + +
+ + + + +
+
+
+
Transitions should feel snappy as you tap around, even on a slow network. This experience is key to a user's perception of performance. Learn more.
+
+
+
+
+ +
+ + + Each page has a URL + + +
+ + + + +
+
+
+
Ensure individual pages are deep linkable via URL and that URLs are unique for the purpose of shareability on social media. Learn more.
+
+
+
+ + +
+ +
+ + + + + + + + \ No newline at end of file diff --git a/exampleSite/content/docs/version-2/lighthouse.jpg b/exampleSite/content/docs/version-2/lighthouse.jpg new file mode 100644 index 00000000..22a895ca Binary files /dev/null and b/exampleSite/content/docs/version-2/lighthouse.jpg differ diff --git a/exampleSite/content/docs/version-2/upgrade/index.md b/exampleSite/content/docs/version-2/upgrade/index.md new file mode 100644 index 00000000..4db563df --- /dev/null +++ b/exampleSite/content/docs/version-2/upgrade/index.md @@ -0,0 +1,177 @@ +--- +title: "Upgrading from Congo 1.x" +date: 2022-01-20 +draft: false +description: "Discover what's new in Congo version 2.0." +tags: ["new", "docs"] +--- + +Although Congo 2.0 contains a large number of changes, the theme has been designed to minimise the effort required to upgrade to the latest release. + +That said, there are some changes that require adjustments to existing sites that are built with Congo version 1.x. This guide will step you through the process and highlight things you need to consider. + +## Step 1: Upgrade Hugo + +{{< alert >}} +Congo 2.0 requires a minimum of **Hugo v0.87.0 or later** +{{< /alert >}} + +Congo is built to take advantage of some of the latest Hugo features. You should regularly keep your Hugo installation up to date to avoid any issues. + +You can check your current version using the command `hugo version`. Visit the [Hugo docs](https://gohugo.io/getting-started/installing/) for information on obtaining a newer release for your platform. + +## Step 2: Upgrade Congo + +The process for upgrading Congo will depend on how you include the theme in your project. Instructions for each method can be found below. + +- [Upgrade using Hugo](#upgrade-using-hugo) +- [Upgrade using git](#upgrade-using-git) +- [Upgrade manually](#upgrade-manually) + +### Upgrade using Hugo + +Hugo makes updating modules super easy. Simply change into your project directory and execute the following command: + +```shell +hugo mod get -u +``` + +Hugo will automatically upgrade any modules that are required for your project. It does this by inspecting your `module.toml` and `go.mod` files. If you have any issues with the upgrade, check to ensure these files are still configured correctly. + +Once the theme has been upgraded, continue to the [next section](#step-3-theme-configuration). + +### Upgrade using git + +Git submodules can be upgraded using the `git` command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository: + +```shell +git submodule upgrade --remote --merge +``` + +Once the submodule has been upgraded, continue to the [next section](#step-3-theme-configuration). + +### Upgrade manually + +Updating Congo manually requires you to download the latest copy of the theme and replace the old version in your project. + +{{< alert >}} +Note that any local customisations you have made to the theme files will be lost during this process. +{{< /alert >}} + +1. Download the latest release of the theme source code. + + {{< button href="https://github.com/jpanther/congo/releases/latest" target="_blank" >}}Download from Github{{< /button >}} + +2. Extract the archive, rename the folder to `congo` and move it to the `themes/` directory inside your Hugo project's root folder. You will need to overwrite the existing directory to replace all the theme files. + +3. Continue to the [next section](#step-3-theme-configuration). + +## Step 3: Theme configuration + +Congo 2.0 introduces a number of new theme configuration parameters. Although the theme will adapt to existing version 1 configurations, in order to take advantage of some of the newer theme features, you will need to adjust your existing configuration. + +The simplest way to do this is to take a copy of the theme's default configuration and compare it to your existing files. The process is outlined in greater detail below. + +### Languages.toml + +In order to provide multilingual support, language-specific theme parameters have been moved to a new config file `languages.[lang-code].toml`. The theme comes with a template `languages.en.toml` file which can be used as a guide. + +{{< alert >}} +This step is optional if you do not need multilingual support, although completing it now will make future theme upgrades easier. +{{< /alert >}} + +The languages config file follows this structure: + +```toml +# config/_default/languagues.en.toml + +languageCode = "en" +languageName = "English" +displayName = "EN" +htmlCode = "en" +weight = 1 +rtl = false + +# Language-specific parameters go here +``` + +Using your preferred language, simply create this new file in `config/_default/` and then move the language-specific parameters from any existing config files over to this new file. The table below outlines the parameters that need to be moved. + +| Parameter | Old location | +| ------------- | ------------- | +| `title` | `config.toml` | +| `description` | `params.toml` | +| `copyright` | `config.toml` | +| `dateFormat` | `params.toml` | +| `[author]` | `config.toml` | + +Once the values have been moved to the new location, these parameters should be deleted from their original locations. + +### Config.toml + +The `config.toml` file now only contains base Hugo configuration values. Other than removing the language-specific strings above, there are only two changes to consider. + +If you're using a language other than English, provide a `defaultContentLanguage` value that matches the language code in the config file you created for your language. Secondly, to take advange of the new site search in Congo 2.0, an `[outputs]` block needs to be provided. + +```toml +# config/_default/config.toml + +defaultContentLanguage = "en" +[outputs] + home = ["HTML", "RSS", "JSON"] +``` + +### Markup.toml + +Congo 2.0 adds support for tables of contents on article pages. Although Hugo ships with default settings for generating contents listings, you can adjust this behaviour by adding a new `[tableOfContents]` block to your `markup.toml` file. + +The recommended settings are as follows, which includes any headings in the Markdown content at levels 2, 3 and 4: + +```toml +# config/_default/markup.toml + +[tableOfContents] + startLevel = 2 + endLevel = 4 +``` + +### Params.toml + +A number of new theme parameters have been introduced in Congo 2.0. Some minor changes are requried to existing configurations. Remember, the theme will always revert to a sensible default if a parameter is not provided. + +The follow parameters have been **renamed**: + +`darkToggle` **→** `showDarkToggle` + +The following table outlines some key **new parameters** that control new features in version 2: + +| New parameter | Type | Default | +| ----------------------------- | ------- | ------- | +| `enableSearch` | Boolean | `false` | +| `showScrollToTop` | Boolean | `true` | +| `article.showTaxonomies` | Boolean | `false` | +| `article.showTableOfContents` | Boolean | `false` | +| `list.showTableOfContents` | Boolean | `false` | + +For the full list of supported parameters, refer to the [Configuration]({{< ref "docs/configuration" >}}) docs. + +## Step 4: Move assets + +All site assets now use Hugo Pipes to build an optimised version of your project. In order for the theme to locate your files, any previously static assets used in the theme need to be moved to the Hugo assets folder. + +`static/me.jpg` **→** `assets/me.jpg` +`static/logo.jpg` **→** `assets/logo.jpg` + +If you have provided an author image or site logo, simply move these assets from the `static/` folder to the `assets/` folder. If you use the same directory structure the theme will know where to find these files automatically. If you would like to provide a new path, update the `logo` and `author.image` config values accordingly. + +## Step 5: Check content + +The behavior of the `figure` shortcode is different in version 2. If you are using `figure` in your content, you may need to adjust the parameters you are providing. Consult the shortcode docs to learn more about supported parameters. + +## Step 6: Rebuild + +Now that all the configuration changes are complete, it's time to rebuild the site. Run `hugo`, or your build command, and check that everything works as expected. + +If you come across any errors, check the configuration is correct and refer to the [full documentation]({{< ref "docs" >}}) for further guidance. Remember, the example config files bundled with the theme contain all the default parameters and are a great starting point. + +🙋‍♀️ If you still need help, feel free to ask your question on [GitHub Discussions](https://github.com/jpanther/congo/discussions).