diff --git a/.gitignore b/.gitignore index 00eab0b..f9131ea 100644 --- a/.gitignore +++ b/.gitignore @@ -135,6 +135,7 @@ dist # Generated files by hugo /public/ /resources/_gen/ +.hugo_build.lock # Executable may be added to repository hugo.exe diff --git a/CHANGELOG.md b/CHANGELOG.md index e49dfff..5470b1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.0] - 2021-11-06 + +### Added + +- Support for Amazon, Apple, Flickr, Google, Kickstarter, Microsoft, Patreon, Telegram, Tumblr and WhatsApp +- Ability to override individual link parameters +- Support for basic content pages +- French translation ([#2](https://github.com/jpanther/lynx/pull/2)) + +### Fixed + +- Typo in GitLab link text +- Minor styling issues + +## [1.0.0] - 2021-11-01 + ### Added - Built with Tailwind CSS JIT for minified stylesheets without any excess code @@ -16,3 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - HTML and Emoji support - Fathom Analytics and Google Analytics support - Favicons support + +[unreleased]: https://github.com/jpanther/lynx/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/jpanther/lynx/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/jpanther/lynx/releases/tags/v1.0.0 diff --git a/README.md b/README.md index b7ffab9..c876c01 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Below is a quick start guide using Hugo modules. 4. In the root folder of your website, replace the `config.toml` file that was generated by Hugo with the one from Lynx. You will find the theme config file in the Hugo cache directory, or [download a copy](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/jpanther/lynx/tree/stable/config.toml) from GitHub. -5. Edit the settings in the `config.toml` file to suit your needs. You can also create a `content/_index.md` file to add additional text to your site. +5. Follow the [configuration instructions](#configuration) below. ### Installing theme updates @@ -55,6 +55,78 @@ As new releases are posted, you can update the theme using Hugo. Simply run `hug --- +## Configuration + +The main theme configuration is managed in the `config.toml` file. Most parameters are self explanatory and the default config contains some basic examples. + +The author name and image are displayed at the top of the page. Both are optional and will default to the site title with no image when not provided. + +Links can either be a simple string containing the URL for the link, or an object that defines the link parameters. Links are displayed in the order provided in the config file. + +Acceptable link parameters are: + +- `href` = the URL the link should point to (required) +- `icon` = the name of the icon to use for this link +- `text` = the link text +- `target` = the target of the link (default: `_blank`) +- `title` = the HTML title of the link + +```toml +[author] +links = { + # Simple link + { github = "https://github.com/jpanther/lynx" } + + # Custom link + { github = { href = "https://github.com/jpanther/lynx", text = "GitHub Project" } } +} +``` + +Additional page content can be provided by creating a Markdown file at `content/_index.md`. The contents of this file will be displayed between the title and links. Check out the exampleSite to see this in practice. + +Basic content pages can also be created by placing Markdown files in the `content` directory. These can then be linked to using links in the config file or through the homepage content. + +### Adding custom icons and link styles + +Lynx supports adding your own SVG icons and link styles to fully customise your links page. In the **root of your Hugo project**, simply create an `assets` folder and add your assets. Icons should be placed in an `icons` folder and any CSS should be in a file named `css/custom.css`. + +The custom CSS file will automatically be included and minified when the site is built. The styles can be as creative as you wish and anything in your custom CSS will override the default theme. + +If you need icons, you can find free SVG icons for many services at [FontAwesome](https://fontawesome.com/icons?d=gallery&p=2&s=brands). + +#### Example + +Let's make a custom link for FontAwesome using the FA flag as the link icon and a gradient background as the link style. + +> If you prefer to inspect the code, the exampleSite contains a custom link to FontAwesome that demonstrates this process. + +1. Place the SVG icon in the icons folder `/assets/icons/font-awesome.svg`. +2. Create the CSS file at `/assets/css/custom.css` and add in a rule to style the link: + + ```css + .link-font-awesome { + background: rgb(131, 58, 180); + background: linear-gradient( + 90deg, + rgba(131, 58, 180, 1) 0%, + rgba(253, 29, 29, 1) 50%, + rgba(252, 176, 69, 1) 100% + ); + } + ``` + + _Note: The CSS class name should be the icon name prefixed with `link-`._ + +3. Finally, in the `config.toml` file, create the link by referencing the new icon: + + ```toml + font-awesome = { href = "https://fontawesome.com", text = "FontAwesome" } + ``` + +When the site is rebuilt, the new custom link will appear. + +--- + ## Contributing Lynx is expected to evolve over time. I intend to keep adding features and making changes as required. diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 163d8b8..b88a4cb 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1,4 +1,4 @@ -/*! Lynx v1.0.0 | MIT License | https://github.com/jpanther/lynx */ +/*! Lynx v1.1.0 | MIT License | https://github.com/jpanther/lynx */ /*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com */ @@ -782,7 +782,7 @@ video { } .prose code { - color: #111827; + color: #6b21a8; font-weight: 600; font-size: 0.875em; } @@ -1003,15 +1003,11 @@ video { } .prose mark { + background-color: #e9d5ff; padding: 0.1rem 0.2rem; border-radius: 0.12rem; } -body a, -body button { - /* @apply transition; */ -} - /* Scale SVG icons to text size */ .icon svg { @@ -1033,6 +1029,16 @@ body button { filter: var(--tw-filter); } +.link-amazon { + --tw-text-opacity: 1; + color: rgba(24, 24, 27, var(--tw-text-opacity)); + background-color: #ff9900; +} + +.link-apple { + background-color: #333; +} + .link-codepen { background-color: #1e1f26; } @@ -1053,6 +1059,10 @@ body button { background-color: #1877f2; } +.link-flickr { + background-color: #ff0184; +} + .link-foursquare { background-color: #0732a2; } @@ -1065,6 +1075,10 @@ body button { background-color: #554488; } +.link-google { + background-color: #4285f4; +} + .link-instagram { background-color: #c13584; background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d); @@ -1074,6 +1088,12 @@ body button { background-color: #33a0ff; } +.link-kickstarter { + --tw-text-opacity: 1; + color: rgba(24, 24, 27, var(--tw-text-opacity)); + background-color: #06ce78; +} + .link-lastfm { background-color: #d51007; } @@ -1090,10 +1110,18 @@ body button { background-color: #00ab6c; } +.link-microsoft { + background-color: #08a6f0; +} + .link-orcid { background-color: #a6ce39; } +.link-patreon { + background-color: #ff434d; +} + .link-pinterest { background-color: #e60023; } @@ -1125,10 +1153,18 @@ body button { background-color: #000; } +.link-telegram { + background-color: #25a3e1; +} + .link-tiktok { background-color: #fe2d55; } +.link-tumblr { + background-color: #001935; +} + .link-twitch { background-color: #9146ff; } @@ -1137,10 +1173,39 @@ body button { background-color: #1da1f2; } +.link-whatsapp { + background-color: #45d82c; + background: linear-gradient(120deg, #12990b, #45d82c); +} + .link-youtube { background-color: #ff0000; } +/* -- Chroma Highlight -- */ + +/* Background */ + +.prose .chroma { + border-radius: 0.375rem; + --tw-bg-opacity: 1; + background-color: rgba(250, 250, 250, var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgba(63, 63, 70, var(--tw-text-opacity)); +} + +@media (prefers-color-scheme: dark) { + .prose .chroma { + --tw-bg-opacity: 1; + background-color: rgba(63, 63, 70, var(--tw-bg-opacity)); + } + + .prose .chroma { + --tw-text-opacity: 1; + color: rgba(228, 228, 231, var(--tw-text-opacity)); + } +} + .relative { position: relative; } @@ -1169,6 +1234,14 @@ body button { margin-right: 0.25rem; } +.mt-2 { + margin-top: 0.5rem; +} + +.mb-6 { + margin-bottom: 1.5rem; +} + .\!mb-9 { margin-bottom: 2.25rem !important; } @@ -1229,6 +1302,10 @@ body button { justify-content: center; } +.place-self-start { + place-self: start; +} + .rounded-full { border-radius: 9999px; } @@ -1302,6 +1379,16 @@ body button { color: rgba(24, 24, 27, var(--tw-text-opacity)); } +.text-neutral-500 { + --tw-text-opacity: 1; + color: rgba(113, 113, 122, var(--tw-text-opacity)); +} + +.text-neutral-800 { + --tw-text-opacity: 1; + color: rgba(39, 39, 42, var(--tw-text-opacity)); +} + .text-neutral-400 { --tw-text-opacity: 1; color: rgba(161, 161, 170, var(--tw-text-opacity)); @@ -1374,6 +1461,7 @@ body button { } .dark\:prose-light code { + color: #a855f7; } .dark\:prose-light a code { @@ -1404,6 +1492,7 @@ body button { } .dark\:prose-light mark { + background-color: #c084fc; } .dark\:bg-neutral-800 { diff --git a/assets/css/main.css b/assets/css/main.css index 264cb06..dc41b28 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,13 +1,8 @@ -/*! Lynx v1.0.0 | MIT License | https://github.com/jpanther/lynx */ +/*! Lynx v1.1.0 | MIT License | https://github.com/jpanther/lynx */ @tailwind base; @tailwind components; -body a, -body button { - /* @apply transition; */ -} - /* Scale SVG icons to text size */ .icon svg { height: 1em; @@ -19,6 +14,13 @@ body button { @apply text-white bg-primary-700 hover:brightness-90; } +.link-amazon { + @apply text-neutral-900; + background-color: #ff9900; +} +.link-apple { + background-color: #333; +} .link-codepen { background-color: #1e1f26; } @@ -34,6 +36,9 @@ body button { .link-facebook { background-color: #1877f2; } +.link-flickr { + background-color: #ff0184; +} .link-foursquare { background-color: #0732a2; } @@ -43,6 +48,9 @@ body button { .link-gitlab { background-color: #554488; } +.link-google { + background-color: #4285f4; +} .link-instagram { background-color: #c13584; background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d); @@ -50,6 +58,10 @@ body button { .link-keybase { background-color: #33a0ff; } +.link-kickstarter { + @apply text-neutral-900; + background-color: #06ce78; +} .link-lastfm { background-color: #d51007; } @@ -62,9 +74,15 @@ body button { .link-medium { background-color: #00ab6c; } +.link-microsoft { + background-color: #08a6f0; +} .link-orcid { background-color: #a6ce39; } +.link-patreon { + background-color: #ff434d; +} .link-pinterest { background-color: #e60023; } @@ -88,17 +106,33 @@ body button { .link-steam { background-color: #000; } +.link-telegram { + background-color: #25a3e1; +} .link-tiktok { background-color: #fe2d55; } +.link-tumblr { + background-color: #001935; +} .link-twitch { background-color: #9146ff; } .link-twitter { background-color: #1da1f2; } +.link-whatsapp { + background-color: #45d82c; + background: linear-gradient(120deg, #12990b, #45d82c); +} .link-youtube { background-color: #ff0000; } +/* -- Chroma Highlight -- */ +/* Background */ +.prose .chroma { + @apply rounded-md text-neutral-700 bg-neutral-50 dark:bg-neutral-700 dark:text-neutral-200; +} + @tailwind utilities; diff --git a/assets/icons/amazon.svg b/assets/icons/amazon.svg new file mode 100644 index 0000000..b2b8a56 --- /dev/null +++ b/assets/icons/amazon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/apple.svg b/assets/icons/apple.svg new file mode 100644 index 0000000..4adc2be --- /dev/null +++ b/assets/icons/apple.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/flickr.svg b/assets/icons/flickr.svg new file mode 100644 index 0000000..74796f5 --- /dev/null +++ b/assets/icons/flickr.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/google.svg b/assets/icons/google.svg new file mode 100644 index 0000000..2218d96 --- /dev/null +++ b/assets/icons/google.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/kickstarter.svg b/assets/icons/kickstarter.svg new file mode 100644 index 0000000..6ff5928 --- /dev/null +++ b/assets/icons/kickstarter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/microsoft.svg b/assets/icons/microsoft.svg new file mode 100644 index 0000000..4920b87 --- /dev/null +++ b/assets/icons/microsoft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/patreon.svg b/assets/icons/patreon.svg new file mode 100644 index 0000000..6fe623e --- /dev/null +++ b/assets/icons/patreon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/telegram.svg b/assets/icons/telegram.svg new file mode 100644 index 0000000..49bd008 --- /dev/null +++ b/assets/icons/telegram.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tumblr.svg b/assets/icons/tumblr.svg new file mode 100644 index 0000000..84ed909 --- /dev/null +++ b/assets/icons/tumblr.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/whatsapp.svg b/assets/icons/whatsapp.svg new file mode 100644 index 0000000..9a37967 --- /dev/null +++ b/assets/icons/whatsapp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config.toml b/config.toml index a51b3fa..e730bd0 100644 --- a/config.toml +++ b/config.toml @@ -10,33 +10,44 @@ disableKinds = ["taxonomy", "term"] [author] # name = "Your name here" - # image = "img/author.jpg" + # image = "img/author.jpg" # path relative to static directory + links = [ # { email = "mailto:hello@your_domain.com" }, # { link = "https://link-to-some-website.com/" }, + # { amazon = "https://www.amazon.com/hz/wishlist/ls/wishlist-id" }, + # { apple = "https://www.apple.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" }, + # { flickr = "https://www.flickr.com/photos/username/" }, # { foursquare = "https://foursquare.com/username" }, # { github = "https://github.com/username" }, # { gitlab = "https://gitlab.com/username" }, + # { google = "https://www.google.com/" }, # { instagram = "https://instagram.com/username" }, # { keybase = "https://keybase.io/username" }, + # { kickstarter = "https://www.kickstarter.com/profile/username" }, # { lastfm = "https://lastfm.com/user/username" }, # { linkedin = "https://linkedin.com/in/username" }, # { mastodon = "https://mastodon.instance/@username" }, # { medium = "https://medium.com/username" }, + # { microsoft = "https://www.microsoft.com/" }, + # { patreon = "https://www.patreon.com/username" }, # { pinterest = "https://pinterest.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" }, + # { telegram = "https://t.me/username" }, # { tiktok = "https://tiktok.com/@username" }, + # { tumblr = "https://username.tumblr.com" }, # { twitch = "https://twitch.tv/username" }, # { twitter = "https://twitter.com/username" }, + # { whatsapp = "https://wa.me/phone-number" }, # { youtube = "https://youtube.com/username" }, ] diff --git a/exampleSite/assets/css/custom.css b/exampleSite/assets/css/custom.css new file mode 100644 index 0000000..357abab --- /dev/null +++ b/exampleSite/assets/css/custom.css @@ -0,0 +1,9 @@ +.link-font-awesome { + background: rgb(131, 58, 180); + background: linear-gradient( + 90deg, + rgba(131, 58, 180, 1) 0%, + rgba(253, 29, 29, 1) 50%, + rgba(252, 176, 69, 1) 100% + ); +} diff --git a/exampleSite/assets/icons/font-awesome.svg b/exampleSite/assets/icons/font-awesome.svg new file mode 100644 index 0000000..14a465d --- /dev/null +++ b/exampleSite/assets/icons/font-awesome.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8f9d4ba..1c227ca 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,9 +1,5 @@ theme = "lynx" -languageCode = "en-au" -defaultContentLanguage = "en" - title = "Lynx" -# copyright = "Copy, _right?_ :thinking_face:" enableEmoji = true disableKinds = ["taxonomy", "term"] @@ -12,9 +8,16 @@ disableKinds = ["taxonomy", "term"] name = "Lynx" image = "author.jpg" links = [ + { link = { href = "https://github.com/jpanther/lynx/blob/stable/README.md", text = "View the readme", icon = "github" } }, + { link = { href = "styles/", text = "All the link styles", target = "_self" } }, { github = "https://github.com/jpanther/lynx" }, - { discord = "https://discord.gg/invitecode" }, - { instagram = "https://instagram.com/username" }, - { soundcloud = "https://soundcloud.com/username" }, - { twitter = "https://twitter.com/username" }, + { twitter = "https://twitter.com/jpanther" }, + { font-awesome = { href = "https://fontawesome.com/", text = "FontAwesome" } }, ] + +[markup.highlight] + noClasses = false + +[markup.goldmark] +[markup.goldmark.renderer] + unsafe = true diff --git a/exampleSite/content/styles.md b/exampleSite/content/styles.md new file mode 100644 index 0000000..a9d6f46 --- /dev/null +++ b/exampleSite/content/styles.md @@ -0,0 +1,45 @@ +--- +title: Link styles +--- + +These are all the built-in link styles available in Lynx. Don't forget that you can also create your own styles --- check the [readme](https://github.com/jpanther/lynx/blob/stable/README.md) for more details. +

+ + +
+{{< link email >}} +{{< link link >}} +{{< link amazon >}} +{{< link apple >}} +{{< link codepen >}} +{{< link dev >}} +{{< link discord >}} +{{< link dribbble >}} +{{< link facebook >}} +{{< link flickr >}} +{{< link foursquare >}} +{{< link github >}} +{{< link gitlab >}} +{{< link google >}} +{{< link instagram >}} +{{< link keybase >}} +{{< link kickstarter >}} +{{< link lastfm >}} +{{< link linkedin >}} +{{< link mastodon >}} +{{< link medium >}} +{{< link microsoft >}} +{{< link patreon >}} +{{< link pinterest >}} +{{< link reddit >}} +{{< link slack >}} +{{< link snapchat >}} +{{< link soundcloud >}} +{{< link steam >}} +{{< link telegram >}} +{{< link tiktok >}} +{{< link tumblr >}} +{{< link twitch >}} +{{< link twitter >}} +{{< link whatsapp >}} +{{< link youtube >}} diff --git a/exampleSite/layouts/shortcodes/link.html b/exampleSite/layouts/shortcodes/link.html new file mode 100644 index 0000000..09789bd --- /dev/null +++ b/exampleSite/layouts/shortcodes/link.html @@ -0,0 +1,8 @@ + + {{ partial "icon.html" (.Get 0) }} + {{ .Get 0 }} + diff --git a/exampleSite/static/author.jpg b/exampleSite/static/author.jpg index 820e882..7a23be5 100644 Binary files a/exampleSite/static/author.jpg and b/exampleSite/static/author.jpg differ diff --git a/i18n/en.yaml b/i18n/en.yaml index bcfb6b8..0121695 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,21 +1,28 @@ link: + amazon: Amazon + apple: Apple codepen: CodePen dev: DEV discord: Discord dribbble: Dribbble email: Email facebook: Facebook + flickr: Flickr foursquare: Foursquare github: GitHub - gitlab: Gitlab + gitlab: GitLab + google: Google instagram: Instagram keybase: Keybase + kickstarter: Kickstarter lastfm: Last.fm link: Website linkedin: LinkedIn mastodon: Mastodon medium: Medium + microsoft: Microsoft orcid: ORCiD + patreon: Patreon pinterest: Pinterest reddit: Reddit researchgate: ResearchGate @@ -23,10 +30,16 @@ link: snapchat: Snapchat soundcloud: Soundcloud steam: Steam + telegram: Telegram tiktok: TikTok + tumblr: Tumblr twitch: Twitch twitter: Twitter + whatsapp: WhatsApp youtube: YouTube +nav: + home: Home + footer: powered_by: "Powered by {{ .Hugo }} & {{ .Lynx }}" diff --git a/i18n/fr.yaml b/i18n/fr.yaml new file mode 100644 index 0000000..b2558b4 --- /dev/null +++ b/i18n/fr.yaml @@ -0,0 +1,45 @@ +link: + amazon: Amazon + apple: Apple + codepen: CodePen + dev: DEV + discord: Discord + dribbble: Dribbble + email: Email + facebook: Facebook + flickr: Flickr + foursquare: Foursquare + github: GitHub + gitlab: GitLab + google: Google + instagram: Instagram + keybase: Keybase + kickstarter: Kickstarter + lastfm: Last.fm + link: "Site internet" + linkedin: LinkedIn + mastodon: Mastodon + medium: Medium + microsoft: Microsoft + orcid: ORCiD + patreon: Patreon + pinterest: Pinterest + reddit: Reddit + researchgate: ResearchGate + slack: Slack + snapchat: Snapchat + soundcloud: Soundcloud + steam: Steam + telegram: Telegram + tiktok: TikTok + tumblr: Tumblr + twitch: Twitch + twitter: Twitter + whatsapp: WhatsApp + youtube: YouTube + +# nav: +# home: Home + +footer: + powered_by: "Propulsé par {{ .Hugo }} & {{ .Lynx }}" diff --git a/images/screenshot.png b/images/screenshot.png index 2f52ca2..28eb781 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index f2b80c8..af6211c 100644 Binary files a/images/tn.png and b/images/tn.png differ diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 99bd920..4c058e3 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,7 +2,7 @@ {{- partial "head.html" . -}}
{{- block "main" . }}{{- end }}
{{- partial "footer.html" . -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..1360ae3 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,15 @@ +{{ define "main" }} +
+ +
+

+ {{ .Title | emojify }} +

+
+
+ {{ .Content | emojify }} +
+
+{{ end }} diff --git a/layouts/index.html b/layouts/index.html index a5fb629..d444ff8 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -14,22 +14,34 @@ {{ with .Site.Author.links }}
{{ range $links := . }} - {{ range $name, $url := $links }} + {{ range $type, $data := $links }} + {{ $href := $data }} + {{ $icon := $type }} + {{ $text := i18n (printf "link.%s" $type) }} + {{ $target := "_blank" }} + {{ $title := "" }} + {{ if reflect.IsMap $data }} + {{ with $data.href }}{{ $href = . }}{{ end }} + {{ with $data.icon }}{{ $icon = . }}{{ end }} + {{ with $data.text }}{{ $text = . }}{{ end }} + {{ with $data.target }}{{ $target = . }}{{ end }} + {{ with $data.title }}{{ $title = . }}{{ end }} + {{ end }}
- {{ partial "icon.html" $name }}{{ i18n (printf "link.%s" $name) }} -
+ {{- with $icon -}} + {{ partial "icon.html" . }} + {{- end -}} + {{ $text | emojify }} + {{ end }} {{ end }}
{{ end }} - {{ end }} diff --git a/layouts/partials/icon.html b/layouts/partials/icon.html index cde57b9..831697a 100644 --- a/layouts/partials/icon.html +++ b/layouts/partials/icon.html @@ -1,6 +1,6 @@ - - {{ $icon := resources.Get (print "icons/" . ".svg") }} - {{ if $icon }} +{{ $icon := resources.Get (print "icons/" . ".svg") }} +{{ if $icon }} + {{ $icon.Content | safeHTML }} - {{ end }} - + +{{ end }} diff --git a/package-lock.json b/package-lock.json index e394f46..ded6560 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hugo-lynx-theme", - "version": "1.4.0", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "hugo-lynx-theme", - "version": "1.4.0", + "version": "1.0.0", "license": "MIT", "devDependencies": { "@tailwindcss/typography": "^0.4.1", diff --git a/package.json b/package.json index 5c7011b..e645198 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-lynx-theme", - "version": "0.0.1", + "version": "1.1.0", "description": "Lynx theme for Hugo", "scripts": { "dev": "NODE_ENV=development ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit -w", diff --git a/tailwind.config.js b/tailwind.config.js index 50759a8..1545014 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -68,7 +68,7 @@ module.exports = { position: "relative", }, code: { - color: theme("colors.secondary.700"), + color: theme("colors.primary.800"), }, "pre code": { color: theme("colors.neutral.700"), @@ -95,7 +95,7 @@ module.exports = { fontWeight: "600", }, mark: { - backgroundColor: theme("colors.secondary.200"), + backgroundColor: theme("colors.primary.200"), padding: "0.1rem 0.2rem", borderRadius: "0.12rem", }, @@ -142,7 +142,7 @@ module.exports = { color: theme("colors.neutral.400"), }, code: { - color: theme("colors.secondary.400"), + color: theme("colors.primary.500"), }, "a code": { color: theme("colors.white"), @@ -166,7 +166,7 @@ module.exports = { color: theme("colors.neutral.300"), }, mark: { - backgroundColor: theme("colors.secondary.400"), + backgroundColor: theme("colors.primary.400"), }, }, ],