mirror of https://github.com/jpanther/congo.git
commit
668805d3d5
|
@ -1,5 +1,9 @@
|
|||
{
|
||||
"htmlWhitespaceSensitivity": "css",
|
||||
"printWidth": 100,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "es5",
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.html"],
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to Congo will be documented in this file.
|
||||
|
||||
Things that need attention when upgrading from a prior version are marked ⚠️.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
---
|
||||
|
||||
## [1.1.0] - 2020-08-18
|
||||
|
||||
### Added
|
||||
|
||||
- Breadcrumbs
|
||||
- i18n support
|
||||
- Recent articles partial
|
||||
- CSS transitions
|
||||
- Hugo module support
|
||||
- JSON-LD structured metadata
|
||||
|
||||
### Changed
|
||||
|
||||
- ⚠️ Renamed parameter: `homepage.showList` -> `homepage.showRecent`
|
||||
- ⚠️ Renamed parameter: `homepage.listSections` -> `mainSections`
|
||||
- ⚠️ Consolidated author configuration parameters into `config.toml`
|
||||
- General style tweaks to enhance design consistency
|
||||
|
||||
### Fixed
|
||||
|
||||
- URLs being incorrect in some cases when the site is deployed in a subfolder
|
||||
|
||||
## [1.0.0] - 2020-08-16
|
||||
|
||||
### Initial release 🎉
|
||||
|
||||
- Built with Tailwind CSS JIT for minified stylesheets without any excess code
|
||||
- Fully responsive layout
|
||||
- Dark mode (auto-switching based upon browser)
|
||||
- Highly customisable configuration
|
||||
- Multiple homepage layouts
|
||||
- Flexible with any content types, taxonomies and menus
|
||||
- Ability to link to posts on third-party websites
|
||||
- Diagrams and visualisations using Mermaid JS
|
||||
- SVG icons from FontAwesome 5
|
||||
- Heading anchors, 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
|
||||
- Advanced customisation using simple Tailwind colour definitions and styles
|
||||
- Fully documented
|
||||
|
||||
[unreleased]: https://github.com/jpanther/Congo/compare/v1.1.0...HEAD
|
||||
[1.1.0]: https://github.com/jpanther/Congo/compare/v1.0.0...v1.1.0
|
||||
[1.0.0]: https://github.com/jpanther/Congo/releases/tag/v1.0.0
|
|
@ -69,19 +69,12 @@ A few things you need to set for a new installation:
|
|||
|
||||
baseURL = "https://your_domain.com"
|
||||
languageCode = "en-AU"
|
||||
|
||||
title = "My awesome website"
|
||||
```
|
||||
|
||||
It's also useful to set the author configuration in the `config/_default/author.toml` file. You can also add links to your profiles here to enable them in the theme.
|
||||
|
||||
```toml
|
||||
# config/_default/author.toml
|
||||
|
||||
[author]
|
||||
name = "Your name"
|
||||
links = [
|
||||
{ twitter = "https://twitter.com/username" }
|
||||
{ twitter = "https://twitter.com/jpanther" }
|
||||
]
|
||||
```
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
@tailwind base;
|
||||
@tailwind components;
|
||||
|
||||
body a,
|
||||
body button {
|
||||
@apply transition;
|
||||
}
|
||||
|
||||
/* Scale SVG icons to text size */
|
||||
.icon svg {
|
||||
height: 1em;
|
||||
|
@ -29,6 +34,15 @@
|
|||
@apply mt-0 last:mb-0;
|
||||
}
|
||||
|
||||
/* Article pagination */
|
||||
.article-pagination a:hover .article-pagination-title {
|
||||
@apply underline underline-primary-500;
|
||||
}
|
||||
|
||||
.article-pagination a:hover .article-pagination-direction {
|
||||
@apply text-primary-700 dark:text-primary-400;
|
||||
}
|
||||
|
||||
/* -- Chroma Highlight -- */
|
||||
/* Background */
|
||||
.prose .chroma {
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
# -- Site Author Details --
|
||||
# To display the author box below each article, configure the settings below.
|
||||
# The author image should be placed inside the `/static` folder.
|
||||
# Uncomment any links to enable them. The icons will be displayed in the order listed.
|
||||
|
||||
[author]
|
||||
# name = "Your name here"
|
||||
# image = "/img/author.jpg"
|
||||
# links = [
|
||||
# { email = "mailto:hello@your_domain.com" },
|
||||
# { link = "https://link-to-some-website.com/" },
|
||||
# { codepen = "https://codepen.io/username" },
|
||||
# { dev = "https://dev.to/username" },
|
||||
# { discord = "https://discord.gg/invitecode" },
|
||||
# { dribbble = "https://dribbble.com/username" },
|
||||
# { facebook = "https://facebook.com/username" },
|
||||
# { github = "https://github.com/username" },
|
||||
# { gitlab = "https://gitlab.com/username" },
|
||||
# { instagram = "https://instagram.com/username" },
|
||||
# { keybase = "https://keybase.io/username" },
|
||||
# { lastfm = "https://lastfm.com/user/username" },
|
||||
# { linkedin = "https://linkedin.com/in/username" },
|
||||
# { mastodon = "https://mastodon.instance/@username" },
|
||||
# { medium = "https://medium.com/username" },
|
||||
# { reddit = "https://reddit.com/user/username" },
|
||||
# { slack = "https://workspace.url/team/userid" },
|
||||
# { snapchat = "https://snapchat.com/add/username" },
|
||||
# { soundcloud = "https://soundcloud.com/username" },
|
||||
# { steam = "https://steamcommunity.com/profiles/userid" },
|
||||
# { tiktok = "https://tiktok.com/@username" },
|
||||
# { twitch = "https://twitch.tv/username" },
|
||||
# { twitter = "https://twitter.com/username" },
|
||||
# { youtube = "https://youtube.com/username" },
|
||||
# ]
|
|
@ -1,23 +1,45 @@
|
|||
# -- Site Configuration --
|
||||
# Refer to the theme docs for more details about each of these parameters.
|
||||
# https://jpanther.github.io/Congo/docs/getting-started/
|
||||
|
||||
theme = "congo"
|
||||
|
||||
# Speficiy the base URL for the website.
|
||||
# baseURL = "https://your_domain.com/"
|
||||
|
||||
# The language code of the language that the website is written in.
|
||||
# This can be a base language (ie. "en") or a specific variant (ie. "en-AU").
|
||||
languageCode = "en"
|
||||
defaultContentLanguage = "en"
|
||||
|
||||
# The website title. This will be displayed in the site header.
|
||||
title = "Congo"
|
||||
|
||||
# A default copyright message is generated automatically.
|
||||
# Uncomment the line below to provide a custom copyright Markdown string.
|
||||
# copyright = "Copy, _right?_ :thinking_face:"
|
||||
|
||||
# To automatically convert strings such as :bang: to emoji, set this to true.
|
||||
enableEmoji = true
|
||||
|
||||
# Congo will generate a robots file that allows search engines to index
|
||||
# the entire site. If you don't want a robots file, set this to false.
|
||||
enableRobotsTXT = true
|
||||
|
||||
[author]
|
||||
# name = "Your name here"
|
||||
# image = "img/author.jpg"
|
||||
# links = [
|
||||
# { email = "mailto:hello@your_domain.com" },
|
||||
# { link = "https://link-to-some-website.com/" },
|
||||
# { codepen = "https://codepen.io/username" },
|
||||
# { dev = "https://dev.to/username" },
|
||||
# { discord = "https://discord.gg/invitecode" },
|
||||
# { dribbble = "https://dribbble.com/username" },
|
||||
# { facebook = "https://facebook.com/username" },
|
||||
# { github = "https://github.com/username" },
|
||||
# { gitlab = "https://gitlab.com/username" },
|
||||
# { instagram = "https://instagram.com/username" },
|
||||
# { keybase = "https://keybase.io/username" },
|
||||
# { lastfm = "https://lastfm.com/user/username" },
|
||||
# { linkedin = "https://linkedin.com/in/username" },
|
||||
# { mastodon = "https://mastodon.instance/@username" },
|
||||
# { medium = "https://medium.com/username" },
|
||||
# { reddit = "https://reddit.com/user/username" },
|
||||
# { slack = "https://workspace.url/team/userid" },
|
||||
# { snapchat = "https://snapchat.com/add/username" },
|
||||
# { soundcloud = "https://soundcloud.com/username" },
|
||||
# { steam = "https://steamcommunity.com/profiles/userid" },
|
||||
# { tiktok = "https://tiktok.com/@username" },
|
||||
# { twitch = "https://twitch.tv/username" },
|
||||
# { twitter = "https://twitter.com/username" },
|
||||
# { youtube = "https://youtube.com/username" },
|
||||
# ]
|
||||
|
|
|
@ -2,17 +2,21 @@
|
|||
# These options control how the theme functions and allow you to
|
||||
# customise the display of your website.
|
||||
#
|
||||
# Refer to the README for more details about each of these parameters.
|
||||
# Refer to the theme docs for more details about each of these parameters.
|
||||
# https://jpanther.github.io/Congo/docs/configuration/#theme-parameters
|
||||
|
||||
# description = "My awesome website"
|
||||
# mainSections = ["section1", "section2"]
|
||||
|
||||
[homepage]
|
||||
layout = "page" # valid options: page, profile, custom
|
||||
showList = false
|
||||
listSections = ["blog"]
|
||||
showRecent = false
|
||||
|
||||
[article]
|
||||
showDate = true
|
||||
dateFormat = "2 January 2006"
|
||||
showAuthor = true
|
||||
showBreadcrumbs = false
|
||||
showDraftLabel = true
|
||||
showHeadingAnchors = true
|
||||
showPagination = true
|
||||
|
@ -20,6 +24,7 @@
|
|||
# sharingLinks = ["facebook", "twitter", "reddit", "linkedin", "email"]
|
||||
|
||||
[list]
|
||||
showBreadcrumbs = false
|
||||
groupByYear = true
|
||||
|
||||
[taxonomy]
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
{
|
||||
"email": {
|
||||
"icon": "email",
|
||||
"title": "Send via email",
|
||||
"title": "sharing.email",
|
||||
"url": "mailto:?body=%s&subject=%s"
|
||||
},
|
||||
"facebook": {
|
||||
"icon": "facebook",
|
||||
"title": "Share on Facebook",
|
||||
"title": "sharing.facebook",
|
||||
"url": "https://www.facebook.com/sharer/sharer.php?u=%s"e=%s"
|
||||
},
|
||||
"linkedin": {
|
||||
"icon": "linkedin",
|
||||
"title": "Share on LinkedIn",
|
||||
"title": "sharing.linkedin",
|
||||
"url": "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s"
|
||||
},
|
||||
"reddit": {
|
||||
"icon": "reddit",
|
||||
"title": "Submit to Reddit",
|
||||
"title": "sharing.reddit",
|
||||
"url": "https://reddit.com/submit/?url=%s&resubmit=true&title=%s"
|
||||
},
|
||||
"twitter": {
|
||||
"icon": "twitter",
|
||||
"title": "Tweet on Twitter",
|
||||
"title": "sharing.twitter",
|
||||
"url": "https://twitter.com/intent/tweet/?url=%s&text=%s"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,14 +4,16 @@
|
|||
# as it does not contain all the required theme settings!
|
||||
#
|
||||
# Refer to the theme docs for configuration instructions if you're unsure.
|
||||
# https://github.com/jpanther/Congo#readme
|
||||
# https://jpanther.github.io/Congo/docs/
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
baseURL = "https://example.com"
|
||||
baseURL = "https://jpanther.github.io/Congo/"
|
||||
theme = "Congo"
|
||||
languageCode = "en-AU"
|
||||
defaultContentLanguage = "en"
|
||||
title = "Congo"
|
||||
enableEmoji = true
|
||||
relativeURLs = true
|
||||
|
||||
[author]
|
||||
name = "Congo"
|
||||
|
@ -28,11 +30,15 @@ enableEmoji = true
|
|||
|
||||
[params.homepage]
|
||||
layout = "custom"
|
||||
showList = true
|
||||
listSections = "samples"
|
||||
showRecent = true
|
||||
mainSections = ["samples"]
|
||||
|
||||
[params.list]
|
||||
groupByYear = false
|
||||
showBreadcrumbs = true
|
||||
|
||||
[params.article]
|
||||
showBreadcrumbs = true
|
||||
|
||||
[[menu.main]]
|
||||
name = "Docs"
|
||||
|
|
|
@ -7,6 +7,21 @@ description: "This is a demo of the Congo theme for Hugo."
|
|||
A simple, lightweight theme for Hugo built with Tailwind CSS.
|
||||
{{< /lead >}}
|
||||
|
||||
<div class="flex px-4 py-1 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
|
||||
<span class="flex items-center pr-3 text-primary-400">
|
||||
{{< icon "exclamation-triangle" >}}
|
||||
</span>
|
||||
<span class="flex items-center justify-between flex-grow dark:text-gray-300">
|
||||
<span class="prose">This is a demo of the <code id="layout">page</code> layout.</span>
|
||||
<button
|
||||
class="px-4 py-1 !text-white !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
|
||||
onclick="switchLayout()"
|
||||
>
|
||||
Switch layout ↻
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
This is a demo site built entirely using Congo. It also contains a complete set of [theme documentation](/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](/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](/docs/installation/) to get started.
|
||||
|
|
|
@ -21,7 +21,33 @@ The default theme configuration is documented in each file so you can freely adj
|
|||
As outlined in the [installation instructions](/docs/installation/#set-up-your-configuration-files), you should adjust your theme configuration by modifying the files in the `config/_default/` folder of your Hugo project and delete the `config.toml` file in your project root.
|
||||
{{< /alert >}}
|
||||
|
||||
## Parameters
|
||||
## Site Configuration
|
||||
|
||||
Standard Hugo configuration variables are respected throughout the theme, however there are some specific things that should be configured for the best experience.
|
||||
|
||||
The site configuration is managed through the `config/_default/config.toml` file. The table below outlines all the settings that the Congo takes advantage of.
|
||||
|
||||
Note that the variable names provided in this table use dot notation to simplify the TOML data structure (ie. `author.name` refers to `[author] name`).
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|Name|Type|Default|Description|
|
||||
| --- | --- | --- | --- |
|
||||
|`theme`|string|`"congo"`|This must be set to `"congo"` for the theme to function.|
|
||||
|`baseURL`|string|_Not set_|The URL to the root of the website.|
|
||||
|`languageCode`|string|`"en"`|The language of the website for site metadata purposes. It can be a top-level language (ie. `"en"`) or a sub-variant (ie. `"en-AU"`)."|
|
||||
|`defaultContentLanguage`|string|`"en"`|This value determines the language of theme components."|
|
||||
|`title`|string|`"Congo"`|The title of the website. This will be displayed in the site header and footer.|
|
||||
|`copyright`|string|_Not set_|A Markdown string containing the copyright message to be displayed in the site footer. If none is provided, Congo will automatically generate a copyright string using the site `title`.
|
||||
|`enableEmoji`|boolean|`true`|Whether emoji strings in content should be converted to emoji symbols.|
|
||||
|`enableRobotsTXT`|boolean|`true`|When enabled a `robots.txt` file will be created in the site root that allows search engines to crawl the entire site. Set to `false` if you wish to provide your own file.|
|
||||
|`author.name`|string|_Not set_|The author's name. This will be displayed in article footers, and on the homepage when the profile layout is used.|
|
||||
|`author.image`|string|_Not set_|Path to the image file of the author. The image should be a 1:1 aspect ratio and placed in the site's `static/` folder.|
|
||||
|`author.links`|array of objects|_Not set_|The links to display alongside the author's details. The config file contains example links which can simply be uncommented to enable. The order that the links are displayed is determined by the order they appear in the array. Custom links can be added by providing corresponding SVG icon assets in `assets/icons/`.|
|
||||
|`[permalinks]`||_Not set_|Refer to the [Hugo docs](https://gohugo.io/content-management/urls/#permalinks) for permalink configuration.|
|
||||
|`[taxonomies]`||_Not set_|Refer to the [Hugo docs](https://gohugo.io/content-management/taxonomies/) for taxonomy configuration.|
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Theme Parameters
|
||||
|
||||
Congo provides a large number of configuration parameters that control how the theme functions. The table below outlines every available parameter in the `config/_default/params.toml` file.
|
||||
|
||||
|
@ -30,18 +56,21 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
|||
<!-- prettier-ignore-start -->
|
||||
|Name|Type|Default|Description|
|
||||
| --- | --- | --- | --- |
|
||||
|`description`|string|_Not set_|The description of the website for metadata purposes.|
|
||||
|`mainSections`|array of strings|_Not set_|The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used.|
|
||||
|`homepage.layout`|string|`"page"`|The layout of the homepage. Valid values are `page`, `profile` or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/home/custom.html` file. Refer to the [Homepage Layout](/docs/homepage-layout/) section for more details.|
|
||||
|`homepage.showList`|boolean|`false`|Whether or not recent articles are listed on the homepage beneath the page content. Refer to the [Recent Articles](/docs/homepage-layout/#recent-articles) docs for more details.|
|
||||
|`homepage.listSections`|array of strings|`["blog"]`|The sections of content to include in the recent list when `homepage.showList` is `true`.|
|
||||
|`homepage.showRecent`|boolean|`false`|Whether or not to display the recent articles list on the homepage.|
|
||||
|`article.showDate`|boolean|`true`|Whether or not article dates are displayed.|
|
||||
|`article.dateFormat`|string|`"2 January 2006"`|How article dates are formatted. Refer to the [Hugo docs](https://gohugo.io/functions/format/#gos-layout-string) for acceptable formats.|
|
||||
|`article.showAuthor`|boolean|`true`|Whether or not the author box is displayed in the article footer.|
|
||||
|`article.showBreadcrumbs`|boolean|`false`|Whether or not breadcrumbs are displayed in the article header.|
|
||||
|`article.showDraftLabel`|boolean|`true`|Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`.|
|
||||
|`article.showHeadingAnchors`|boolean|`true`|Whether or not heading anchor links are displayed alongside headings within articles.|
|
||||
|`article.showPagination`|boolean|`true`|Whether or not the next/previous article links are displayed in the article footer.|
|
||||
|`article.showReadingTime`|boolean|`true`|Whether or not article reading times are displayed.|
|
||||
|`article.sharingLinks`|array of strings|_Not set_|Which sharing links to display at the end of each article. When not provided, or set to `false` no links will be displayed.|
|
||||
|`list.groupByYear`|boolean|`true`|Whether or not articles are grouped under years in the article listing.|
|
||||
|`list.showBreadcrumbs`|boolean|`false`|Whether or not breadcrumbs are displayed in the header on list pages.|
|
||||
|`list.groupByYear`|boolean|`true`|Whether or not articles are grouped by year on list pages.|
|
||||
|`sitemap.excludedKinds`|array of strings|`["taxonomy", "term"]`|Kinds of content that should be excluded from the generated `/sitemap.xml` file. Refer to the [Hugo docs](https://gohugo.io/templates/section-templates/#page-kinds) for acceptable values.|
|
||||
|`taxonomy.showTermCount`|boolean|`true`|Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing.|
|
||||
|`fathomAnalytics.site`|string|_Not set_|The site code generated by Fathom Analytics for the website. Refer to the [Analytics docs](#analyticshtml) below for more details.|
|
||||
|
|
|
@ -22,22 +22,20 @@ A few things you need to set for a new installation:
|
|||
|
||||
baseURL = "https://your_domain.com"
|
||||
languageCode = "en-AU"
|
||||
|
||||
title = "My awesome website"
|
||||
```
|
||||
|
||||
It's also useful to set the author configuration in the `config/_default/author.toml` file. You can also add links to your profiles here to enable them in the theme.
|
||||
|
||||
```toml
|
||||
# config/_default/author.toml
|
||||
|
||||
[author]
|
||||
name = "Your name"
|
||||
image = "img/author.jpg"
|
||||
links = [
|
||||
{ twitter = "https://twitter.com/username" }
|
||||
]
|
||||
```
|
||||
|
||||
The `[author]` configuration determines how the author information is displayed on the website. The image should be placed in the site's `static/` folder. Links will be displayed in the order they are listed.
|
||||
|
||||
Further detail about these configuration options is covered in the [Configuration](/docs/configuration/) section.
|
||||
|
||||
## Organising content
|
||||
|
||||
By default, Congo doesn't force you to use a particular content type. In doing so you are free to define your content as you wish. You might prefer _pages_ for a static site, _posts_ for a blog, or _projects_ for a portfolio.
|
||||
|
|
|
@ -39,9 +39,11 @@ To enable the custom layout, set `homepage.layout = "custom"` in the `params.tom
|
|||
|
||||
With the configuration value set, create a new `custom.html` file and place it in `layouts/partials/home/custom.html`. Now whatever is in the `custom.html` 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.
|
||||
|
||||
To include recent articles on the custom layout, use the `recent-articles.html` partial.
|
||||
|
||||
## Recent articles
|
||||
|
||||
All homepage layouts have the option of displaying recent articles below the main page content. To enable this, simply set the `homepage.showList` setting to `true` in the `params.toml` configuration file.
|
||||
All homepage layouts have the option of displaying recent articles below the main page content. To enable this, simply set the `homepage.showRecent` setting to `true` in the `params.toml` configuration file.
|
||||
|
||||
![Profile layout with recent articles](home-profile-list.jpg)
|
||||
|
||||
|
|
|
@ -1,38 +1,27 @@
|
|||
<script type="text/javascript">
|
||||
function switchLayout() {
|
||||
var pageDiv = document.getElementById("page");
|
||||
var profileDiv = document.getElementById("profile");
|
||||
var layoutSpan = document.getElementById("layout");
|
||||
if (pageDiv.style.display === "none") {
|
||||
pageDiv.style.display = "block";
|
||||
profileDiv.style.display = "none";
|
||||
layoutSpan.innerHTML = "page";
|
||||
} else {
|
||||
pageDiv.style.display = "none";
|
||||
profileDiv.style.display = "block";
|
||||
layoutSpan.innerHTML = "profile";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex px-4 py-3 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
|
||||
<span class="flex items-center pr-3 text-primary-400">
|
||||
{{ partial "icon.html" "exclamation-triangle" }}
|
||||
</span>
|
||||
<span class="flex items-center justify-between flex-grow no-prose dark:text-gray-300">
|
||||
<span>This is a demo of the `<code id="layout" class="">page</code>` layout.</span>
|
||||
<button
|
||||
class="font-bold px-4 py-2 !text-white !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
|
||||
onclick="switchLayout()"
|
||||
>
|
||||
Switch layout ↻
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="page">
|
||||
{{ partial "partials/home/page.html" . }}
|
||||
</div>
|
||||
<div id="profile" style="display: none">
|
||||
<div id="profile" class="hidden h-full">
|
||||
{{ partial "partials/home/profile.html" . }}
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function switchLayout() {
|
||||
const pageDiv = document.getElementById("page");
|
||||
const profileDiv = document.getElementById("profile");
|
||||
const layoutCode = document.querySelectorAll("code[id=layout]");
|
||||
if (pageDiv.style.display === "none") {
|
||||
pageDiv.style.display = "block";
|
||||
profileDiv.style.display = "none";
|
||||
layoutCode.forEach(function (el) {
|
||||
el.innerText = "page";
|
||||
});
|
||||
} else {
|
||||
pageDiv.style.display = "none";
|
||||
profileDiv.style.display = "block";
|
||||
layoutCode.forEach(function (el) {
|
||||
el.innerText = "profile";
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
article:
|
||||
anchor_label: "Anchor"
|
||||
draft: "Draft"
|
||||
reading_time:
|
||||
one: "{{ .Count }} min"
|
||||
other: "{{ .Count }} mins"
|
||||
reading_time_title: "Reading time"
|
||||
|
||||
author:
|
||||
byline_title: "Author"
|
||||
|
||||
error:
|
||||
404_title: "Page Not Found :confused:"
|
||||
404_error: "Error 404"
|
||||
404_description: "It seems that the page you've requested does not exist."
|
||||
|
||||
footer:
|
||||
powered_by: "Powered by"
|
||||
|
||||
list:
|
||||
externalurl_title: "Link to external site"
|
||||
no_articles: "There's no articles to list here yet."
|
||||
|
||||
sharing:
|
||||
email: "Send via email"
|
||||
facebook: "Share on Facebook"
|
||||
linkedin: "Share on LinkedIn"
|
||||
reddit: "Submit to Reddit"
|
||||
twitter: "Tweet on Twitter"
|
||||
|
||||
shortcode:
|
||||
recent_articles: "Recent"
|
||||
icon_none: "Icon not found."
|
|
@ -1,7 +1,7 @@
|
|||
{{ define "main" }}
|
||||
<h1 class="mb-3 text-4xl font-extrabold">Page Not Found 🤷♂️</h1>
|
||||
<p class="mt-8 mb-12 text-gray-400 dark:text-gray-500">Error 404</p>
|
||||
<h1 class="mb-3 text-4xl font-extrabold">{{ i18n "error.404_title" | emojify }}</h1>
|
||||
<p class="mt-8 mb-12 text-gray-400 dark:text-gray-500">{{ i18n "error.404_error" | emojify }}</p>
|
||||
<div class="prose dark:prose-light">
|
||||
<p>It seems that the page you've requested does not exist.</p>
|
||||
<p>{{ i18n "error.404_description" | emojify }}</p>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} {{ if .Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}<a class="heading-anchor" href="#{{ .Anchor | safeURL }}" aria-label="Anchor">#</a>{{ end }}</h{{ .Level }}>
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} {{ if .Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}<a class="heading-anchor" href="#{{ .Anchor | safeURL }}" aria-label="{{ i18n "article.anchor_label" }}">#</a>{{ end }}</h{{ .Level }}>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "main" }}
|
||||
{{ partial "section-heading.html" . }}
|
||||
{{ partial "section-header.html" . }}
|
||||
{{ if gt .Pages 0 }}
|
||||
<section>
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
|
@ -16,7 +16,7 @@
|
|||
{{ else }}
|
||||
<section class="mt-10 prose dark:prose-light">
|
||||
<p class="py-8 border-t">
|
||||
<em>There's no articles to list here yet.</em>
|
||||
<em>{{ i18n "list.no_articles" | emojify }}</em>
|
||||
</p>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
{{ define "main" }}
|
||||
<article class="max-w-prose">
|
||||
<header>
|
||||
{{ if .Site.Params.article.showBreadcrumbs | default false }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
{{ end }}
|
||||
<h1 class="mt-0 text-4xl font-extrabold">{{ .Title | emojify }}</h1>
|
||||
<div class="mt-8 mb-12 text-base text-gray-400 dark:text-gray-500">
|
||||
{{ partial "article-meta.html" . }}
|
||||
{{ if and .Draft .Site.Params.article.showDraftLabel }}
|
||||
<span
|
||||
class="ml-2 px-1 py-[2px] text-xs font-normal border rounded-md text-primary-700 dark:text-primary-400 border-primary-400 dark:border-primary-600 inline-block align-middle mb-1"
|
||||
>
|
||||
Draft
|
||||
</span>
|
||||
<span class="pl-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</header>
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
{{ define "main" }}
|
||||
{{ partial "section-heading.html" . }}
|
||||
{{ partial "section-header.html" . }}
|
||||
<section class="flex flex-wrap -mx-2 overflow-hidden">
|
||||
{{ range .Data.Terms }}
|
||||
<article class="w-full px-2 my-3 overflow-hidden sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5">
|
||||
<h2>
|
||||
<a class="text-xl font-medium hover:underline" href="{{ .Page.Permalink }}"
|
||||
<a
|
||||
class="text-xl font-medium hover:underline underline-primary-500"
|
||||
href="{{ .Page.Permalink }}"
|
||||
>{{ .Page.Title }}</a
|
||||
>
|
||||
{{ if $.Site.Params.taxonomy.showTermCount | default true }}
|
||||
<span class="text-base text-gray-400">
|
||||
<span class="px-1">·</span>
|
||||
<span class="px-1 text-primary-500">·</span>
|
||||
{{ .Count }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "main" }}
|
||||
{{ partial "section-heading.html" . }}
|
||||
{{ partial "section-header.html" . }}
|
||||
<section>
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
<h2 class="mt-12 text-2xl font-bold first:mt-8">{{ .Key }}</h2>
|
||||
|
|
|
@ -5,12 +5,4 @@
|
|||
{{ else }}
|
||||
{{ partial "partials/home/page.html" . }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.homepage.showList | default false }}
|
||||
<section>
|
||||
<h2 class="text-2xl font-extrabold">Recent</h2>
|
||||
{{ range first 5 (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.homepage.listSections)).Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
<span
|
||||
class="text-sm cursor-default"
|
||||
style="vertical-align: super;"
|
||||
title="Link to external site"
|
||||
title="{{ i18n "list.externalurl_title" }}"
|
||||
>↗</span
|
||||
>
|
||||
{{ else }}
|
||||
<a class="hover:underline" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
<a class="hover:underline underline-primary-500" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
{{ end }}
|
||||
{{ if and .Draft .Site.Params.article.showDraftLabel }}
|
||||
{{ partial "badge.html" "Draft" }}
|
||||
|
|
|
@ -8,11 +8,10 @@
|
|||
(.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true))
|
||||
(ne .ReadingTime 0)
|
||||
}}
|
||||
<span class="px-1">·</span>
|
||||
<span class="px-1 text-primary-500">·</span>
|
||||
{{ end }}
|
||||
{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0) }}
|
||||
<span title="Reading time">
|
||||
{{ .ReadingTime }}
|
||||
min{{ if gt .ReadingTime 1 }}s{{ end }}
|
||||
<span title="{{ i18n "article.reading_time_title" }}">
|
||||
{{ i18n "article.reading_time" .ReadingTime | emojify }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{{ if .Params.showPagination | default (.Site.Params.article.showPagination | default true) }}
|
||||
{{ if or .NextInSection .PrevInSection }}
|
||||
<div class="pt-8">
|
||||
<div class="pt-8 article-pagination">
|
||||
<hr class="border-gray-300 border-dotted dark:border-gray-600" />
|
||||
<div class="flex justify-between pt-3">
|
||||
<span>
|
||||
{{ if .NextInSection }}
|
||||
<a class="flex" href="{{ .NextInSection.Permalink }}">
|
||||
<span class="mr-3">←</span>
|
||||
<span class="mr-3 article-pagination-direction">←</span>
|
||||
<span class="flex flex-col">
|
||||
<span class="button__text">{{ .NextInSection.Title }}</span>
|
||||
<span class="article-pagination-title">{{ .NextInSection.Title }}</span>
|
||||
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
|
||||
<time
|
||||
class="-mt-1 text-xs text-gray-400 dark:text-gray-500"
|
||||
|
@ -25,7 +25,7 @@
|
|||
{{ if .PrevInSection }}
|
||||
<a class="flex text-right" href="{{ .PrevInSection.Permalink }}">
|
||||
<span class="flex flex-col">
|
||||
<span>{{ .PrevInSection.Title }}</span>
|
||||
<span class="article-pagination-title">{{ .PrevInSection.Title }}</span>
|
||||
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
|
||||
<time
|
||||
class="-mt-1 text-xs text-gray-400 dark:text-gray-500"
|
||||
|
@ -35,7 +35,7 @@
|
|||
</time>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span class="ml-3">→</span>
|
||||
<span class="ml-3 article-pagination-direction">→</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
{{ end }}
|
||||
<div>
|
||||
{{ with .Site.Author.name }}
|
||||
<div class="text-[0.6rem] leading-3 text-gray-400 dark:text-gray-500 uppercase">
|
||||
{{ i18n "author.byline_title" | emojify }}
|
||||
</div>
|
||||
<div class="font-semibold leading-6 text-gray-800 dark:text-gray-300">
|
||||
{{ . }}
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<span
|
||||
class="ml-1 px-1 py-[2px] text-xs font-normal border rounded-md text-primary-700 dark:text-primary-400 border-primary-400 dark:border-primary-600 inline-block align-middle mb-1"
|
||||
class="ml-1 px-1 py-[1px] text-xs font-normal border rounded-md text-primary-700 dark:text-primary-400 border-primary-400 dark:border-primary-600 inline-block align-middle mb-1"
|
||||
>
|
||||
{{ . }}
|
||||
</span>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<ol class="text-sm text-gray-400 dark:text-gray-500">
|
||||
{{ template "crumb" (dict "p1" . "p2" .) }}
|
||||
</ol>
|
||||
{{ define "crumb" }}
|
||||
{{ if .p1.Parent }}
|
||||
{{ template "crumb" (dict "p1" .p1.Parent "p2" .p2 ) }}
|
||||
{{ else if not .p1.IsHome }}
|
||||
{{ template "crumb" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
|
||||
{{ end }}
|
||||
<li class="inline {{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{ end }}">
|
||||
<a class="hover:underline underline-gray-300 dark:underline-gray-600" href="{{ .p1.Permalink }}"
|
||||
>{{ .p1.Title }}</a
|
||||
><span class="px-1 text-primary-500">/</span>
|
||||
</li>
|
||||
{{ end }}
|
|
@ -12,10 +12,20 @@
|
|||
{{/* Theme attribution */}}
|
||||
{{ if .Site.Params.attribution | default true }}
|
||||
<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>
|
||||
{{ i18n "footer.powered_by" }}
|
||||
<a
|
||||
class="hover:underline underline-primary-300 hover:text-primary-400"
|
||||
href="https://gohugo.io/"
|
||||
target="_blank"
|
||||
>Hugo</a
|
||||
>
|
||||
&
|
||||
<a class="hover:underline" href="https://git.io/hugo-congo" target="_blank">Congo</a>
|
||||
<a
|
||||
class="hover:underline underline-primary-300 hover:text-primary-400"
|
||||
href="https://git.io/hugo-congo"
|
||||
target="_blank"
|
||||
>Congo</a
|
||||
>
|
||||
</p>
|
||||
{{ end }}
|
||||
{{/* Extend footer - eg. for extra scripts, etc. */}}
|
||||
|
|
|
@ -35,10 +35,10 @@
|
|||
{{ if templates.Exists "partials/favicons.html" }}
|
||||
{{ partialCached "favicons.html" .Site }}
|
||||
{{ else }}
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ "/apple-touch-icon.png" | absURL }}" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "/favicon-32x32.png" | absURL }}" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "/favicon-16x16.png" | absURL }}" />
|
||||
<link rel="manifest" href="{{ "/site.webmanifest" | absURL }}" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | absURL }}" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absURL }}" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absURL }}" />
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}" />
|
||||
{{ end }}
|
||||
{{/* Site Verification */}}
|
||||
{{ with .Site.Params.verification.google }}
|
||||
|
@ -57,7 +57,7 @@
|
|||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{/* Schema */}}
|
||||
{{ template "_internal/schema.html" . }}
|
||||
{{ partial "schema.html" . }}
|
||||
{{/* Generator */}}
|
||||
{{ if .Site.Params.attribution | default true }}
|
||||
{{ hugo.Generator }}
|
||||
|
|
|
@ -1,12 +1,22 @@
|
|||
<header class="flex justify-between py-6 font-semibold sm:py-10">
|
||||
<div>
|
||||
<a class="hover:underline" rel="me" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
<a
|
||||
class="hover:underline underline-primary-500 underline-thickness-bold underline-offset-small"
|
||||
rel="me"
|
||||
href="{{ .Site.BaseURL }}"
|
||||
>{{ .Site.Title }}</a
|
||||
>
|
||||
</div>
|
||||
<nav>
|
||||
<ul class="flex flex-col list-none sm:flex-row">
|
||||
{{ range .Site.Menus.main }}
|
||||
<li class="text-right sm:mr-7 sm:last:mr-0">
|
||||
<a class="hover:underline" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||
<a
|
||||
class="hover:underline underline-primary-500 underline-thickness-bold underline-offset-small"
|
||||
href="{{ .URL | absURL }}"
|
||||
title="{{ .Title }}"
|
||||
>{{ .Name }}</a
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
|
|
@ -6,3 +6,6 @@
|
|||
{{ end }}
|
||||
<section>{{ .Content | emojify }}</section>
|
||||
</article>
|
||||
<section>
|
||||
{{ partial "recent-articles.html" . }}
|
||||
</section>
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
<article
|
||||
class="flex flex-col items-center justify-center text-center
|
||||
{{ if not .Site.Params.homepage.showList -}}
|
||||
class="flex flex-col items-center justify-center text-center {{ if not .Site.Params.homepage.showRecent }}
|
||||
h-full
|
||||
{{- else -}}
|
||||
mb-8
|
||||
{{- end }}"
|
||||
{{ end }}"
|
||||
>
|
||||
<header class="flex flex-col items-center mb-3">
|
||||
<header class="flex flex-col mb-3">
|
||||
{{ with .Site.Author.image }}
|
||||
<img class="mb-2 rounded-full w-36 h-36" src="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
|
@ -19,3 +16,6 @@
|
|||
</header>
|
||||
<section class="prose dark:prose-light">{{ .Content | emojify }}</section>
|
||||
</article>
|
||||
<section class="text-center">
|
||||
{{ partial "recent-articles.html" . }}
|
||||
</section>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{{ if .Site.Params.homepage.showRecent | default false }}
|
||||
<h2 class="mt-8 text-2xl font-extrabold">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
|
||||
{{ range first 5 (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -0,0 +1,40 @@
|
|||
{{ if .IsHome -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"name": "{{ .Site.Title | safeJS }}",
|
||||
"url": "{{ .Site.BaseURL | safeURL }}",
|
||||
"description": "{{ .Site.Params.description | safeJS }}"
|
||||
}
|
||||
</script>
|
||||
{{ else if .IsPage }}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"articleSection": "{{ (site.GetPage .Section).Title }}",
|
||||
"name": "{{ .Title | safeJS }}",
|
||||
"headline": "{{ .Title | safeJS }}",
|
||||
"description": "{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}",
|
||||
{{ with .Site.LanguageCode }}"inLanguage": {{ . }},{{ end }}
|
||||
"author" : {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Author.name | safeJS }}"
|
||||
},
|
||||
"creator" : {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Author.name | safeJS }}"
|
||||
},
|
||||
"copyrightHolder": "{{ .Site.Author.name | safeJS }}",
|
||||
{{ with .PublishDate }}"copyrightYear": "{{ .Format "2006" }}",{{ end }}
|
||||
{{ with .PublishDate }}"dateCreated": "{{ .Format $iso8601 }}",{{ end }}
|
||||
{{ with .PublishDate }}"datePublished": "{{ .Format $iso8601 }}",{{ end }}
|
||||
{{ with .Lastmod }}"dateModified": "{{ .Format $iso8601 }}",{{ end }}
|
||||
"url" : "{{ .Permalink }}",
|
||||
"wordCount": "{{ .WordCount }}",
|
||||
"keywords": [{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}]
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
|
@ -0,0 +1,9 @@
|
|||
<header>
|
||||
{{ if .Site.Params.list.showBreadcrumbs | default false }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
{{ end }}
|
||||
<section class="prose dark:prose-light">
|
||||
<h1 class="mb-3 text-4xl font-extrabold">{{ .Title }}</h1>
|
||||
<section>{{ .Content }}</section>
|
||||
</section>
|
||||
</header>
|
|
@ -1,4 +0,0 @@
|
|||
<section class="prose dark:prose-light">
|
||||
<h1 class="mb-3 text-4xl font-extrabold">{{ .Title }}</h1>
|
||||
<section>{{ .Content }}</section>
|
||||
</section>
|
|
@ -6,7 +6,7 @@
|
|||
<a
|
||||
class="bg-gray-300 text-gray-700 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-primary-400 dark:hover:text-gray-800 m-1 hover:bg-primary-500 hover:text-white rounded min-w-[2.4rem] inline-block text-center p-1"
|
||||
href="{{ printf .url $.Permalink $.Title }}"
|
||||
title="{{ .title }}"
|
||||
title="{{ i18n .title }}"
|
||||
>{{ partial "icon.html" .icon }}</a
|
||||
>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<a
|
||||
class="px-4 py-2 !text-white !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
|
||||
<button
|
||||
class="px-4 py-1 !text-white !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
|
||||
{{ with .Get "href" }}href="{{ . }}"{{ end }}
|
||||
{{ with .Get "target" }}target="{{ . }}"{{ end }}
|
||||
role="button"
|
||||
>{{ .Inner }}
|
||||
</a>
|
||||
>
|
||||
{{ .Inner }}
|
||||
</button>
|
||||
|
|
|
@ -1,37 +1,29 @@
|
|||
{{ if .Get "src" }}
|
||||
{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
|
||||
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||||
{{- if .Get "link" -}}
|
||||
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
|
||||
{{- end -}}
|
||||
<img src="{{ $image.RelPermalink }}"
|
||||
{{- if or (.Get "alt") (.Get "caption") }}
|
||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
||||
{{- end -}}
|
||||
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
|
||||
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
|
||||
/><!-- Closing img tag -->
|
||||
{{- if .Get "link" }}</a>{{ end -}}
|
||||
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
||||
<figcaption>
|
||||
{{ with (.Get "title") -}}
|
||||
<h4>{{ . }}</h4>
|
||||
{{- end -}}
|
||||
{{- if or (.Get "caption") (.Get "attr") -}}<p>
|
||||
{{- .Get "caption" | markdownify -}}
|
||||
{{- with .Get "attrlink" }}
|
||||
<a href="{{ . }}">
|
||||
{{- end -}}
|
||||
{{- .Get "attr" | markdownify -}}
|
||||
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
||||
{{- end }}
|
||||
</figcaption>
|
||||
<figure{{ with .Get "class" }} class="{{ . }}"{{ end -}}>
|
||||
{{- if .Get "link" -}}
|
||||
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
|
||||
{{- end -}}
|
||||
<img src="{{ $image.Permalink }}"
|
||||
{{- if or (.Get "alt") (.Get "caption") }}
|
||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
|
||||
{{- end -}}
|
||||
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
|
||||
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
|
||||
/>
|
||||
{{- if .Get "link" }}</a>{{ end -}}
|
||||
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
||||
<figcaption>
|
||||
{{ with (.Get "title") -}}<h4>{{ . }}</h4>{{- end -}}
|
||||
{{- if or (.Get "caption") (.Get "attr") -}}<p>
|
||||
{{- .Get "caption" | markdownify -}}
|
||||
{{- with .Get "attrlink" }}<a href="{{ . }}">{{- end -}}
|
||||
{{- .Get "attr" | markdownify -}}
|
||||
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
||||
{{- end }}
|
||||
</figcaption>
|
||||
{{- end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
{{ if $icon }}
|
||||
{{ $icon.Content | safeHTML }}
|
||||
{{ else }}
|
||||
<em>Icon not found.</em>
|
||||
<em>{{ i18n "shortcode.icon_none" }}</em>
|
||||
{{ end }}
|
||||
</span>
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
{
|
||||
"name": "congo",
|
||||
"name": "hugo-congo-theme",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "congo",
|
||||
"name": "hugo-congo-theme",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@tailwindcss/typography": "^0.4.1",
|
||||
"prettier": "^2.3.2",
|
||||
"prettier-plugin-go-template": "^0.0.11",
|
||||
"tailwind-underline-utils": "^1.1.3",
|
||||
"tailwindcss": "^2.2.7"
|
||||
}
|
||||
},
|
||||
|
@ -1379,6 +1380,12 @@
|
|||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/tailwind-underline-utils": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/tailwind-underline-utils/-/tailwind-underline-utils-1.1.3.tgz",
|
||||
"integrity": "sha512-8FSynb8KOBFj7Y1wurCzx0MBAQtdOuRWlCk5wXFImI5ZfJ2yiRLvNbybiJ6pjWz5Htr+lStnowcTXl/00s8xRw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/tailwindcss": {
|
||||
"version": "2.2.7",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.2.7.tgz",
|
||||
|
@ -2587,6 +2594,12 @@
|
|||
"has-flag": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"tailwind-underline-utils": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/tailwind-underline-utils/-/tailwind-underline-utils-1.1.3.tgz",
|
||||
"integrity": "sha512-8FSynb8KOBFj7Y1wurCzx0MBAQtdOuRWlCk5wXFImI5ZfJ2yiRLvNbybiJ6pjWz5Htr+lStnowcTXl/00s8xRw==",
|
||||
"dev": true
|
||||
},
|
||||
"tailwindcss": {
|
||||
"version": "2.2.7",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.2.7.tgz",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "congo",
|
||||
"name": "hugo-congo-theme",
|
||||
"version": "1.0.0",
|
||||
"description": "Congo theme for Hugo",
|
||||
"main": "index.js",
|
||||
|
@ -28,6 +28,7 @@
|
|||
"@tailwindcss/typography": "^0.4.1",
|
||||
"prettier": "^2.3.2",
|
||||
"prettier-plugin-go-template": "^0.0.11",
|
||||
"tailwind-underline-utils": "^1.1.3",
|
||||
"tailwindcss": "^2.2.7"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
#!bin/bash
|
||||
|
||||
# get current branch
|
||||
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
||||
|
||||
# push any local changes
|
||||
git push
|
||||
|
||||
# checkout stable branch (this will catch uncommitted changes)
|
||||
git checkout stable || exit 1
|
||||
|
||||
# branch validation
|
||||
if [ $branch = "dev" ]; then
|
||||
echo "Enter the release version (eg. v1.0.0):"
|
||||
read version
|
||||
|
||||
echo "Started releasing $version for Congo..."
|
||||
|
||||
# pull latest from stable
|
||||
git pull
|
||||
|
||||
# merge in changes from dev branch
|
||||
git merge --no-ff dev -m "🔖 Release $version"
|
||||
|
||||
# create tag
|
||||
git tag $version
|
||||
|
||||
# push commit and tag to remote
|
||||
git push
|
||||
git push --tags
|
||||
|
||||
echo "$version successfully released!"
|
||||
echo "Returning to dev branch..."
|
||||
|
||||
git checkout dev
|
||||
|
||||
else
|
||||
echo "Releases can only be published from the dev branch!"
|
||||
fi
|
File diff suppressed because one or more lines are too long
|
@ -19,6 +19,12 @@ module.exports = {
|
|||
primary: colors.violet,
|
||||
secondary: colors.fuchsia,
|
||||
},
|
||||
underlineOffset: {
|
||||
small: "2px",
|
||||
},
|
||||
underlineThickness: {
|
||||
bold: "2px",
|
||||
},
|
||||
extend: {
|
||||
typography: (theme) => ({
|
||||
DEFAULT: {
|
||||
|
@ -27,13 +33,18 @@ module.exports = {
|
|||
a: {
|
||||
color: theme("colors.primary.700"),
|
||||
textDecoration: "underline",
|
||||
textDecorationColor: theme("colors.primary.300"),
|
||||
fontWeight: "500",
|
||||
"&:hover": {
|
||||
backgroundColor: theme("colors.primary.600"),
|
||||
borderRadius: "0.09rem",
|
||||
color: theme("colors.white"),
|
||||
textDecoration: "none",
|
||||
},
|
||||
},
|
||||
blockquote: {
|
||||
borderLeftColor: theme("colors.primary.200"),
|
||||
},
|
||||
h2: {
|
||||
position: "relative",
|
||||
},
|
||||
|
@ -73,6 +84,7 @@ module.exports = {
|
|||
color: theme("colors.gray.400"),
|
||||
a: {
|
||||
color: theme("colors.primary.400"),
|
||||
textDecorationColor: theme("colors.gray.500"),
|
||||
},
|
||||
strong: {
|
||||
color: theme("colors.white"),
|
||||
|
@ -88,7 +100,7 @@ module.exports = {
|
|||
},
|
||||
blockquote: {
|
||||
color: theme("colors.gray.200"),
|
||||
borderLeftColor: theme("colors.gray.600"),
|
||||
borderLeftColor: theme("colors.primary.900"),
|
||||
},
|
||||
h1: {
|
||||
color: theme("colors.white"),
|
||||
|
@ -143,5 +155,5 @@ module.exports = {
|
|||
typography: ["dark"],
|
||||
},
|
||||
},
|
||||
plugins: [require("@tailwindcss/typography")],
|
||||
plugins: [require("@tailwindcss/typography"), require("tailwind-underline-utils")],
|
||||
};
|
||||
|
|
14
theme.toml
14
theme.toml
|
@ -2,13 +2,17 @@
|
|||
|
||||
name = "Congo"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/jpanther/hugo-congo/blob/master/LICENSE"
|
||||
description = "A simple, clean Hugo theme based on Tailwind CSS"
|
||||
homepage = "http://github.com/jpanther/hugo-congo/"
|
||||
tags = ["blog", "minimal", "dark mode", "dark", "light", "tailwind"]
|
||||
features = ["syntax higlighting", "dark mode", "emoji"]
|
||||
licenselink = "https://github.com/jpanther/Congo/blob/master/LICENSE"
|
||||
description = "A simple, lightweight theme for Hugo built with Tailwind CSS."
|
||||
|
||||
min_version = "0.86.1"
|
||||
|
||||
homepage = "https://github.com/jpanther/Congo/"
|
||||
demosite = "https://jpanther.github.io/Congo/"
|
||||
|
||||
tags = ["blog", "minimal", "responsive", "dark mode", "dark", "light", "tailwind", "personal"]
|
||||
features = ["syntax higlighting", "dark mode", "emoji"]
|
||||
|
||||
[author]
|
||||
name = "James Panther"
|
||||
homepage = "https://jamespanther.com/"
|
||||
|
|
Loading…
Reference in New Issue