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

Rebuild website #8

Merged
merged 14 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 0 additions & 21 deletions .github/workflows/ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public/
pagefind
.hugo_build.lock
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/hextra"]
path = themes/hextra
url = https://github.com/imfing/hextra.git
File renamed without changes.
65 changes: 65 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
pipeline {
agent { label 'web2' }
environment {
GITHUB_TOKEN = credentials('site_pr_builder')
STAGING_PATH = "/var/www/staging.osuosl.org/htdocs"
PRODUCTION_PATH = "/var/www/new.osuosl.org/htdocs"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build Hugo Site') {
steps {
script {
sh 'hugo --minify' // Build the Hugo site for all branches
}
}
}
stage('Deploy Site') {
steps {
script {
if (env.BRANCH_NAME == 'main') {
// Deploy to production when the branch is 'main'
sh """
rsync -avH --delete public/ ${PRODUCTION_PATH}/
"""
} else if (env.CHANGE_ID) {
// Deploy to a staging directory based on the PR number
def stagingPath = "${STAGING_PATH}/osuosl-website-${env.CHANGE_ID}"
sh """
rsync -avH --delete public/ ${stagingPath}/
"""
} else {
echo "Not a PR or main branch, skipping deployment"
}
}
}
}
}
post {
always {
script {
def siteUrl = ""
if (env.BRANCH_NAME == 'main') {
siteUrl = "https://new.osuosl.org/"

slackSend channel: "#alerts",
color: currentBuild.result == 'SUCCESS' ? ' good' : 'danger',
message: "Build osuosl/website - ${env.BUILD_ID} finished with status ${buildStatus} (<${env.BUILD_URL}|Open>)"
} else if (env.CHANGE_ID) {
siteUrl = "https://osuosl-website-${env.CHANGE_ID}.staging.osuosl.org/"
}

// Post build status with a link to the site
githubNotify context: 'Published site URL',
description: 'Build completed',
status: currentBuild.result,
targetUrl: "${siteUrl}",
message: "Site available: ${siteUrl}"
}
}
}
}
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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
Based off of the Mainroad theme on https://github.com/Vimux/Mainroad and the previous [OSL theme](https://github.com/osuosl/dougfir-pelican-theme)

Changes From Pelican
--------------------
Expand All @@ -25,11 +25,30 @@ there is a CSS tag, ``#blog`` that mimics the header image:
![Image Alt](/images/image_path#blog)
```

To include a blog post on the front page's carousel, add it to the [carousel.yaml](/data/carousel.yaml) file.

Dependencies
------------

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).

Development
-----------

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

```
$ hugo server
```

Pagefind sources from the `public/` directory hugo compiles when the website is built. To view the website with full functionality:

First compile it:
```
$ hugo
```

Then run it using pagefind:
```
$ ./pagefind --site public --serve
```
16 changes: 5 additions & 11 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
baseURL = "/"
languageCode = "en-us"
title = "OSU Open Source Lab"
baseURL = '/'
languageCode = 'en-us'
title = 'OSU Open Source Lab'
theme = 'osuosl'
relativeURLs = true
enableInlineShortcodes = true
theme = 'mainroad'

[Params]
post_meta = ["blog_header"]

[Params.logo]
image = "images/OSU_newlogo.png"
subtitle = "OSU Open Source Lab"

[menu]
[[menu.main]]
Expand Down
1 change: 1 addition & 0 deletions content/about/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "About"
slug: about
author: Lucy Wyman
type: page
---

The Open Source Lab is a nonprofit organization working for the advancement of
Expand Down
Loading