Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update website #24

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
22ce20b
Add markdownlint
FireIsGood Feb 7, 2025
3c1d765
Update README formatting
FireIsGood Feb 7, 2025
b901820
Add license to README
FireIsGood Feb 8, 2025
2328abc
Add prettier
FireIsGood Feb 8, 2025
ddb76f6
Clean up README
FireIsGood Feb 8, 2025
93eed44
Add pagefind script
FireIsGood Feb 8, 2025
660c1fd
Remove unused font readme
FireIsGood Feb 8, 2025
c0c3ba0
Remove nobr shortcode (unused and deprecated
FireIsGood Feb 8, 2025
e896d36
Add markdownlint
FireIsGood Feb 8, 2025
675d8a7
Format and lint everything
FireIsGood Feb 8, 2025
9bed21a
Fix head being dumped into the body
FireIsGood Feb 11, 2025
c51af33
Add favicon
FireIsGood Feb 11, 2025
7b1a84a
Fix hero image centering
FireIsGood Feb 11, 2025
7c72895
Add lang to html
FireIsGood Feb 11, 2025
8507700
Refactor head meta tags
FireIsGood Feb 11, 2025
cd0b320
Change list icon to just HTML entity
FireIsGood Feb 11, 2025
4ee2bfd
Change header size to be consistent with OSU website
FireIsGood Feb 11, 2025
b3181eb
Refactor footer link styles
FireIsGood Feb 11, 2025
f23873e
Fix footer not fitting to bottom
FireIsGood Feb 11, 2025
1bc0668
Change breadcrumb to match CASS
FireIsGood Feb 11, 2025
813b28c
Change logo to match OSU main site
FireIsGood Feb 11, 2025
305dc86
Add 404 page
FireIsGood Feb 11, 2025
67e82bb
Reformat other changes for prettier/markdownlint setup
FireIsGood Feb 13, 2025
aa8f7e7
Improve blog display and fix pagination
FireIsGood Feb 13, 2025
f316633
Fix hosting cards style
FireIsGood Feb 13, 2025
1988c7b
Update blog page title
FireIsGood Feb 13, 2025
e8093cd
Remove unused button
FireIsGood Feb 13, 2025
22352fd
Fix menu unintended margin
FireIsGood Feb 13, 2025
c82f9fc
Improve main menu style
FireIsGood Feb 13, 2025
07ac566
Improve blog header text link semantics
FireIsGood Feb 13, 2025
281e325
Improve all styles
FireIsGood Feb 15, 2025
566c2d1
Add hero links and icons
FireIsGood Feb 15, 2025
477d140
Move font size bump to body for REM calculations
FireIsGood Feb 15, 2025
66854d7
Add left margin to floating people images
FireIsGood Feb 15, 2025
507b75c
Fix blog list page incorrect page title
FireIsGood Feb 17, 2025
627b598
Add page tags
FireIsGood Feb 18, 2025
7a22b51
Fix goldmark raw html warning
FireIsGood Feb 18, 2025
82e9979
Update archetypes
FireIsGood Feb 18, 2025
3302ae3
Update all posts to match new archetype
FireIsGood Feb 18, 2025
69e1a78
Decrease H2 font size to differentiate from H1
FireIsGood Feb 18, 2025
28fed67
Decrease left pad of ul
FireIsGood Feb 18, 2025
9738ed5
Remove unused clearfix
FireIsGood Feb 18, 2025
837b5c9
Add blog tag setup
FireIsGood Feb 18, 2025
234afce
Fix formatting to a proper list
ramereth Feb 20, 2025
cda0166
Fix baseURL breaking hugo server output
FireIsGood Feb 22, 2025
6f9daef
Improve README
FireIsGood Feb 22, 2025
3cb028b
Add markdownlint and Prettier CI
FireIsGood Feb 26, 2025
37640e0
Fix lint command file finding argument
FireIsGood Feb 26, 2025
24317c7
Fix markdownlint errors
FireIsGood Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/markdownlint_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Markdownlint Check

# This action works with pull requests and pushes on the main branch
on:
pull_request:
push:
branches: [main]


jobs:
lint:
name: Markdownlint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v19
with:
config: './.markdownlint.yaml'
globs: |
**/*.md
30 changes: 30 additions & 0 deletions .github/workflows/prettier_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Prettier Check

# This action works with pull requests and pushes on the main branch
on:
pull_request:
push:
branches: [main]

jobs:
prettier:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Run Prettier
id: prettier-run
uses: rutajdash/prettier-cli-action@v1.0.0
with:
config_path: ./.prettierrc

# This step only runs if prettier finds errors causing the previous step to fail
# This steps lists the files where errors were found
- name: Prettier Output
if: ${{ failure() }}
shell: bash
run: |
echo "The following files are not formatted:"
echo "${{steps.prettier-run.outputs.prettier_output}}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
public/
pagefind
.hugo_build.lock
node_modules
10 changes: 10 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md
line-length:
line_length: 120
tables: false

# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md
no-inline-html: false

# MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md036.md
no-emphasis-as-heading: false
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"printWidth": 120,
"proseWrap": "always",
"plugins": ["prettier-plugin-go-template"],
"overrides": [
{
"files": ["*.html"],
"options": {
"parser": "go-template"
}
}
]
}
164 changes: 139 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,165 @@
OSUOSL Hugo Static Site
=======================
# OSUOSL Hugo Static Site

Migrated from our static [Pelican site](https://github.com/osuosl/osuosl-pelican)

Based off of the Mainroad theme on https://github.com/Vimux/Mainroad and the previous [OSL theme](https://github.com/osuosl/dougfir-pelican-theme)
Based off of the [Mainroad theme](https://github.com/Vimux/Mainroad) and the previous
[OSL theme](https://github.com/osuosl/dougfir-pelican-theme)

Changes From Pelican
--------------------
## Development

Hugo uses markdown to write its pages, thus the front matter of a page will look slightly different.
### Prerequisites

The author of a page should be included as an array of ``authors`` within the front matter:
Read the [Hugo getting started guide's prerequisite list](https://gohugo.io/getting-started/quick-start/#prerequisites)
and install the Hugo binary or package. You can check if it is installed from the command line by running:

```bash
hugo version
```
---
authors: [OSUOSL Admin]
---

This project uses npm for the functionality of Prettier and Markdownlint. You can check that npm is installed from the
command line by running:

```bash
npm -v
```

To add a header image at the top of a blog pst, use the CSS tag ``#blog``:
The search feature is implemented using [Pagefind](https://pagefind.app/) and can be run with the npm script `serve` or
by [downloading the binary](https://pagefind.app/docs/installation/#downloading-a-precompiled-binary).

### Setup

If you do not have permissions to work directly on a branch of the repository, you will have to
[fork the repo](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
and work from your fork. If you do have permission,
[create a branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository)
and work from your branch.

Once the prerequisites are installed and you are working off the fork or branch,
[clone the repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
to your local machine.

This can be done from the command line:

```bash
# Fork
git clone git@github.com:YOURUSERNAMEHERE/website.git ./osl-website

# Branch
git clone git@github.com:osuosl/website.git ./osl-website
```
![Image Alt](/images/image_path#blog)

Then, navigate to the folder and then install the dependencies:

```bash
cd ./osl-website
npm install
```

### Local Development

To compile and host the site under development on port `1313`, run:

```bash
hugo server
```

Once Hugo is done setting up, you should see a success message:

```shell
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
```

#### Formatting and Linting

This project uses [prettier](https://prettier.io) and [markdownlint](https://github.com/DavidAnson/markdownlint). You
can install them in your preferred editor to see changes as you edit or run them from the command line.

To format and lint from the command line, run:

```bash
# Format via prettier
npm run format

# Lint via markdownlint
npm run lint
```

Dependencies
------------
### Preview Production

The search feature is implemented using [Pagefind](https://pagefind.app/) and can be installed with `npx` or by [downloading the binary](https://pagefind.app/docs/installation/#downloading-a-precompiled-binary).
If you want to preview the production server to see the full search functionality, you can build the pages and then
serve from Pagefind. Pagefind sources from the `public/` directory Hugo compiles when the website is built.

Development
-----------
First compile the pages:

To compile and host the site under development on port 1313, use:
```bash
hugo
```

Then run it using Pagefind through the provided helper npm script or the binary using the specific flags:

```bash
# NPM helper script
npm run serve

# Binary
./pagefind --site public --serve
```
$ hugo server

## Adding Content

Content is added inside the `/content` folder, though it varies based on what you would like to do.

### Adding a New Blog Post

Regular pages use the default `/archetypes/default.md` archetype.

Blog posts are stored in `/content/blog` and use the associated `/archetypes/blog.md` archetype.

To add a blog post, use the `hugo new` command:

```bash
hugo new blog/your-slug-title-here.md
```

Pagefind sources from the `public/` directory hugo compiles when the website is built. To view the website with full functionality:
The author of a page should be included as an array of `authors` within the front matter:

First compile it:
```md
---
# ...
authors: [OSUOSL Admin]
# ...
---
```
$ hugo

To add a header image at the top of a blog post, use the CSS tag `#blog`:

```md
![Image Alt](/images/image_path#blog)
```

Then run it using pagefind:
### Adding a New Tag

Tags (called Terms in Hugo) are added simply by adding an associated string in the frontmatter of a blog post. This
alone will create a semi-broken tag due to how tags are rendered, so you will have to add an associated page in the
content folder to add metadata.

After you add a tag to a blog post, create a new file in the directory `/content/tags/[tag name here]/_index.md`, making
the folder if it does not already exist.

Inside this file, include the frontmatter template below as well as any content you want displayed along with the tag:

```markdown
---
title: "Example Tag Here"
slug: example-tag-here
---

Content here will be placed on the tag page. You may also include images here.
```
$ ./pagefind --site public --serve
```

If you do not do this, the tag will be displayed as not having a name.

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
8 changes: 8 additions & 0 deletions archetypes/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date | dateFormat "2006-04-13" }}
authors: ["OSL Admin"]
slug: {{ .Name }}
tags: []
draft: true
---
4 changes: 1 addition & 3 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
slug: {{ .Name }}
---

Loading
Loading