starters: auto-import publications from Bibtex

This commit is contained in:
George Cushen 2023-10-29 09:23:37 +00:00
commit 9b6cb2d6cc
51 changed files with 603 additions and 1398 deletions

View file

@ -0,0 +1,57 @@
# Wowchemy GitHub Action to convert Bibtex publications to Markdown-based webpages
name: Import Publications From Bibtex
# Require permission to create a PR
permissions:
contents: write
pull-requests: write
# Run workflow when a `.bib` file is added or updated in the `data/` folder
on:
push:
branches: ['main']
paths: ['publications.bib']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
wowchemy:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install academic==0.10.0
- name: Run Academic (Bibtex To Markdown Converter)
# Check `.bib` file exists for case when action runs on `.bib` deletion
# Note GH only provides hashFiles func in `steps.if` context, not `jobs.if` context
if: ${{ hashFiles('publications.bib') != '' }}
run: academic import publications.bib content/publication/ --compact
- name: Create Pull Request
# Set ID for `Check outputs` stage
id: cpr
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'content: import publications from Bibtex'
title: Wowchemy - Import latest publications
body: |
Import the latest publications from `publications.bib` to `content/publication/`.
将最新的出版物从`publications.bib`导入到`content/publication/`。
[View Documentation](https://github.com/wowchemy/bibtex-to-markdown)
base: main
labels: automated-pr, content
branch: wowchemy-import-publications
delete-branch: true
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

View file

@ -1,5 +1,8 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
@ -17,10 +20,6 @@ concurrency:
group: "pages"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
# Build website
build:
@ -32,20 +31,25 @@ jobs:
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.119.0'
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

View file

@ -1,10 +1,10 @@
# [Hugo Academic Theme](https://github.com/wowchemy/starter-hugo-academic)
[![Screenshot](./preview.png)](https://wowchemy.com/hugo-themes/)
[![Screenshot](./preview.png)](https://wowchemy.com/templates/)
The Hugo **Academic Resumé Template** empowers you to easily create your job-winning online resumé, showcase your academic publications, and create online courses or knowledge bases to grow your audience.
[![Get Started](https://img.shields.io/badge/-Get%20started-ff4655?style=for-the-badge)](https://wowchemy.com/hugo-themes/)
[![Get Started](https://img.shields.io/badge/-Get%20started-ff4655?style=for-the-badge)](https://wowchemy.com/templates/)
[![Discord](https://img.shields.io/discord/722225264733716590?style=for-the-badge)](https://discord.com/channels/722225264733716590/742892432458252370/742895548159492138)
[![Twitter Follow](https://img.shields.io/twitter/follow/wowchemy?label=Follow%20on%20Twitter)](https://twitter.com/wowchemy)
@ -16,13 +16,13 @@ Easily write technical content with plain text Markdown, LaTeX math, diagrams, R
The integrated [**Wowchemy**](https://wowchemy.com) website builder and CMS makes it easy to create a beautiful website for free. Edit your site in the CMS (or your favorite editor), generate it with [Hugo](https://github.com/gohugoio/hugo), and deploy with GitHub or Netlify. Customize anything on your site with widgets, light/dark themes, and language packs.
- 👉 [**Get Started**](https://wowchemy.com/hugo-themes/)
- 👉 [**Get Started**](https://wowchemy.com/templates/)
- 📚 [View the **documentation**](https://wowchemy.com/docs/)
- 💬 [Chat with the **Wowchemy research community**](https://discord.gg/z8wNYzb) or [**Hugo community**](https://discourse.gohugo.io)
- 🐦 Twitter: [@wowchemy](https://twitter.com/wowchemy) [@GeorgeCushen](https://twitter.com/GeorgeCushen) [#MadeWithWowchemy](https://twitter.com/search?q=%23MadeWithWowchemy&src=typed_query)
- ⬇️ **Automatically import your publications from BibTeX** with the [Hugo Academic CLI](https://github.com/wowchemy/hugo-academic-cli)
- 💡 [Suggest an improvement](https://github.com/wowchemy/wowchemy-hugo-themes/issues)
- ⬆️ **Updating?** View the [Update Guide](https://wowchemy.com/docs/hugo-tutorials/update/) and [Release Notes](https://github.com/wowchemy/wowchemy-hugo-themes/releases)
- 💡 [Suggest an improvement](https://github.com/wowchemy/wowchemy-templates/issues)
- ⬆️ **Updating?** View the [Update Guide](https://wowchemy.com/docs/hugo-tutorials/update/) and [Release Notes](https://github.com/wowchemy/wowchemy-templates/releases)
## We ask you, humbly, to support this open source movement
@ -36,8 +36,7 @@ We're an open source movement that depends on your support to stay online and th
## Demo image credits
- [Open book](https://unsplash.com/photos/J4kK8b9Fgj8)
- [Course](https://unsplash.com/photos/JKUTrJ4vK00)
- [Unsplash](https://unsplash.com)
## Latest news

View file

@ -51,21 +51,21 @@ education:
skills:
- name: Technical
items:
- name: Python
description: ''
percent: 80
icon: python
icon_pack: fab
- name: Data Science
description: ''
percent: 100
icon: chart-line
icon_pack: fas
- name: SQL
description: ''
percent: 40
icon: database
icon_pack: fas
- name: Python
description: ''
percent: 80
icon: python
icon_pack: fab
- name: Data Science
description: ''
percent: 100
icon: chart-line
icon_pack: fas
- name: SQL
description: ''
percent: 40
icon: database
icon_pack: fas
- name: Hobbies
color: '#eeac02'
color_border: '#f0bf23'

View file

@ -1,9 +1,9 @@
name = "Academic"
license = "MIT"
licenselink = "https://github.com/wowchemy/starter-hugo-academic/blob/master/LICENSE.md"
description = "Use the website builder to easily build your site with 50+ widgets and deploy with one click! Fully customize your site with themes, plugins, and language packs."
licenselink = "https://github.com/wowchemy/starter-hugo-academic/blob/main/LICENSE.md"
description = "Use the no-code website framework to easily build your site. Choose from 50+ widgets and deploy with one click! Fully personalize your site with themes, plugins, and language packs."
homepage = "https://github.com/wowchemy/starter-hugo-academic/"
demosite = "https://wowchemy.com/hugo-themes/"
demosite = "https://wowchemy.com/templates/"
tags = ["widgets",
"resume",
"portfolio",

View file

@ -1,20 +0,0 @@
# 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

View file

@ -1,7 +0,0 @@
# IDEs
.idea/
# Hugo
resources/
public/
assets/jsconfig.json

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,117 +0,0 @@
// Starter Blog Template
// https://wowchemy.com/hugo-themes/
body {
background-color: rgb(247, 250, 252);
}
.article-container {
background-color: #fff;
border-radius: 15px;
}
.dark .article-container {
background-color: rgb(31, 39, 51);
}
// custom footer color
.page-footer {
background-color: rgb(247, 250, 252);
}
.dark .page-footer {
background-color: rgb(26, 32, 44);
}
// more rounded cards and larger gap between cards
.card-simple {
margin-top: 1.8rem;
border-radius: 15px;
}
.dark .card-simple {
background: rgb(31, 39, 51);
}
// no navbar shadow
.navbar {
box-shadow: none !important; // 'important' to override dark mode box-shadow too.
}
// custom section padding
.home-section {
padding: 1rem 0;
}
.home-section.wg-about-avatar {
padding: 0;
}
#profile .network-icon {
margin-top: 0.5rem;
}
ul.network-icon .big-icon {
font-size: 1.5rem;
}
.dark .portrait-title h3 {
color: rgba(255, 255, 255, 0.9);
font-weight: bold;
}
.dark .portrait-title h2 {
color: #fff;
font-weight: bold;
}
.home-section > .content {
width: 45em;
max-width: calc(100% - 4em);
margin: 0 auto;
}
.home-section > .content > :last-child {
margin-bottom: 0;
}
.home-section header {
margin-bottom: 1em;
}
// Narrower container for Hello World sections (primarily Blank widget content).
@media (min-width: 1200px) {
.home-section .container {
max-width: 880px;
}
}
@media (min-width: 992px) {
.home-section .container {
max-width: 880px;
}
}
// Custom avatar size on homepage
.avatar {
width: auto;
height: auto;
max-width: 225px;
max-height: 225px;
}
// Prevent stretching on About page with narrow container
.wg-about .avatar {
width: auto;
height: auto;
max-width: 200px;
max-height: 200px;
}
// Smaller Name and Role text on About page than in homepage `about.avatar` widget
.wg-about .portrait-title h2 {
font-size: 1rem;
}
.wg-about .portrait-title h3 {
font-size: 0.8rem;
}

View file

@ -1,12 +0,0 @@
# Navigation Links
# To link a homepage widget, specify the URL as a hash `#` followed by the filename of the
# desired widget in your `content/home/` folder.
# The weight parameter defines the order that the links will appear in.
main:
- name: Home
url: /
weight: 10
- name: About
url: about/
weight: 20

View file

@ -1,105 +0,0 @@
# SITE SETUP
# Guide: https://wowchemy.com/docs/getting-started/
# Documentation: https://wowchemy.com/docs/
# This file is formatted using YAML syntax - learn more at https://learnxinyminutes.com/docs/yaml/
# Appearance
appearance:
theme_day: custom
theme_night: custom
font: minimal
font_size: L
# SEO
marketing:
seo:
site_type: Person
local_business_type: ''
org_name: ''
description: 'A highly-customizable Hugo blog theme powered by Wowchemy website builder.'
twitter: 'wowchemy'
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''
# Site header
header:
navbar:
enable: false
align: r
show_logo: false
show_language: false
show_day_night: true
show_search: true
highlight_active_link: false
footer:
copyright:
notice: '© {year} Me. This work is licensed under {license}'
license:
enable: true
allow_derivatives: false
share_alike: true
allow_commercial: false
# Localization
locale:
date_format: 'Jan 2, 2006'
time_format: '3:04 PM'
# Site features
features:
syntax_highlighter:
theme_light: github-light
theme_dark: dracula
math:
enable: false
privacy_pack:
enable: false
repository:
url: 'https://github.com/<username>/<repository>'
content_dir: content
branch: main
avatar:
gravatar: false
shape: circle
comment:
provider: ''
disqus:
shortname: ''
show_count: true
commento:
url: ''
giscus:
repo: ''
repo_id: ''
category: ''
category_id: ''
search:
provider: wowchemy
algolia:
app_id: ''
api_key: ''
index_name: ''
show_logo: false
map:
provider: ''
api_key: ''
zoom: 15
extensions:
cms:
branch: main
local_backend: false
academicons:
enable: false

View file

@ -1,21 +0,0 @@
---
# An instance of the About widget.
# Documentation: https://wowchemy.com/docs/page-builder/
widget: about
# Activate this widget? true/false
active: true
# This file represents a page section.
headless: true
# Order that this section appears on the page.
weight: 10
title: Hello
# Choose the user profile to display
# This should be the username (folder name) of a profile in your `content/authors/` folder.
# See https://wowchemy.com/docs/get-started/#introduce-yourself
author: admin
---

View file

@ -1,30 +0,0 @@
---
# An instance of the Contact widget.
# Documentation: https://wowchemy.com/docs/getting-started/page-builder/
widget: contact
# This file represents a page section.
headless: true
# Order that this section appears on the page.
weight: 20
title:
subtitle:
content:
# Automatically link email and phone or display as text?
autolink: true
# Email form provider
form:
provider: netlify
formspree:
id:
netlify:
# Enable CAPTCHA challenge to reduce spam?
captcha: false
design:
columns: '1'
---

View file

@ -1,3 +0,0 @@
---
type: widget_page
---

View file

@ -1,8 +0,0 @@
---
# Generate Wowchemy CMS
type: wowchemycms
private: true
outputs:
- wowchemycms_config
- HTML
---

View file

@ -1,11 +0,0 @@
---
cms_exclude: true
# To publish author profile pages, remove all of the `_build` and `cascade` settings below.
_build:
render: never
cascade:
_build:
render: never
list: always
---

View file

@ -1,71 +0,0 @@
---
# Display name
title: Alice Bighetti (吳恩達)
# Is this the primary user of the site?
superuser: true
# Role/position
role: 数据科学家
# Status emoji
status:
icon: ☕️
# Organizations/Affiliations
organizations:
- name: 腾讯
url: ''
# Short bio (displayed in user profile at end of posts)
bio: My research interests include distributed robotics, mobile computing and programmable matter.
#interests:
#- Artificial Intelligence
#- Computational Linguistics
#- Information Retrieval
#education:
# courses:
# - course: PhD in Artificial Intelligence
# institution: Stanford University
# year: 2012
# - course: MEng in Artificial Intelligence
# institution: Massachusetts Institute of Technology
# year: 2009
# - course: BSc in Artificial Intelligence
# institution: Massachusetts Institute of Technology
# year: 2008
# Social/Academic Networking
# For available icons, see: https://wowchemy.com/docs/getting-started/page-builder/#icons
# For an email link, use "fas" icon pack, "envelope" icon, and a link in the
# form "mailto:your-email@example.com" or "#contact" for contact widget.
social:
- icon: envelope
icon_pack: fas
link: 'about/#contact' # For a direct email link, use "mailto:test@example.org".
- icon: twitter
icon_pack: fab
link: https://twitter.com/wowchemy
- icon: instagram
icon_pack: fab
link: https://instagram.com/geocushen
# Uncomment below for Github link
#- icon: github
# icon_pack: fab
# link: https://github.com/gcushen
# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
# - icon: cv
# icon_pack: ai
# link: files/cv.pdf
# Enter email to display Gravatar (if Gravatar enabled in Config)
#email: ""
---
Alice Bighetti is a professor of artificial intelligence at the Stanford AI Lab. Her research interests include distributed robotics, mobile computing and programmable matter. She leads the Robotic Neurobiology group, which develops self-reconfiguring robots, systems of self-organizing robots, and mobile sensor networks.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate.

View file

@ -1,30 +0,0 @@
---
# A Recent Blog Posts section created with the Pages widget.
# This section displays recent blog posts from `content/post/`.
# See https://wowchemy.com/docs/widget/pages/
widget: pages
headless: true
active: true
weight: 20
title: ''
subtitle: ''
content:
offset: 0
order: desc
filters:
folders:
- post
tag: ''
category: ''
publication_type: ''
author: ''
exclude_featured: false
archive:
enable: false
design:
columns: '1'
view: card
flip_alt_rows: true
background: {}
spacing: {padding: [0, 0, 0, 0]}
---

View file

@ -1,7 +0,0 @@
---
# Homepage
type: widget_page
# Homepage is headless, other widget pages are not.
headless: true
---

View file

@ -1,23 +0,0 @@
---
# Use the Intro widget of the Blog template
widget: about.avatar
# This file represents a page section.
headless: true
# Order that this section will appear in.
weight: 10
author: admin
#design:
# background:
# color: '#090a0b'
# text_color_light: true
# video:
# path: # enter filename of a video in /assets/media
# css_class: fullscreen
---
🐈 Hey! I'm **Alice**, a data scientist at Google.
Check out my [CV](/about/) and blog posts below 🌈

View file

@ -1,13 +0,0 @@
---
title: Posts
cms_exclude: true
# View.
view: compact
flip_alt_rows: false
# Optional header image (relative to `assets/media/` folder).
banner:
caption: ''
image: ''
---

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View file

@ -1,106 +0,0 @@
---
title: Welcome to Wowchemy, the website builder for Hugo
subtitle: Welcome 👋 We know that first impressions are important, so we've populated your new site with some initial content to help you get familiar with everything in no time.
# Summary for listings and search engines
summary: Welcome 👋 We know that first impressions are important, so we've populated your new site with some initial content to help you get familiar with everything in no time.
# Link this post with a project
projects: []
# Date published
date: '2020-12-13T00:00:00Z'
# Date updated
lastmod: '2020-12-13T00:00:00Z'
# Is this an unpublished draft?
draft: false
# Show this page in the Featured widget?
featured: false
# Featured image
# Place an image named `featured.jpg/png` in this page's folder and customize its options here.
image:
caption: 'Image credit: [**Unsplash**](https://unsplash.com/photos/CpkOjOcXdUY)'
focal_point: ''
placement: 2
preview_only: false
authors:
- admin
- 美杨
tags:
- Academic
- 开源
categories:
- Demo
- 教程
---
## Overview
1. The Wowchemy website builder for Hugo, along with its starter templates, is designed for professional creators, educators, and teams/organizations - although it can be used to create any kind of site
2. The template can be modified and customised to suit your needs. It's a good platform for anyone looking to take control of their data and online identity whilst having the convenience to start off with a **no-code solution (write in Markdown and customize with YAML parameters)** and having **flexibility to later add even deeper personalization with HTML and CSS**
3. You can work with all your favourite tools and apps with hundreds of plugins and integrations to speed up your workflows, interact with your readers, and much more
[![The template is mobile first with a responsive design to ensure that your site looks stunning on every device.](https://raw.githubusercontent.com/wowchemy/wowchemy-hugo-modules/main/starters/academic/preview.png)](https://wowchemy.com)
## Get Started
- 👉 [**Create a new site**](https://wowchemy.com/hugo-themes/)
- 📚 [**Personalize your site**](https://wowchemy.com/docs/)
- 💬 [Chat with the **Wowchemy community**](https://discord.gg/z8wNYzb) or [**Hugo community**](https://discourse.gohugo.io)
- 🐦 Twitter: [@wowchemy](https://twitter.com/wowchemy) [@GeorgeCushen](https://twitter.com/GeorgeCushen) [#MadeWithWowchemy](https://twitter.com/search?q=%23MadeWithWowchemy&src=typed_query)
- 💡 [Request a **feature** or report a **bug** for _Wowchemy_](https://github.com/wowchemy/wowchemy-hugo-themes/issues)
- ⬆️ **Updating Wowchemy?** View the [Update Guide](https://wowchemy.com/docs/hugo-tutorials/update/) and [Release Notes](https://github.com/wowchemy/wowchemy-hugo-themes/releases)
## Crowd-funded open-source software
To help us develop this template and software sustainably under the MIT license, we ask all individuals and businesses that use it to help support its ongoing maintenance and development via sponsorship.
### [❤️ Click here to become a sponsor and help support Wowchemy's future ❤️](https://github.com/sponsors/gcushen)
As a token of appreciation for sponsoring, you can **unlock [these](https://wowchemy.com/sponsor/) awesome rewards and extra features 🦄✨**
## Ecosystem
- **[Hugo Academic CLI](https://github.com/wowchemy/hugo-academic-cli):** Automatically import publications from BibTeX
## Inspiration
[Check out the latest **demo**](https://hugo-blog-theme.netlify.app/) of what you'll get in less than 10 minutes, or [view the **showcase**](https://wowchemy.com/creators/) of personal, project, and business sites.
## Features
- **Page builder** - Create _anything_ with [**widgets**](https://wowchemy.com/docs/page-builder/) and [**elements**](https://wowchemy.com/docs/writing-markdown-latex/)
- **Edit any type of content** - Blog posts, publications, talks, slides, projects, and more!
- **Create content** in [**Markdown**](https://wowchemy.com/docs/writing-markdown-latex/), [**Jupyter**](https://wowchemy.com/docs/import/jupyter/), or [**RStudio**](https://wowchemy.com/docs/install-locally/)
- **Plugin System** - Fully customizable [**color** and **font themes**](https://wowchemy.com/docs/customization/)
- **Display Code and Math** - Code highlighting and [LaTeX math](https://en.wikibooks.org/wiki/LaTeX/Mathematics) supported
- **Integrations** - [Google Analytics](https://analytics.google.com), [Disqus commenting](https://disqus.com), Maps, Contact Forms, and more!
- **Beautiful Site** - Simple and refreshing one page design
- **Industry-Leading SEO** - Help get your website found on search engines and social media
- **Media Galleries** - Display your images and videos with captions in a customizable gallery
- **Mobile Friendly** - Look amazing on every screen with a mobile friendly version of your site
- **Multi-language** - 34+ language packs including English, 中文, and Português
- **Multi-user** - Each author gets their own profile page
- **Privacy Pack** - Assists with GDPR
- **Stand Out** - Bring your site to life with animation, parallax backgrounds, and scroll effects
- **One-Click Deployment** - No servers. No databases. Only files.
## Themes
Wowchemy and its templates come with **automatic day (light) and night (dark) mode** built-in. Alternatively, visitors can choose their preferred mode - click the moon icon in the top right of the [Demo](https://academic-demo.netlify.com/) to see it in action! Day/night mode can also be disabled by the site admin in `params.toml`.
[Choose a stunning **theme** and **font**](https://wowchemy.com/docs/customization) for your site. Themes are fully customizable.
## License
Copyright 2016-present [George Cushen](https://georgecushen.com).
Released under the [MIT](https://github.com/wowchemy/wowchemy-hugo-themes/blob/master/LICENSE.md) license.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

File diff suppressed because one or more lines are too long

View file

@ -1,77 +0,0 @@
---
title: Display Jupyter Notebooks with Academic
subtitle: Learn how to blog in Academic using Jupyter notebooks
summary: Learn how to blog in Academic using Jupyter notebooks
authors:
- admin
tags: []
categories: []
projects: []
date: '2019-02-05T00:00:00Z'
lastMod: '2019-09-05T00:00:00Z'
image:
caption: ''
focal_point: ''
---
```python
from IPython.core.display import Image
Image('https://www.python.org/static/community_logos/python-logo-master-v3-TM-flattened.png')
```
![png](./index_1_0.png)
```python
print("Welcome to Academic!")
```
Welcome to Academic!
## Install Python and JupyterLab
[Install Anaconda](https://www.anaconda.com/distribution/#download-section) which includes Python 3 and JupyterLab.
Alternatively, install JupyterLab with `pip3 install jupyterlab`.
## Create or upload a Jupyter notebook
Run the following commands in your Terminal, substituting `<MY-WEBSITE-FOLDER>` and `<SHORT-POST-TITLE>` with the file path to your Academic website folder and a short title for your blog post (use hyphens instead of spaces), respectively:
```bash
mkdir -p <MY-WEBSITE-FOLDER>/content/post/<SHORT-POST-TITLE>/
cd <MY-WEBSITE-FOLDER>/content/post/<SHORT-POST-TITLE>/
jupyter lab index.ipynb
```
The `jupyter` command above will launch the JupyterLab editor, allowing us to add Academic metadata and write the content.
## Edit your post metadata
The first cell of your Jupter notebook will contain your post metadata ([front matter](https://sourcethemes.com/academic/docs/front-matter/)).
In Jupter, choose _Markdown_ as the type of the first cell and wrap your Academic metadata in three dashes, indicating that it is YAML front matter:
```
---
title: My post's title
date: 2019-09-01
# Put any other Academic metadata here...
---
```
Edit the metadata of your post, using the [documentation](https://sourcethemes.com/academic/docs/managing-content) as a guide to the available options.
To set a [featured image](https://sourcethemes.com/academic/docs/managing-content/#featured-image), place an image named `featured` into your post's folder.
For other tips, such as using math, see the guide on [writing content with Academic](https://wowchemy.com/docs/content/writing-markdown-latex/).
## Convert notebook to Markdown
```bash
jupyter nbconvert index.ipynb --to markdown --NbConvertApp.output_files_dir=.
```
## Example
This post was created with Jupyter. The orginal files can be found at https://github.com/gcushen/hugo-academic/tree/master/exampleSite/content/post/jupyter

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

View file

@ -1,390 +0,0 @@
---
title: Writing technical content in Markdown
date: 2019-07-12
math: true
image:
placement: 2
caption: 'Image credit: [**John Moeses Bauan**](https://unsplash.com/photos/OGZtQF8iC0g)'
---
Wowchemy is designed to give technical content creators a seamless experience. You can focus on the content and Wowchemy handles the rest.
**Highlight your code snippets, take notes on math classes, and draw diagrams from textual representation.**
On this page, you'll find some examples of the types of technical content that can be rendered with Wowchemy.
## Examples
### Code
Wowchemy supports a Markdown extension for highlighting code syntax. You can customize the styles under the `syntax_highlighter` option in your `config/_default/params.yaml` file.
```python
import pandas as pd
data = pd.read_csv("data.csv")
data.head()
```
renders as
```python
import pandas as pd
data = pd.read_csv("data.csv")
data.head()
```
### Mindmaps
Wowchemy supports a Markdown extension for mindmaps.
Simply insert a Markdown `markmap` code block and optionally set the height of the mindmap as shown in the example below.
A simple mindmap defined as a Markdown list:
<div class="highlight">
<pre class="chroma">
<code>
```markmap {height="200px"}
- Hugo Modules
- wowchemy
- wowchemy-plugins-netlify
- wowchemy-plugins-netlify-cms
- wowchemy-plugins-reveal
```
</code>
</pre>
</div>
renders as
```markmap {height="200px"}
- Hugo Modules
- wowchemy
- wowchemy-plugins-netlify
- wowchemy-plugins-netlify-cms
- wowchemy-plugins-reveal
```
A more advanced mindmap with formatting, code blocks, and math:
<div class="highlight">
<pre class="chroma">
<code>
```markmap
- Mindmaps
- Links
- [Wowchemy Docs](https://wowchemy.com/docs/)
- [Discord Community](https://discord.gg/z8wNYzb)
- [GitHub](https://github.com/wowchemy/wowchemy-hugo-themes)
- Features
- Markdown formatting
- **inline** ~~text~~ *styles*
- multiline
text
- `inline code`
-
```js
console.log('hello');
console.log('code block');
```
- Math: $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
```
</code>
</pre>
</div>
renders as
```markmap
- Mindmaps
- Links
- [Wowchemy Docs](https://wowchemy.com/docs/)
- [Discord Community](https://discord.gg/z8wNYzb)
- [GitHub](https://github.com/wowchemy/wowchemy-hugo-themes)
- Features
- Markdown formatting
- **inline** ~~text~~ *styles*
- multiline
text
- `inline code`
-
```js
console.log('hello');
console.log('code block');
```
- Math: $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
```
### Charts
Wowchemy supports the popular [Plotly](https://plot.ly/) format for interactive charts.
Save your Plotly JSON in your page folder, for example `line-chart.json`, and then add the `{{</* chart data="line-chart" */>}}` shortcode where you would like the chart to appear.
Demo:
{{< chart data="line-chart" >}}
You might also find the [Plotly JSON Editor](http://plotly-json-editor.getforge.io/) useful.
### Math
Wowchemy supports a Markdown extension for $\LaTeX$ math. You can enable this feature by toggling the `math` option in your `config/_default/params.yaml` file.
To render _inline_ or _block_ math, wrap your LaTeX math with `{{</* math */>}}$...${{</* /math */>}}` or `{{</* math */>}}$$...$${{</* /math */>}}`, respectively. (We wrap the LaTeX math in the Wowchemy _math_ shortcode to prevent Hugo rendering our math as Markdown. The _math_ shortcode is new in v5.5-dev.)
Example **math block**:
```latex
{{</* math */>}}
$$
\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}
$$
{{</* /math */>}}
```
renders as
{{< math >}}
$$\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}$$
{{< /math >}}
Example **inline math** `{{</* math */>}}$\nabla F(\mathbf{x}_{n})${{</* /math */>}}` renders as {{< math >}}$\nabla F(\mathbf{x}_{n})${{< /math >}}.
Example **multi-line math** using the math linebreak (`\\`):
```latex
{{</* math */>}}
$$f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\
1-p_{0}^{*} & \text{if }k=0.\end{cases}$$
{{</* /math */>}}
```
renders as
{{< math >}}
$$
f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\
1-p_{0}^{*} & \text{if }k=0.\end{cases}
$$
{{< /math >}}
### Diagrams
Wowchemy supports a Markdown extension for diagrams. You can enable this feature by toggling the `diagram` option in your `config/_default/params.toml` file or by adding `diagram: true` to your page front matter.
An example **flowchart**:
```mermaid
graph TD
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
```
renders as
```mermaid
graph TD
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
```
An example **sequence diagram**:
```mermaid
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
renders as
```mermaid
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
An example **Gantt diagram**:
```mermaid
gantt
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
```
renders as
```mermaid
gantt
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
```
An example **class diagram**:
```mermaid
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
```
renders as
```mermaid
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
```
An example **state diagram**:
```mermaid
stateDiagram
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
```
renders as
```mermaid
stateDiagram
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
```
### Todo lists
You can even write your todo lists in Markdown too:
```markdown
- [x] Write math example
- [x] Write diagram example
- [ ] Do something else
```
renders as
- [x] Write math example
- [x] Write diagram example
- [ ] Do something else
### Tables
Save your spreadsheet as a CSV file in your page's folder and then render it by adding the _Table_ shortcode to your page:
```go
{{</* table path="results.csv" header="true" caption="Table 1: My results" */>}}
```
renders as
{{< table path="results.csv" header="true" caption="Table 1: My results" >}}
### Callouts
Academic supports a [shortcode for callouts](https://wowchemy.com/docs/content/writing-markdown-latex/#callouts), also referred to as _asides_, _hints_, or _alerts_. By wrapping a paragraph in `{{%/* callout note */%}} ... {{%/* /callout */%}}`, it will render as an aside.
```markdown
{{%/* callout note */%}}
A Markdown aside is useful for displaying notices, hints, or definitions to your readers.
{{%/* /callout */%}}
```
renders as
{{% callout note %}}
A Markdown aside is useful for displaying notices, hints, or definitions to your readers.
{{% /callout %}}
### Spoilers
Add a spoiler to a page to reveal text, such as an answer to a question, after a button is clicked.
```markdown
{{</* spoiler text="Click to view the spoiler" */>}}
You found me!
{{</* /spoiler */>}}
```
renders as
{{< spoiler text="Click to view the spoiler" >}} You found me! {{< /spoiler >}}
### Icons
Academic enables you to use a wide range of [icons from _Font Awesome_ and _Academicons_](https://wowchemy.com/docs/getting-started/page-builder/#icons) in addition to [emojis](https://wowchemy.com/docs/content/writing-markdown-latex/#emojis).
Here are some examples using the `icon` shortcode to render icons:
```markdown
{{</* icon name="terminal" pack="fas" */>}} Terminal
{{</* icon name="python" pack="fab" */>}} Python
{{</* icon name="r-project" pack="fab" */>}} R
```
renders as
{{< icon name="terminal" pack="fas" >}} Terminal
{{< icon name="python" pack="fab" >}} Python
{{< icon name="r-project" pack="fab" >}} R
### Did you find this page helpful? Consider sharing it 🙌

View file

@ -1,71 +0,0 @@
{
"data": [
{
"uid": "babced",
"fill": "tonexty",
"mode": "none",
"name": "Col2",
"type": "scatter",
"x": [
"2000-01-01",
"2001-01-01",
"2002-01-01",
"2003-01-01",
"2004-01-01",
"2005-01-01",
"2006-01-01",
"2007-01-01",
"2008-01-01",
"2009-01-01",
"2010-01-01",
"2011-01-01",
"2012-01-01",
"2013-01-01",
"2014-01-01",
"2015-01-01",
"2016-01-01"
],
"y": [
"17087182",
"29354370",
"38760373",
"40912332",
"51611646",
"64780617",
"85507314",
"121892559",
"172338726",
"238027855",
"206956723",
"346004403",
"697089489",
"672985183",
"968882453",
"863105652",
"1068513050"
],
"fillcolor": "rgb(224, 102, 102)"
}
],
"layout": {
"title": "Total Number of Websites",
"width": 800,
"xaxis": {
"type": "date",
"range": [946702800000, 1451624400000],
"title": "Source: <a href=\"http://www.scribblrs.com/\">Scribblrs</a><br>Source: <a href=\"http://www.internetlivestats.com/total-number-of-websites/\">Internet Live Stats</a>",
"showgrid": false,
"autorange": true,
"tickformat": "%Y"
},
"yaxis": {
"type": "linear",
"range": [0, 1124750578.9473684],
"title": "",
"autorange": true
},
"height": 500,
"autosize": false
},
"frames": []
}

View file

@ -1,4 +0,0 @@
customer_id, score
1,0
2,0.5
3,1
1 customer_id score
2 1 0
3 2 0.5
4 3 1

View file

@ -1,25 +0,0 @@
# Essentially Minimal theme but with constant home section bg color.
name = "Starter Blog"
[light]
# Primary
primary = "#2962ff"
# Menu
menu_primary = "rgb(247, 250, 252)"
menu_text = "#34495e"
menu_text_active = "#2962ff"
menu_title = "#2b2b2b"
# Home sections
home_section_odd = "rgb(247, 250, 252)"
home_section_even = "rgb(247, 250, 252)"
[dark]
primary = "#bbdefb"
link = "#bbdefb"
link_hover = "#bbdefb"
background = "rgb(26, 32, 44)"
home_section_odd = "rgb(26, 32, 44)"
home_section_even = "rgb(26, 32, 44)"
menu_primary = "rgb(26, 32, 44)"

View file

@ -1,9 +0,0 @@
module github.com/wowchemy/hugo-blog-theme
go 1.15
require (
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify v1.0.0 // indirect
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify-cms v1.0.0 // indirect
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 v5.6.0 // indirect
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View file

@ -1,5 +1,8 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
@ -31,18 +34,22 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.119.0'
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /home/runner/.cache/hugo_cache # Cache path for Hugo v0.116.0+
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

File diff suppressed because one or more lines are too long

View file

@ -3,8 +3,11 @@
# Documentation: https://wowchemy.com/docs/
# This file is formatted using YAML syntax - learn more at https://learnxinyminutes.com/docs/yaml/
# SEO
# Appearance
appearance:
theme_default: system
# SEO
marketing:
seo:
site_type: Person
@ -19,6 +22,12 @@ marketing:
google: ''
baidu: ''
# Site header
header:
navbar:
enable: true
# Site footer
footer:
copyright:
notice: '© {year} Me. This work is licensed under {license}'
@ -29,13 +38,11 @@ footer:
allow_commercial: false
# Localization
locale:
date_format: 'Jan 2, 2006'
time_format: '3:04 PM'
# Site features
features:
syntax_highlighter:
theme_light: github-light

View file

@ -28,7 +28,7 @@ You might also find the [Plotly JSON Editor](http://plotly-json-editor.getforge.
## Diagrams
Wowchemy supports a Markdown extension for diagrams. You can enable this feature by toggling the `diagram` option in your `config/_default/params.toml` file or by adding `diagram: true` to your page front matter.
Wowchemy supports the _Mermaid_ Markdown extension for diagrams.
An example **flowchart**:

View file

@ -15,9 +15,9 @@ Easily manage your projects - create ideation mind maps, Gantt charts, todo list
Wowchemy supports a Markdown extension for mindmaps.
Simply insert a Markdown `markmap` code block and optionally set the height of the mindmap as shown in the example below.
Simply insert a Markdown code block labelled as `markmap` and optionally set the height of the mindmap as shown in the example below.
A simple mindmap defined as a Markdown list:
Mindmaps can be created by simply writing the items as a Markdown list within the `markmap` code block, indenting each item to create as many sub-levels as you need:
<div class="highlight">
<pre class="chroma">
@ -45,7 +45,7 @@ renders as
## Diagrams
Wowchemy supports a Markdown extension for diagrams. You can enable this feature by toggling the `diagram` option in your `config/_default/params.toml` file or by adding `diagram: true` to your page front matter.
Wowchemy supports the _Mermaid_ Markdown extension for diagrams.
An example **Gantt diagram**:

View file

@ -19,13 +19,13 @@ Use it as your second brain, either publicly sharing your knowledge with your pe
## Mindmaps
Wowchemy supports the _markmap_ Markdown extension for mindmaps.
Wowchemy supports a Markdown extension for mindmaps.
With this open format, can even edit your mindmaps in other popular tools such as Obsidian.
Simply insert a Markdown `markmap` code block and optionally set the height of the mindmap as shown in the example below.
Simply insert a Markdown code block labelled as `markmap` and optionally set the height of the mindmap as shown in the example below.
A simple mindmap defined as a Markdown list:
Mindmaps can be created by simply writing the items as a Markdown list within the `markmap` code block, indenting each item to create as many sub-levels as you need:
<div class="highlight">
<pre class="chroma">
@ -51,7 +51,7 @@ renders as
- wowchemy-plugins-reveal
```
A more advanced mindmap with formatting, code blocks, and math:
Anh here's a more advanced mindmap with formatting, code blocks, and math:
<div class="highlight">
<pre class="chroma">

View file

@ -4,4 +4,4 @@ go 1.19
require github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify v1.0.1-0.20231024173257-66e3c7e27eb0
require github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-tailwind v0.0.0-20231027195653-58ed6b3aa233
require github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-tailwind v0.0.0-20231029091833-0f56496291b7

70
starters/course/.github/publish.yaml vendored Normal file
View file

@ -0,0 +1,70 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Provide permission to clone the repo and deploy it to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build website
build:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deploy website to GitHub Pages hosting
deploy:
if: github.repository_owner != 'wowchemy'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View file

@ -0,0 +1,70 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Provide permission to clone the repo and deploy it to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build website
build:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deploy website to GitHub Pages hosting
deploy:
if: github.repository_owner != 'wowchemy'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View file

@ -0,0 +1,70 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Provide permission to clone the repo and deploy it to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build website
build:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deploy website to GitHub Pages hosting
deploy:
if: github.repository_owner != 'wowchemy'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

70
starters/portfolio/.github/publish.yaml vendored Normal file
View file

@ -0,0 +1,70 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Provide permission to clone the repo and deploy it to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build website
build:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deploy website to GitHub Pages hosting
deploy:
if: github.repository_owner != 'wowchemy'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View file

@ -0,0 +1,57 @@
# Wowchemy GitHub Action to convert Bibtex publications to Markdown-based webpages
name: Import Publications From Bibtex
# Require permission to create a PR
permissions:
contents: write
pull-requests: write
# Run workflow when a `.bib` file is added or updated in the `data/` folder
on:
push:
branches: ['main']
paths: ['publications.bib']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
wowchemy:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install academic==0.10.0
- name: Run Academic (Bibtex To Markdown Converter)
# Check `.bib` file exists for case when action runs on `.bib` deletion
# Note GH only provides hashFiles func in `steps.if` context, not `jobs.if` context
if: ${{ hashFiles('publications.bib') != '' }}
run: academic import publications.bib content/publication/ --compact
- name: Create Pull Request
# Set ID for `Check outputs` stage
id: cpr
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'content: import publications from Bibtex'
title: Wowchemy - Import latest publications
body: |
Import the latest publications from `publications.bib` to `content/publication/`.
将最新的出版物从`publications.bib`导入到`content/publication/`。
[View Documentation](https://github.com/wowchemy/bibtex-to-markdown)
base: main
labels: automated-pr, content
branch: wowchemy-import-publications
delete-branch: true
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

View file

@ -0,0 +1,70 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Provide permission to clone the repo and deploy it to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build website
build:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deploy website to GitHub Pages hosting
deploy:
if: github.repository_owner != 'wowchemy'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View file

@ -0,0 +1,70 @@
name: Deploy Wowchemy website to GitHub Pages
env:
WC_HUGO_VERSION: '0.119.0'
on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Provide permission to clone the repo and deploy it to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build website
build:
if: github.repository_owner != 'wowchemy'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deploy website to GitHub Pages hosting
deploy:
if: github.repository_owner != 'wowchemy'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2