From 0db000a841927f57483098a7d234da6900f40532 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 7 Jun 2020 20:02:12 +0100 Subject: [PATCH] feat: add options to add author notes + highlight superuser To highlight the site author (superuser) in author lists, set the following in `params.toml`: highlight_superuser = true Author notes can be added to a page's front matter in the form: author_notes: - "Equal contribution" - "Equal contribution" --- README.md | 38 +++++++++++++------ assets/scss/academic/_content.scss | 6 +++ exampleSite/config/_default/params.toml | 3 ++ .../publication/journal-article/index.md | 3 ++ layouts/partials/page_metadata_authors.html | 7 +++- netlify.toml | 2 +- 6 files changed, 45 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 878708e6..ffdae08c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ **Create a free website with Academic using Markdown, Jupyter, or RStudio. Choose a beautiful color theme and build anything with the Page Builder - over 50 _widgets_, _themes_, and _language packs_ included!** -[Check out the latest **demo**](https://academic-demo.netlify.com/) of what you'll get in less than 10 minutes, or [view the **showcase**](https://sourcethemes.com/academic/#expo) of personal, project, and business sites. +[Check out the latest **demo**](https://academic-demo.netlify.app) of what you'll get in less than 10 minutes, or [view the **showcase**](https://sourcethemes.com/academic/#expo) of personal, project, and business sites. - 👉 [**Get Started**](https://sourcethemes.com/academic/docs/install/) - 📚 [View the **documentation**](https://sourcethemes.com/academic/docs/) @@ -16,7 +16,7 @@ - ⬆️ **Updating?** View the [Update Guide](https://sourcethemes.com/academic/docs/update/) and [Release Notes](https://sourcethemes.com/academic/updates/) - :heart: **Support development** of Academic: - ☕️ [**Donate a coffee**](https://paypal.me/cushen) - - 💵 [Become a backer on **Patreon**](https://www.patreon.com/cushen) + - 💵 [Become a backer on **Patreon** and **unlock rewards**](https://www.patreon.com/cushen) - 🖼️ [Decorate your laptop or journal with an Academic **sticker**](https://www.redbubble.com/people/neutreno/works/34387919-academic) - 👕 [Wear the **T-shirt**](https://academic.threadless.com/) - :woman_technologist: [**Contribute**](https://sourcethemes.com/academic/docs/contribute/) @@ -43,7 +43,7 @@ ## Themes -Academic comes with **automatic day (light) and night (dark) mode** built-in. Alternatively, click the sun/moon icon in the top right of the [Demo](https://academic-demo.netlify.com/) to set your preferred mode! +Academic comes with **automatic day (light) and night (dark) mode** built-in. Alternatively, click the sun/moon icon in the top right of the [Demo](https://academic-demo.netlify.app) to set your preferred mode! Choose a stunning theme for your site and [customize it](https://sourcethemes.com/academic/docs/customization/#custom-theme) to your liking: @@ -53,7 +53,7 @@ Choose a stunning theme for your site and [customize it](https://sourcethemes.co ## The Future of Technical Content Writing -[![Writing technical content](https://sourcethemes.com/academic/img/docs/writing-technical-content.gif)](https://academic-demo.netlify.com/post/writing-technical-content/) +[![Writing technical content](https://sourcethemes.com/academic/img/docs/writing-technical-content.gif)](https://academic-demo.netlify.apppost/writing-technical-content/) ## Ecosystem @@ -71,18 +71,32 @@ You can choose from one of the following four methods to install: ### Install with web browser -[Install Academic with Netlify](https://app.netlify.com/start/deploy?repository=https://github.com/sourcethemes/academic-kickstart) - * One-click install of Academic creates an `academic-kickstart` repository in your GitHub or GitLab account - * Netlify will provide you with a customizable URL to access your new site, [or get your own domain](https://sourcethemes.com/academic/docs/domain/) - * Shortly after editing content in your repository, your site will automatically update - * Optionally, to edit your site in a [Markdown editor](https://www.typora.io) on your computer, perform the steps in the [*Install with Git*](#install-with-git) section below +[**Create your site now with Netlify** :rocket:](https://app.netlify.com/start/deploy?repository=https://github.com/sourcethemes/academic-kickstart) + +* One-click install of Academic creates an `academic-kickstart` repository in your GitHub or GitLab account +* Netlify will provide you with a customizable URL to access your new site, [or get your own domain](https://sourcethemes.com/academic/docs/domain/) +* Around 1-5 minutes after editing content in your repository, your site will automatically update + - If your site fails to update, [login to Netlify](https://www.netlify.com/), click your site, go to **Deploys**, and review the latest deploy log for any errors +* To **easily edit your site in a rich online editor in your browser**, + - [Login to Netlify](https://www.netlify.com/) and click the site you deployed with Netlify + - Go to **Settings > Identity**, and select **Enable Identity** service + - Under **Registration** preferences, select **Invite Only** + - Scroll down to **Services > Git Gateway**, and click **Enable Git Gateway** + - Head over to **`YOUR_SITE.com/admin/`** to view your content management panel and begin publishing content + - For support with _Netlify CMS_ admin panel, refer to the [Netlify CMS docs](https://www.netlifycms.org/docs/add-to-your-site/#authentication) and the very active [Netlify CMS community](https://www.netlifycms.org/community/) +* To edit your site in a [Markdown editor](https://www.typora.io) on your computer, + - Perform the steps in the [*Install with Git*](#install-with-git) section below + +Once you have followed the link above to automatically install Academic, head on over to your new `academic-kickstart` repository in your GitHub (or GitLab) account and [personalize your site by editing the files in](https://sourcethemes.com/academic/docs/get-started/) `config/_default/`. Shortly after saving (i.e. *committing* a file), your site will automatically update. + +View the [Homepage Builder](https://sourcethemes.com/academic/docs/page-builder/) and [Content](https://sourcethemes.com/academic/docs/managing-content/) guides to learn how to add widgets and content. For inspiration, refer to the [Markdown content](https://github.com/gcushen/hugo-academic/tree/master/exampleSite) which powers the [Demo](https://academic-demo.netlify.app). ### Install with Git Prerequisites: * [Download and install Git](https://git-scm.com/downloads) -* [Download and install Hugo Extended v0.63.1+](https://gohugo.io/getting-started/installing/#quick-install) +* [Download and install Hugo Extended v0.65-v0.72](https://gohugo.io/getting-started/installing/#quick-install) Install: @@ -105,7 +119,7 @@ Install: Prerequisites: -* [Download and install Hugo Extended v0.63.1+](https://gohugo.io/getting-started/installing/#quick-install) +* [Download and install Hugo Extended v0.65-v0.72](https://gohugo.io/getting-started/installing/#quick-install) Install: @@ -118,7 +132,7 @@ Install: ## Demo content -For inspiration, refer to the [Markdown content](https://github.com/gcushen/hugo-academic/tree/master/exampleSite) which powers the [Demo](https://academic-demo.netlify.com/). +For inspiration, refer to the [Markdown content](https://github.com/gcushen/hugo-academic/tree/master/exampleSite) which powers the [Demo](https://academic-demo.netlify.app). If you wish to initialise your site with the demo content, copy the contents of the `themes/academic/exampleSite/` folder to your website root folder, overwriting existing files if necessary. The `exampleSite` folder contains an example config file and content to help you get started. The following command can be used to accomplish this: diff --git a/assets/scss/academic/_content.scss b/assets/scss/academic/_content.scss index f72126d6..6742efe7 100644 --- a/assets/scss/academic/_content.scss +++ b/assets/scss/academic/_content.scss @@ -117,6 +117,12 @@ article .article-metadata { color: $sta-primary; } +.article-metadata .author-notes { + cursor: help; + vertical-align: super; + font-size: 0.7em; +} + .article-categories { white-space: nowrap; /* Keep category icon on same line as category links, otherwise context lost. */ } diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 5e75935b..52fc2167 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -163,6 +163,9 @@ sharing = true # Page specific copyright licenses are also possible by adding this option to a page's front matter. copyright_license = {enable = false, allow_derivatives = false, share_alike = true, allow_commercial = false, notice = "This work is licensed under {license}"} +# Highlight the site author (superuser) in author lists? (true/false) +highlight_superuser = false + # Link authors to their profile page? (true/false) link_authors = true diff --git a/exampleSite/content/publication/journal-article/index.md b/exampleSite/content/publication/journal-article/index.md index bccb5c1a..cd4c1dad 100644 --- a/exampleSite/content/publication/journal-article/index.md +++ b/exampleSite/content/publication/journal-article/index.md @@ -3,6 +3,9 @@ title: "An example journal article" authors: - admin - Robert Ford +author_notes: +- "Equal contribution" +- "Equal contribution" date: "2015-09-01T00:00:00Z" doi: "" diff --git a/layouts/partials/page_metadata_authors.html b/layouts/partials/page_metadata_authors.html index 877e41f2..934410e5 100644 --- a/layouts/partials/page_metadata_authors.html +++ b/layouts/partials/page_metadata_authors.html @@ -7,12 +7,17 @@ {{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy .) -}} {{- $name := $profile_page.Title | default $name_raw -}} {{- if gt $index 0 }}, {{ end -}} - + {{- if and $profile_page $link_authors -}} {{$name}} {{- else -}} {{$name}} {{- end -}} + {{- if isset $.Params "author_notes" -}} + {{- with (index $.Params.author_notes $index) -}} + (?) + {{- end -}} + {{- end -}} {{- end -}} {{- end -}} diff --git a/netlify.toml b/netlify.toml index d45159e0..3cdc5311 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,7 +5,7 @@ [build.environment] HUGO_THEME = "repo" - HUGO_VERSION = "0.68.3" + HUGO_VERSION = "0.72.0" HUGO_ENABLEGITINFO = "true" [context.production.environment]