diff --git a/themes/academic/.editorconfig b/themes/academic/.editorconfig new file mode 100644 index 0000000..574c0a2 --- /dev/null +++ b/themes/academic/.editorconfig @@ -0,0 +1,20 @@ +# editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.toml] +max_line_length = 100 + +[*.md] +trim_trailing_whitespace = false + +[layouts/shortcodes/*.html] +insert_final_newline = false diff --git a/themes/academic/.github/PULL_REQUEST_TEMPLATE.md b/themes/academic/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..4b0bd00 --- /dev/null +++ b/themes/academic/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +### Purpose + +Describe the purpose of this change. If there is an existing issue that is resolved by this pull request, please reference it in the form `Fixes #1234` where 1234 is the relevant issue number. + +### Screenshots + +If this is a GUI change, try to include screenshots of the change. If not, please delete this section. + +### Documentation + +If this is an enhancement, add a link here to the corresponding pull request on https://github.com/sourcethemes/academic-www or describe the documentation changes necessary. diff --git a/themes/academic/.gitignore b/themes/academic/.gitignore new file mode 100644 index 0000000..9dacd5b --- /dev/null +++ b/themes/academic/.gitignore @@ -0,0 +1,4 @@ +# IDE specific +.idea/ +.vscode/ +resources/ diff --git a/themes/academic/LICENSE.md b/themes/academic/LICENSE.md new file mode 100644 index 0000000..4e3b49e --- /dev/null +++ b/themes/academic/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2016-present George Cushen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/academic/README.md b/themes/academic/README.md new file mode 100644 index 0000000..d503246 --- /dev/null +++ b/themes/academic/README.md @@ -0,0 +1,130 @@ +
+ +# Academic: the website designer for [Hugo](https://gohugo.io) + +**Academic** makes it easy to create a beautiful website for free using Markdown. Customize anything on your site with widgets, themes, and language packs. + +Follow our easy [step by step guide](https://sourcethemes.com/academic/docs/install/) to learn how to build your own free website with Academic. [Check out the personal demo](https://themes.gohugo.io/theme/academic/) or the [business demo](https://sourcethemes.com/academic/) of what you'll get in less than 10 minutes. + +- [View the documentation](https://sourcethemes.com/academic/docs/) +- [Ask a question](http://discuss.gohugo.io/) +- [Request a feature or report a bug](https://github.com/gcushen/hugo-academic/issues) +- Updating? View the [Update Guide](https://sourcethemes.com/academic/docs/update/) and [Release Notes](https://sourcethemes.com/academic/updates/) +- Support development of Academic: + - [Donate a coffee](https://paypal.me/cushen) + - [Become a backer on Patreon](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/) + +[![Screenshot](https://raw.githubusercontent.com/gcushen/hugo-academic/master/academic.png)](https://github.com/gcushen/hugo-academic/) + +**Key features:** + +- Easily manage various content including homepage, blog posts, publications, talks, slides, and projects +- Extensible via **color themes** and **widgets/plugins** +- Write in [Markdown](https://sourcethemes.com/academic/docs/writing-markdown-latex/) for easy formatting and code highlighting, with [LaTeX](https://en.wikibooks.org/wiki/LaTeX/Mathematics) for mathematical expressions +- Social/academic network linking, [Google Analytics](https://analytics.google.com), and [Disqus](https://disqus.com) comments +- Responsive and mobile friendly +- Simple and refreshing one page design +- Multilingual and easy to customize + +## Color Themes + +Academic is available in different color themes and font themes. + +| `default` | `ocean` | `forest` | `dark` | +| --- | --- | --- | --- | +| ![default theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-default.png) | ![ocean theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-ocean.png) | ![forest theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-forest.png) | ![dark theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-dark.png) | + +| `apogee` | `1950s` | `coffee` | `cupcake` | +| --- | --- | --- | --- | +| ![apogee theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-apogee.png) | ![1950s theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-1950s.png) | ![coffee theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-coffee-playfair.png) | ![cupcake theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-cupcake.png) | + +## Ecosystem + +* **[Academic Admin](https://github.com/sourcethemes/academic-admin):** An admin tool to import publications from BibTeX or import assets for an offline site +* **[Academic Scripts](https://github.com/sourcethemes/academic-scripts):** Scripts to help migrate content to new versions of Academic +* **[Project KickstartR](https://github.com/sourcethemes/project-kickstart-r):** Create a Project, Team, or Conference **Landing Page** and **Knowledge Sharing Platform** with (R) Markdown + +## Install + +You can choose from one of the following four methods to install: + +* one-click install using your web browser (recommended) +* install on your computer using Git with the Command Prompt/Terminal app +* install on your computer by downloading the ZIP files +* install on your computer with RStudio + +### Quick install using your web browser + +1. [Install Academic with Netlify](https://app.netlify.com/start/deploy?repository=https://github.com/sourcethemes/academic-kickstart) + * Netlify will provide you with a customizable URL to access your new site +2. On GitHub, go to your newly created `academic-kickstart` repository and edit `config.toml` to personalize your site. Shortly after saving the file, your site will automatically update +3. Read the [Quick Start Guide](https://sourcethemes.com/academic/docs/) to learn how to add Markdown content. For inspiration, refer to the [Markdown content](https://github.com/gcushen/hugo-academic/tree/master/exampleSite) which powers the [Demo](https://themes.gohugo.io/theme/academic/) + +### Install with Git + +Prerequisites: + +* [Download and install Git](https://git-scm.com/downloads) +* [Download and install Hugo](https://gohugo.io/getting-started/installing/#quick-install) + +1. [Fork](https://github.com/sourcethemes/academic-kickstart#fork-destination-box) the *Academic Kickstart* repository and clone your fork with Git: + + git clone https://github.com/sourcethemes/academic-kickstart.git My_Website + + *Note that if you forked Academic Kickstart, the above command should be edited to clone your fork, i.e. replace `sourcethemes` with your GitHub username.* + +2. Initialize the theme: + + cd My_Website + git submodule update --init --recursive + +### Install with ZIP + +1. [Download](https://github.com/sourcethemes/academic-kickstart/archive/master.zip) and extract *Academic Kickstart* +2. [Download](https://github.com/gcushen/hugo-academic/archive/master.zip) and extract the *Academic theme* to the `themes/academic/` folder from the above step + +### Install with RStudio + +[View the guide to installing Academic with RStudio](https://sourcethemes.com/academic/docs/install/#install-with-rstudio) + +## Quick start + +1. If you installed on your computer, view your new website by running the following command: + + hugo server + + Now visit [localhost:1313](http://localhost:1313) and your new Academic powered website will appear. Otherwise, if using Netlify, they will provide you with your URL. + +2. Read the [Quick Start Guide](https://sourcethemes.com/academic/docs/) to learn how to add Markdown content, customize your site, and deploy it. For inspiration, refer to the [Markdown content](https://github.com/gcushen/hugo-academic/tree/master/exampleSite) which powers the [Demo](https://themes.gohugo.io/theme/academic/) + +3. Build your site by running the `hugo` command. Then [host it for free using Github Pages](https://georgecushen.com/create-your-website-with-hugo/) or Netlify (refer to the first installation method). Alternatively, copy the generated `public/` directory (by FTP, Rsync, etc.) to your production web server (such as a university's hosting service). + +## Updating + +Feel free to *star* the project on [Github](https://github.com/gcushen/hugo-academic/) to help keep track of updates and check out the [release notes](https://sourcethemes.com/academic/updates) prior to updating your site. + +Before updating the framework, it is recommended to make a backup of your entire website directory (or at least your `themes/academic` directory) and record your current version number. + +By default, Academic is installed as a Git submodule which can be updated by running the following command: + +```bash +git submodule update --remote --merge +``` + +[Check out the update guide](https://sourcethemes.com/academic/docs/update/) for full instructions and alternative methods. + +## Feedback & Contributing + +Please use the [issue tracker](https://github.com/gcushen/hugo-academic/issues) to let me know about any bugs or feature requests, or alternatively make a pull request. + +For support, head over to the [Hugo discussion forum](http://discuss.gohugo.io). + +## License + +Copyright 2016-present [George Cushen](https://georgecushen.com). + +Released under the [MIT](https://github.com/gcushen/hugo-academic/blob/master/LICENSE.md) license. + +[![Analytics](https://ga-beacon.appspot.com/UA-78646709-2/hugo-academic/readme?pixel)](https://github.com/igrigorik/ga-beacon) diff --git a/themes/academic/academic.png b/themes/academic/academic.png new file mode 100644 index 0000000..9a73a17 Binary files /dev/null and b/themes/academic/academic.png differ diff --git a/themes/academic/archetypes/default.md b/themes/academic/archetypes/default.md new file mode 100644 index 0000000..366caee --- /dev/null +++ b/themes/academic/archetypes/default.md @@ -0,0 +1,20 @@ ++++ +title = "{{ replace .Name "-" " " | title }}" +date = {{ .Date }} +draft = false + +# Tags and categories +# For example, use `tags = []` for no tags, or the form `tags = ["A Tag", "Another Tag"]` for one or more tags. +tags = [] +categories = [] + +# Featured image +# To use, add an image named `featured.jpg/png` to your page's folder. +[image] + # Caption (optional) + caption = "" + + # Focal point (optional) + # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight + focal_point = "" ++++ diff --git a/themes/academic/archetypes/docs.md b/themes/academic/archetypes/docs.md new file mode 100644 index 0000000..4dfe592 --- /dev/null +++ b/themes/academic/archetypes/docs.md @@ -0,0 +1,25 @@ ++++ +title = "{{ replace .Name "-" " " | title }}" +date = {{ .Date }} +draft = false +type = "docs" # Do not modify. + +# Show table of contents? true/false +toc = true + +# Add menu entry to sidebar. + +# Uncomment to customize menu title, e.g. to abbreviate page title. +# linktitle = "Example" + +# Substitute `tutorial` with the name of your tutorials folder. +[menu.tutorial] + # Define a parent ID if this page is a parent. + name = "YourParentID" + + # Reference a parent ID if this page is a child. + # parent = "YourParentID" + + # Order that this page appears in the menu. + weight = 1 ++++ diff --git a/themes/academic/archetypes/home.md b/themes/academic/archetypes/home.md new file mode 100644 index 0000000..940323c --- /dev/null +++ b/themes/academic/archetypes/home.md @@ -0,0 +1,13 @@ ++++ +# Custom widget. +widget = "custom" +active = true +date = {{ .Date }} + +# Note: a full width section format can be enabled by commenting out the `title` and `subtitle` with a `#`. +title = "{{ replace .Name "-" " " | title }}" +subtitle = "" + +# Order that this section will appear in. +weight = 100 ++++ diff --git a/themes/academic/archetypes/post/index.md b/themes/academic/archetypes/post/index.md new file mode 100644 index 0000000..98ae982 --- /dev/null +++ b/themes/academic/archetypes/post/index.md @@ -0,0 +1,31 @@ ++++ +title = "{{ replace .Name "-" " " | title }}" +date = {{ .Date }} +draft = false + +# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`. +authors = [] + +# Tags and categories +# For example, use `tags = []` for no tags, or the form `tags = ["A Tag", "Another Tag"]` for one or more tags. +tags = [] +categories = [] + +# Projects (optional). +# Associate this post with one or more of your projects. +# Simply enter your project's folder or file name without extension. +# E.g. `projects = ["deep-learning"]` references +# `content/project/deep-learning/index.md`. +# Otherwise, set `projects = []`. +# projects = ["internal-project"] + +# Featured image +# To use, add an image named `featured.jpg/png` to your page's folder. +[image] + # Caption (optional) + caption = "" + + # Focal point (optional) + # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight + focal_point = "" ++++ diff --git a/themes/academic/archetypes/project/index.md b/themes/academic/archetypes/project/index.md new file mode 100644 index 0000000..0901867 --- /dev/null +++ b/themes/academic/archetypes/project/index.md @@ -0,0 +1,45 @@ ++++ +title = "{{ replace .Name "-" " " | title }}" +date = {{ .Date }} +draft = false + +# Tags: can be used for filtering projects. +# Example: `tags = ["machine-learning", "deep-learning"]` +tags = [] + +# Project summary to display on homepage. +summary = "" + +# Slides (optional). +# Associate this page with Markdown slides. +# Simply enter your slide deck's filename without extension. +# E.g. `slides = "example-slides"` references +# `content/slides/example-slides.md`. +# Otherwise, set `slides = ""`. +slides = "" + +# Optional external URL for project (replaces project detail page). +external_link = "" + +# Links (optional). +url_pdf = "" +url_code = "" +url_dataset = "" +url_slides = "" +url_video = "" +url_poster = "" + +# Custom links (optional). +# Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`. +# url_custom = [{icon_pack = "fab", icon="twitter", name="Follow", url = "https://twitter.com"}] + +# Featured image +# To use, add an image named `featured.jpg/png` to your page's folder. +[image] + # Caption (optional) + caption = "" + + # Focal point (optional) + # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight + focal_point = "" ++++ diff --git a/themes/academic/archetypes/publication/index.md b/themes/academic/archetypes/publication/index.md new file mode 100644 index 0000000..833bf79 --- /dev/null +++ b/themes/academic/archetypes/publication/index.md @@ -0,0 +1,78 @@ ++++ +title = "{{ replace .Name "-" " " | title }}" +date = {{ .Date }} +draft = false + +# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`. +authors = [""] + +# Publication type. +# Legend: +# 0 = Uncategorized +# 1 = Conference paper +# 2 = Journal article +# 3 = Manuscript +# 4 = Report +# 5 = Book +# 6 = Book section +publication_types = ["0"] + +# Publication name and optional abbreviated version. +publication = "" +publication_short = "" + +# Abstract and optional shortened version. +abstract = "" +abstract_short = "" + +# Is this a selected publication? (true/false) +selected = false + +# Projects (optional). +# Associate this publication with one or more of your projects. +# Simply enter your project's folder or file name without extension. +# E.g. `projects = ["deep-learning"]` references +# `content/project/deep-learning/index.md`. +# Otherwise, set `projects = []`. +projects = [] + +# Slides (optional). +# Associate this page with Markdown slides. +# Simply enter your slide deck's filename without extension. +# E.g. `slides = "example-slides"` references +# `content/slides/example-slides.md`. +# Otherwise, set `slides = ""`. +slides = "" + +# Tags (optional). +# Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags. +tags = [] + +# Links (optional). +url_pdf = "" +url_preprint = "" +url_code = "" +url_dataset = "" +url_project = "" +url_slides = "" +url_video = "" +url_poster = "" +url_source = "" + +# Custom links (optional). +# Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`. +# url_custom = [{name = "Custom Link", url = "http://example.org"}] + +# Digital Object Identifier (DOI) +doi = "" + +# Featured image +# To use, add an image named `featured.jpg/png` to your page's folder. +[image] + # Caption (optional) + caption = "" + + # Focal point (optional) + # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight + focal_point = "" ++++ diff --git a/themes/academic/archetypes/slides.md b/themes/academic/archetypes/slides.md new file mode 100644 index 0000000..02880bb --- /dev/null +++ b/themes/academic/archetypes/slides.md @@ -0,0 +1,15 @@ ++++ +title = "{{ replace .Name "-" " " | title }}" + +[slides] +# Choose a theme from https://github.com/hakimel/reveal.js#theming +theme = "black" ++++ + +# Title + +Author Name + +--- + +## Slide 2 diff --git a/themes/academic/archetypes/talk/index.md b/themes/academic/archetypes/talk/index.md new file mode 100644 index 0000000..5f82e77 --- /dev/null +++ b/themes/academic/archetypes/talk/index.md @@ -0,0 +1,63 @@ ++++ +title = "{{ replace .Name "-" " " | title }}" +date = {{ .Date }} # Schedule page publish date. +draft = false + +# Talk start and end times. +# End time can optionally be hidden by prefixing the line with `#`. +time_start = {{ .Date }} +time_end = {{ .Date }} + +# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`. +authors = [] + +# Abstract and optional shortened version. +abstract = "" +abstract_short = "" + +# Name of event and optional event URL. +event = "" +event_url = "" + +# Location of event. +location = "" + +# Is this a selected talk? (true/false) +selected = false + +# Projects (optional). +# Associate this talk with one or more of your projects. +# Simply enter your project's folder or file name without extension. +# E.g. `projects = ["deep-learning"]` references +# `content/project/deep-learning/index.md`. +# Otherwise, set `projects = []`. +projects = [] + +# Slides (optional). +# Associate this page with Markdown slides. +# Simply enter your slide deck's filename without extension. +# E.g. `slides = "example-slides"` references +# `content/slides/example-slides.md`. +# Otherwise, set `slides = ""`. +slides = "" + +# Tags (optional). +# Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags. +tags = [] + +# Links (optional). +url_pdf = "" +url_slides = "" +url_video = "" +url_code = "" + +# Featured image +# To use, add an image named `featured.jpg/png` to your page's folder. +[image] + # Caption (optional) + caption = "" + + # Focal point (optional) + # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight + focal_point = "" ++++ diff --git a/themes/academic/assets/css/reveal.css b/themes/academic/assets/css/reveal.css new file mode 100644 index 0000000..ca174e3 --- /dev/null +++ b/themes/academic/assets/css/reveal.css @@ -0,0 +1,31 @@ +/************************************************* + * Reveal JS + **************************************************/ + +/* This is a copy of MathJax's `.mjx-chtml` with font-family added to override `.reveal span`. */ +/* See https://github.com/hakimel/reveal.js/issues/1924 */ +.reveal span.mjx-chtml { + display: inline-block; + line-height: 0; + text-indent: 0; + text-align: left; + text-transform: none; + font-style: normal; + font-weight: normal; + font-size: 100%; + font-size-adjust: none; + letter-spacing: normal; + word-wrap: normal; + word-spacing: normal; + white-space: nowrap; + float: none; + direction: ltr; + max-width: none; + max-height: none; + min-width: 0; + min-height: 0; + border: 0; + margin: 0; + padding: 1px 0; + font-family: MJXc-TeX-math-I,MJXc-TeX-math-Ix,MJXc-TeX-math-Iw; +} diff --git a/themes/academic/assets/css/reveal_custom.css b/themes/academic/assets/css/reveal_custom.css new file mode 100644 index 0000000..e69de29 diff --git a/themes/academic/assets/js/academic-search.js b/themes/academic/assets/js/academic-search.js new file mode 100644 index 0000000..79a6401 --- /dev/null +++ b/themes/academic/assets/js/academic-search.js @@ -0,0 +1,176 @@ +/************************************************* + * Academic + * https://github.com/gcushen/hugo-academic + * + * In-built Fuse based search algorithm. + **************************************************/ + +/* --------------------------------------------------------------------------- +* Configuration. +* --------------------------------------------------------------------------- */ + +// Configure Fuse. +let fuseOptions = { + shouldSort: true, + includeMatches: true, + tokenize: true, + threshold: 0.0, + location: 0, + distance: 100, + maxPatternLength: 32, + minMatchCharLength: 2, + keys: [ + {name:'title', weight:0.8}, + {name:'summary', weight:0.6}, + {name:'content', weight:0.5}, + {name:'tags', weight:0.3} + ] +}; + +// Configure summary. +let summaryLength = 60; + +/* --------------------------------------------------------------------------- +* Functions. +* --------------------------------------------------------------------------- */ + +// Get query from URI. +function getSearchQuery(name) { + return decodeURIComponent((location.search.split(name + '=')[1] || '').split('&')[0]).replace(/\+/g, ' '); +} + +// Set query in URI without reloading the page. +function updateURL(url) { + if (history.pushState) { + window.history.pushState({path:url}, '', url); + } +} + +// Pre-process new search query. +function initSearch(force, fuse) { + let query = $("#search-query").val(); + + // If query deleted, clear results. + if ( query.length < 1) { + $('#search-hits').empty(); + } + + // Check for timer event (enter key not pressed) and query less than minimum length required. + if (!force && query.length < fuseOptions.minMatchCharLength) + return; + + // Do search. + $('#search-hits').empty(); + searchAcademic(query, fuse); + let newURL = window.location.protocol + "//" + window.location.host + window.location.pathname + '?q=' + encodeURIComponent(query) + window.location.hash; + updateURL(newURL); +} + +// Perform search. +function searchAcademic(query, fuse) { + let results = fuse.search(query); + // console.log({"results": results}); + + if (results.length > 0) { + $('#search-hits').append('{{ i18n "404_recommendations" }}
+ + {{ $posts_len := len (where .Site.RegularPages "Section" "post") }} + {{ if gt $posts_len 0 }} +{{.}}
+ {{ end }} + + {{ .TableOfContents }} + + + + {{ partial "docs_toc_foot.html" . }} +